[wtr-general] Watir -- May just be a Cucumber item

2015-02-10 Thread Michael Kirkpatrick
I was wondering if the tags are stored in an array somewhere and can be 
access so that you can do different after hooks say for Jira or other 
plugins?

Thanks, 


-- 
-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
Watir General group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] file_field.set not working in watir-classic 4.0.1 on IE 9

2014-08-19 Thread Michael
Hello!

Curious if anyone else has run into this issue. We are trying to use watir 
to set a path using file_field:
browser.file_field.set(C:\\test\\profile-empty.gif)

It works one some of our testing environments, but gets hung up on others. 
Here is the error, which makes sense because the choose window never opens:
RAutomation::UnknownWindowException: Window with locator {:index=0, :title
=/^(?-mix:(?i-mx:choose file( to upload)?)|Elegir\ archivos\ para\ cargar|
Datei\ zum\ Hochladen)$/i} doesn't exist or is not visible!
 gems/rautomation-0.15.0/lib/rautomation/window.rb:226:in `rescue in 
wait_until_present'
 gems/rautomation-0.15.0/lib/rautomation/window.rb:224:in 
`wait_until_present'
 gems/rautomation-0.15.0/lib/rautomation/window.rb:214:in `text_field'
 gems/watir-classic-4.0.1/lib/watir-classic/dialogs/file_field.rb:48:in 
`set_file_name'
 gems/watir-classic-4.0.1/lib/watir-classic/dialogs/file_field.rb:34:in 
`set'
 watir/tests/workflow/CgiAttributes.rb:2525:in `testTypeFile'

Was able to reproduce manually, and it appears that click_no_wait in the 
code below is not doing anything when it fails. It does not bring up the 
file selection dialog.
def set(file_path)
  assert_file_exists(file_path)
  assert_exists
  click_no_wait
  set_file_name file_path.gsub(File::SEPARATOR, File::ALT_SEPARATOR)
  open_button.click
  Wait.until(5) {value.include?(File.basename(file_path))}
end

Manually clicking the button while the browser is waiting for the choose a 
file dialog opens it and then it is populated immediately. I tried a few 
other things like what is on this page 
(http://stackoverflow.com/questions/13918184/watir-help-click-no-wait-and-execute-script-not-working-as-expected),
 
but the click freezes execution so the timeout never occurs:
Timeout::timeout(1) { @browser.button(:value, 'Submit').click }

Any suggestions or known patches? The only search results I found were from 
2012 and it was an issue with an iFrame. Here there is no iFrame, just the 
root page. The HTML is basic, and watir finds the element and can interact 
in other ways with it. RAutomation seems to be doing the right thing once 
the file dialog opens... but it doesn't open in some cases.

Thanks in advance,
Michael

-- 
-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
Watir General group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: Jquery+Watir problem with file_field

2013-03-08 Thread Michael Kernaghan
yes manually works fine.
 
yes i tried various static delays it does not alleviate the problem

On Wednesday, 6 March 2013 14:33:13 UTC-8, Alex Shtayer wrote:


 Hmm, strange

 Could you perform mentioned steps manually? Is everything work as it 
 should? (without any file clearing from select window)?

 Did you try to put static delay just for test purpose to see that 
 functionality works properly? (like sleep 10)


-- 
-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
Watir General group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [wtr-general] Jquery+Watir problem with file_field

2013-03-08 Thread Michael Kernaghan
it is a proprietary Saas so i cant post a link.
 
the code is just this:
form 
 


   div class=form_layout_table_row  div 
class=form_layout_table_cell_labellabel 
for=MessageMessage:/label  /div  div 
class=form_layout_table_cell_controlinput type='file' 
name='messageFile' id='messageFile' /  /div/div  /div  div 
style=padding-top: 4pxinput type=submit value=Submit/input  
/div/form 

 
a similar one for public access would be great but i don't think i can 
search for one at this time
 

On Thursday, 7 March 2013 01:45:41 UTC-8, Željko Filipin wrote:
 

 On Wed, Mar 6, 2013 at 9:58 PM, Michael Kernaghan 
 michael@gmail.comjavascript:
  wrote:

 file is cleared from select window and save throws error because no file 
 was selected.


 It would help if you could provide link to the page, or a similar one 
 where the problem can be reproduced.

 Željko
 --
 https://leanpub.com/watirbook 


-- 
-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
Watir General group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[wtr-general] Re: Jquery+Watir problem with file_field

2013-03-08 Thread Michael Kernaghan
An excellent idea. i tried that but it did not fix it.
 
 b.file_field(:id, messageFile).fire_event(onchange)
 
Debug shows:
Watir::FileField.new(Watir::IE.attach(:hwnd, 1839554), :tag_name = 
Array.new  'file', :unique_number = 5).click!();

On Wednesday, 6 March 2013 16:24:17 UTC-8, Chuck van der Linden wrote:

 The other thing I would try is before trying to click submit, fire an 
 onchange event at the file field, if there is perhaps some javascript that 
 would react when a user manually sets the field but is not getting tripped 
 when we set it programmatically. 

 On Wednesday, March 6, 2013 2:33:13 PM UTC-8, Alex Shtayer wrote:


 Hmm, strange

 Could you perform mentioned steps manually? Is everything work as it 
 should? (without any file clearing from select window)?

 Did you try to put static delay just for test purpose to see that 
 functionality works properly? (like sleep 10)



-- 
-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
Watir General group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[wtr-general] Jquery+Watir problem with file_field

2013-03-06 Thread Michael Kernaghan


*Jquery+Watir problem i can't solve is this:*
b.file_field(:id, messageFile).set(@messagePath)

everything looks good, correct file selected and in the select window
b.button(:value, Submit).click
file is cleared from select window and save throws error because no file 
was selected.
ever seen this?

-- 
-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
Watir General group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[wtr-general] Newbie w/ Few Questions

2012-04-19 Thread Michael Goldberg
Hi,

I am new to Watir.
I have been using AutoIT for a lot of my automation, and find that in
some instances I am unable to do what I need due to the complicated
scripting of webpages. I looked into other languages and thought Watir
would be a nice fit for what I need.

I have a few questions, I was hoping someone might be able to answer.

1) Syntax,
Looking at different examples on the web I see the sometimes
ie.frame(:index, 1) is used and other times ie.frame(:index = 1) is
used, what is the difference?  Sometimes one works for me other times
they don't.

2)Output,
How do I see what I am doing?
With Autoit, I was able to see what i was doing via the console?
I would find the object, and print out the innerhtml to make sure I
was in the correct spot? Is there something similar in Watir?  Is
there a command to see the text and / or html of an object?

3)I am having issues connecting to frames.
I connect to IE fine, and then run ie.show_frames
It prints out a list of frames on the screen.
I try the syntax ie.frame(:index, 1) and i get an error message
stating located=false
If I try ie.frame(:index, 1).locate, it seems that I get connected.
But then when I try going deeper into another nested frame I keep
getting error messages.

I visited the wiki page http://wiki.openqa.org/display/WTR/Frames
and when I try their example

ie.frame(:name, frame).frame(:name, nested_frame)

this doesn't work I'm assuming because
this doesn't work - ie.frame(:name, frame)

I would appreciate any help available

Thanks, Mike

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


Re: [wtr-general] Re: Trying to go back to watir 1.6.2, won't install correctly

2012-02-18 Thread Michael
Like with Chuck we have been able to upgrade hundreds of scripts successfully 
to Watir 2+ so far. So if you have some specific errors a can help you with let 
us know. The new Watir is so much easier to use and faster.

Chuck van der Linden sqa...@gmail.com wrote:

The other than might bite you is if you are using something like the
RUBYLIB environment variable to assist ruby with finding helper
methods you may have located in a specific directory.  That can also
cause the same error when you are trying to require the file that
holds those methods.

Sorry to hear that you had some many issues trying to upgrade your
scripts.  If you can give us any kind of post-mortem dump of the hard
parts of the experience, it might help to figure out how to better
document the process, or make things easier in the future.  We really
need to improve the user experience there.

I've been doing similar upgrades, but to scripts a bit newer than
yours, and perhaps that has made a big difference for me.

On Feb 17, 9:31 am, Lisa Crispin lisa.cris...@gmail.com wrote:
 Thanks, Trevor, I do have that RUBYOPT variable set.
 -- Lisa









 On Fri, Feb 17, 2012 at 4:10 AM, Trevor trevorm1...@gmail.com
wrote:
  Hi Lisa,
  I have been going through the pain of upgrading to Ruby 1.9.3 and
  Watir 3.0, but haven't really kept a log of all the changes.
  I have been going back and forward between various versions of
Ruby/
  Watir and I think when I saw this problem before I set
  RUBYOPT=rubygems in the system environment variables.
  Might be worth trying.

  Trevor

  On Feb 17, 3:29 am, Lisa Crispin lisa.cris...@gmail.com wrote:
   I know, I had uninstalled Ruby 1.8.7 because the require 'watir'
kept
   failing, and installed Ruby 1.8.6, but now the install of watir
won't
  work.

   When I typed gem install watir in Ruby 1.8.7, I got Watir 2. I
don't
  want
   Watir 2, I want 1.6.2. Will that just happen by magic? I know I
can just
   try it, but I'm getting really tired of uninstalling and
installing
  things.

   thanks,
   Lisa

   On Thu, Feb 16, 2012 at 6:28 PM, Željko Filipin 
  zeljko.fili...@gmail.comwrote:

On Thu, Feb 16, 2012 at 7:10 PM, Lisa Crispin
lisa.cris...@gmail.com
wrote:
 I get *** LOCAL GEMS ***

If it does not list watir gem there, then you do not have it
installed.
Try running this again:

gem install watir

Željko

--
Before posting, please readhttp://watir.com/support. In short:
search
before you ask, be nice.

watir-general@googlegroups.com
   http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com

   --
   Lisa Crispin
   Co-author with Janet Gregory, _Agile Testing: A Practical Guide
for
  Testers
   and Agile Teams_ (Addison-Wesley 2009)
   Contributor to _Beautiful Testing_ (O'Reilly
2009)http://lisacrispin.com
   @lisacrispin on Twitterhttp://entaggle.com/lisacrispin

  --
  Before posting, please readhttp://watir.com/support. In short:
search
  before you ask, be nice.

  watir-general@googlegroups.com
 http://groups.google.com/group/watir-general
 
watir-general+unsubscr...@googlegroups.comhttp://groups.google.com/group/watir-general%0Awatir-general+unsubscr...

 --
 Lisa Crispin
 Co-author with Janet Gregory, _Agile Testing: A Practical Guide for
Testers
 and Agile Teams_ (Addison-Wesley 2009)
 Contributor to _Beautiful Testing_ (O'Reilly
2009)http://lisacrispin.com
 @lisacrispin on Twitterhttp://entaggle.com/lisacrispin

-- 
Before posting, please read http://watir.com/support. In short: search
before you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Watir 3.0.rc1 breaks select_value of a select list

2012-01-18 Thread Michael
A heads up that I created a bug report about an issue we experienced
while testing our code with Watir 3.0.rc1.

http://jira.openqa.org/browse/WTR-498

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


Re: [wtr-general] Watir with a remote desktop

2012-01-14 Thread Michael
We are on windows and launch our remote tests with psexec.exe. The only catch 
is that you must have logged in with RDP once and leave the session open. 
psexec then allows you to specify a session to connect to.


On 2012-01-13, at 6:48 AM, chtiloft wrote:

 hi all,
 i am looking for a tool to make performance tests. and i am wondering
 if watir can do it. The particularity, is that we use a remote destop
 to run tests.
 
 tks in advance
 Arnaud
 
 -- 
 Before posting, please read http://watir.com/support. In short: search before 
 you ask, be nice.
 
 watir-general@googlegroups.com
 http://groups.google.com/group/watir-general
 watir-general+unsubscr...@googlegroups.com

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


Re: [wtr-general] I need to retrieve multiple span class=discussion-title

2011-11-07 Thread Michael
That appears to be because your first LI doesn't have a H2 inside of it. When 
you put one LI after another, the browser will automatically close the first 
before the second opens.

 ul class=items
 li class=item subscriptions-description
 li class=item digest-options
 h2Digest Options/h2


Fix your HTML syntax and you should be good to go.

Michael

On 2011-Nov-07, at 6:08 AM, Joe Fleck wrote:

 No worries,
 
 here is what I got when I ran the code:
 
 ree-1.8.7-2010.02 :024  section_headers = $browser.div(:class,mod simple 
 your-subscriptions).div(:class,bd).ul(:class,items).lis
  = #Watir::LICollection:0x1044bf000 @parent=#Watir::UList:0x1044bf0f0 
 located=false selector={:class=items, :tag_name=ul}, 
 @selector={:tag_name=li} 
 ree-1.8.7-2010.02 :025  section_headers.each do|sec_hdr|
 ree-1.8.7-2010.02 :026  puts hdr = sec_hdr.h2.text
 ree-1.8.7-2010.02 :027?   end
 Watir::Exception::UnknownObjectException: unable to locate element, using 
 {:tag_name=h2}
   from 
 /Users/josephfleck/.rvm/gems/ree-1.8.7-2010.02/gems/watir-webdriver-0.3.4/lib/watir-webdriver/elements/element.rb:248:in
  `assert_exists'
   from 
 /Users/josephfleck/.rvm/gems/ree-1.8.7-2010.02/gems/watir-webdriver-0.3.4/lib/watir-webdriver/elements/element.rb:55:in
  `text'
   from (irb):26
   from 
 /Users/josephfleck/.rvm/gems/ree-1.8.7-2010.02/gems/watir-webdriver-0.3.4/lib/watir-webdriver/element_collection.rb:21:in
  `each'
   from 
 /Users/josephfleck/.rvm/gems/ree-1.8.7-2010.02/gems/watir-webdriver-0.3.4/lib/watir-webdriver/element_collection.rb:21:in
  `each'
   from (irb):25
   from 
 /Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/site_ruby/1.8/rubygems.rb:406
 
 If I do it this way:
 
 ree-1.8.7-2010.02 :034  section_headers.each do|sec_hdr|
 ree-1.8.7-2010.02 :035  puts hdr = sec_hdr.text
 ree-1.8.7-2010.02 :036?   end
 
 I get this output which at a level to high
 
 Association CDK Sandbox provides you with all updates from the community that 
 you subscribe to in a single email, delivered weekly or daily. You can 
 customize the content of your digest and how often you want to receive it. To 
 stop receiving the digest, just set the frequency of updates to never.
 * Digest Options
 Frequency of digest:
 Weekly
 Daily
 Never
 Format of digest:
 HTML Format (images)
 Text Only
 * Community Features
 Guided Discussions
 * Member Discussion Topics
 Select the topics you're interested in to receive activity updates in those 
 areas.
 Engineering
 UX
 QA
 
 I have starred those headers I need.
 
 
 
 On Sun, Nov 6, 2011 at 9:45 PM, Michael mmcwill...@gmail.com wrote:
 A second looks at your code made me think you should be using ul (singular 
 because you only have one), and append lis on the end to get all the li's 
 contained within the ul.
 
 My Code:section_headers = $browser.div(:class,bd).ul(:class,items).lis
 
 
 Sorry about the first response, please disregard it.
 
 Michael
 
 On 2011-Nov-06, at 7:40 PM, Michael wrote:
 
 You probably intended to use uls which will return a list of ul's instead of 
 ul which only returns the first matching ul.
 
 Try:
 My Code:section_headers = $browser.div(:class,bd).uls(:class,items)
 
 
 Michael
 
 On 2011-Nov-06, at 7:09 PM, Joe Fleck wrote:
 
 Hi Chuck,
 
 I am still having a bit of trouble with getting a group of h2 from a page.
 
 My Code:section_headers = $browser.div(:class,bd).ul(:class,items)
 section_headers.each do|sec_hdr|
 puts hdr = sec_hdr.h2.text
 end
 
 I get the following error message.
 NoMethodError: undefined method `each' for #Watir::UList:0x10aa117f0
 from 
 /Users/josephfleck/.rvm/gems/ree-1.8.7-2010.02/gems/watir-webdriver-0.3.4/lib/watir-webdriver/elements/element.rb:295:in
  `method_missing'
 from (irb):10
 from 
 /Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/site_ruby/1.8/rubygems/deprecate.rb:58
 
 
 The HTML Code:
 div class=mod simple your-subscriptions
 div class=inner
 div class=hd
 div class=bd
 ul class=items
 li class=item subscriptions-description
 li class=item digest-options
 h2Digest Options/h2
 div class=line form
 div class=unit size2of5
 div class=line lastUnit size3of5
 label class=wide-label for=digest_setting_email_formatFormat of 
 digest:/label
 select id=digest_setting_email_format 
 name=digest_setting[email_format] data-method=put 
 data-href=/digest_settings/488 data-command=change
 /div
 /div
 /li
 li class=item community-features
 h2Community Features/h2
 div class=line form
 input id=109 class=unit content-feed-subscribe checkbox mrm 
 type=checkbox value=content-feed-109 name=content_feed_Guided 
 Discussions 
 data-subscription-url=/content_feeds/109/subscribe?channel_id=57 
 data-content-feed-id=109
 label class=unit label-for-checkbox for=109Guided Discussions/label
 /div
 /li
 li class=item member-discussions
 h2Member Discussion Topics/h2
 pSelect the topics you're interested in to receive activity updates in 
 those areas./p
 div class=line form
 div

Re: [wtr-general] Re: Retrieving checkbox values

2011-11-07 Thread Michael
  

In webdriver singular methods return a singe (the first) element of that
type, while plural methods return a list of all elements. 

.checkbox returns
one 

.checkboxes returns a list/collection 

On Mon, 7 Nov 2011 08:36:56 -0800
(PST), Joe Fl wrote: 

 Hi,
 
 I am still having problems with checkboxes. I
need to get the id from
 the html source for group of checkboxes under certain
header sections.
 
 HTML:
 
 * 
 
 COMMUNITY FEATURES
 
 Guided
Discussions 
 
 Each section could 1 to many checkboxes showing.
 
 I have
tried the following:
 chck_bx = $browser.div(:class,mod simple your-

subscriptions).div(:class,bd).ul(:class,items).li(:class,'item

community-features').div(:class,'line form').checkbox
 
 chck_bx.each do|cb|

puts cb.id
 end
 
 and it failed:
 NoMethodError: undefined method `each'
for #
 from /Users/josephfleck/.rvm/gems/ree-1.8.7-2010.02/gems/watir-

webdriver-0.3.4/lib/watir-webdriver/elements/element.rb:295:in

`method_missing'
 from (irb):169
 
 I would appreciate any help with this.


 Thank you,
 Joe
 
 On Oct 12, 4:07 pm, Chuck van der Lindenwrote:
 
 On
Oct 12, 12:09 pm, Joe Fleckwrote: 
 
 Hi Chuck,
 
 Thank you for
help.
 lists = $browser.div(:class,'add-themes').lis lists.each do |li|


 x; width:100% put
 .text 
 
 yle=padding-left:5px;
border-left:#101
 ; margin-left:5px; width:100% puts davalue Thank you very
much this is huge win.
 ill seem to be doing a few rather round-about things
in there. If the structure of the page i
 
 o have inside each of them the
label and
 . You should not need to get the text from the label, then use that
to find the label, the label's parent, 
 
 he trouble of creating v
 so
you can feed them to puts? This makes for far simpler and easier to read code
IMHO The loop then becomes
 
 .text if it's important to verify that the
label exists. nbs
 eckbox.value end Also, unless you need to get the count of
how many list items are pres
 
 
 
 -- Before posting, please read
http://watir.com/support [1]. In short: search before you ask, be nice.
watir-general@googlegroups.com [2] http://groups.google.com/group/watir-general
[3] watir-general+unsubscr...@googlegroups.com [4]

  

Links:
--
[1]
http://watir.com/support
[2] mailto:watir-general@googlegroups.com
[3]
http://groups.google.com/group/watir-general
[4]
mailto:watir-general+unsubscr...@googlegroups.com

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


Re: [wtr-general] I need to retrieve multiple span class=discussion-title

2011-11-06 Thread Michael
You probably intended to use uls which will return a list of ul's instead of ul 
which only returns the first matching ul.

Try:
 My Code:section_headers = $browser.div(:class,bd).uls(:class,items)


Michael

On 2011-Nov-06, at 7:09 PM, Joe Fleck wrote:

 Hi Chuck,
 
 I am still having a bit of trouble with getting a group of h2 from a page.
 
 My Code:section_headers = $browser.div(:class,bd).ul(:class,items)
 section_headers.each do|sec_hdr|
 puts hdr = sec_hdr.h2.text
 end
 
 I get the following error message.
 NoMethodError: undefined method `each' for #Watir::UList:0x10aa117f0
   from 
 /Users/josephfleck/.rvm/gems/ree-1.8.7-2010.02/gems/watir-webdriver-0.3.4/lib/watir-webdriver/elements/element.rb:295:in
  `method_missing'
   from (irb):10
   from 
 /Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/site_ruby/1.8/rubygems/deprecate.rb:58
 
 
 The HTML Code:
 div class=mod simple your-subscriptions
 div class=inner
 div class=hd
 div class=bd
 ul class=items
 li class=item subscriptions-description
 li class=item digest-options
 h2Digest Options/h2
 div class=line form
 div class=unit size2of5
 div class=line lastUnit size3of5
 label class=wide-label for=digest_setting_email_formatFormat of 
 digest:/label
 select id=digest_setting_email_format name=digest_setting[email_format] 
 data-method=put data-href=/digest_settings/488 data-command=change
 /div
 /div
 /li
 li class=item community-features
 h2Community Features/h2
 div class=line form
 input id=109 class=unit content-feed-subscribe checkbox mrm 
 type=checkbox value=content-feed-109 name=content_feed_Guided 
 Discussions 
 data-subscription-url=/content_feeds/109/subscribe?channel_id=57 
 data-content-feed-id=109
 label class=unit label-for-checkbox for=109Guided Discussions/label
 /div
 /li
 li class=item member-discussions
 h2Member Discussion Topics/h2
 pSelect the topics you're interested in to receive activity updates in 
 those areas./p
 div class=line form
 div class=unit size1of2
 div class=line checkbox-row
 input id=107 class=unit content-feed-subscribe checkbox mrm 
 type=checkbox value=content-feed- name=content_feed_Engineering 
 data-subscription-url=/content_feeds/107/subscribe?channel_id=57 
 data-content-feed-id=107
 label class=unit label-for-checkbox for=107Engineering/label
 /div
 div class=line checkbox-row
 input id=108 class=unit content-feed-subscribe checkbox mrm 
 type=checkbox value=content-feed- name=content_feed_UX 
 data-subscription-url=/content_feeds/108/subscribe?channel_id=57 
 data-content-feed-id=108
 label class=unit label-for-checkbox for=108UX/label
 /div
 /div
 div class=unit size1of2 lastUnit
 div class=line checkbox-row
 input id=110 class=unit content-feed-subscribe checkbox mrm 
 type=checkbox value=content-feed- name=content_feed_QA 
 data-subscription-url=/content_feeds/110/subscribe?channel_id=57 
 data-content-feed-id=110
 label class=unit label-for-checkbox for=110QA/label
 /div
 /div
 /div
 /li
 /ul
 
 I just want the h2 header.
 
 On Fri, Oct 21, 2011 at 5:07 PM, Chuck van der Linden sqa...@gmail.com 
 wrote:
 
 
 On Oct 21, 10:41 am, Joe Fl joeflec...@gmail.com wrote:
  Hi,
 
  I need to retrieve multiple discusion titles from a page. I just want
  the titles only and there can be 5 to 13 on a page with other links
  listed under them.  I have tried the following and it will only return
  the first discussion title or all links:
 
  subject_lines =
  $browser.div(:class,'one_col_select').div(:id,'naph').div(:id,'discussion-
  board').span(:class,'discussion-title').links
 
  subject_lines.each do|link|
  puts title_name = link.text
  end
 
 
 Your problem is that you are telling it to get all the links from
 within a single span.  I think what you need to do is get all the
 spans which contain those links, and then pull the link text, OR if
 the only links on the page are those of the class theme are the ones
 you want, then just go for the links directly
 
 If you can go after the links, then
 
  subject_links = $browser.links(:class, 'theme')
 
  subject_links.each do|link|
puts  link.text
  end
 
 If the links are not unique enough on their own, then unless there are
 other spans on the page with the discussion_title class that you don't
 want, you need to do something more along these lines
 
  subjects = $browser.spans(:class,'discussion-title')
 
  subjects.each do|subject|
puts subject.link.text#presumes we want first link inside the
 span
  end
 
 --
 Before posting, please read http://watir.com/support. In short: search before 
 you ask, be nice.
 
 watir-general@googlegroups.com
 http://groups.google.com/group/watir-general
 watir-general+unsubscr...@googlegroups.com
 
 
 -- 
 Before posting, please read http://watir.com/support. In short: search before 
 you ask, be nice.
  
 watir-general@googlegroups.com
 http://groups.google.com/group/watir-general
 watir-general+unsubscr...@googlegroups.com

-- 
Before posting, please read http://watir.com

Re: [wtr-general] I need to retrieve multiple span class=discussion-title

2011-11-06 Thread Michael
A second looks at your code made me think you should be using ul (singular 
because you only have one), and append lis on the end to get all the li's 
contained within the ul.

 My Code:section_headers = $browser.div(:class,bd).ul(:class,items).lis


Sorry about the first response, please disregard it.

Michael

On 2011-Nov-06, at 7:40 PM, Michael wrote:

 You probably intended to use uls which will return a list of ul's instead of 
 ul which only returns the first matching ul.
 
 Try:
 My Code:section_headers = $browser.div(:class,bd).uls(:class,items)
 
 
 Michael
 
 On 2011-Nov-06, at 7:09 PM, Joe Fleck wrote:
 
 Hi Chuck,
 
 I am still having a bit of trouble with getting a group of h2 from a page.
 
 My Code:section_headers = $browser.div(:class,bd).ul(:class,items)
 section_headers.each do|sec_hdr|
 puts hdr = sec_hdr.h2.text
 end
 
 I get the following error message.
 NoMethodError: undefined method `each' for #Watir::UList:0x10aa117f0
  from 
 /Users/josephfleck/.rvm/gems/ree-1.8.7-2010.02/gems/watir-webdriver-0.3.4/lib/watir-webdriver/elements/element.rb:295:in
  `method_missing'
  from (irb):10
  from 
 /Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/site_ruby/1.8/rubygems/deprecate.rb:58
 
 
 The HTML Code:
 div class=mod simple your-subscriptions
 div class=inner
 div class=hd
 div class=bd
 ul class=items
 li class=item subscriptions-description
 li class=item digest-options
 h2Digest Options/h2
 div class=line form
 div class=unit size2of5
 div class=line lastUnit size3of5
 label class=wide-label for=digest_setting_email_formatFormat of 
 digest:/label
 select id=digest_setting_email_format name=digest_setting[email_format] 
 data-method=put data-href=/digest_settings/488 data-command=change
 /div
 /div
 /li
 li class=item community-features
 h2Community Features/h2
 div class=line form
 input id=109 class=unit content-feed-subscribe checkbox mrm 
 type=checkbox value=content-feed-109 name=content_feed_Guided 
 Discussions 
 data-subscription-url=/content_feeds/109/subscribe?channel_id=57 
 data-content-feed-id=109
 label class=unit label-for-checkbox for=109Guided Discussions/label
 /div
 /li
 li class=item member-discussions
 h2Member Discussion Topics/h2
 pSelect the topics you're interested in to receive activity updates in 
 those areas./p
 div class=line form
 div class=unit size1of2
 div class=line checkbox-row
 input id=107 class=unit content-feed-subscribe checkbox mrm 
 type=checkbox value=content-feed- name=content_feed_Engineering 
 data-subscription-url=/content_feeds/107/subscribe?channel_id=57 
 data-content-feed-id=107
 label class=unit label-for-checkbox for=107Engineering/label
 /div
 div class=line checkbox-row
 input id=108 class=unit content-feed-subscribe checkbox mrm 
 type=checkbox value=content-feed- name=content_feed_UX 
 data-subscription-url=/content_feeds/108/subscribe?channel_id=57 
 data-content-feed-id=108
 label class=unit label-for-checkbox for=108UX/label
 /div
 /div
 div class=unit size1of2 lastUnit
 div class=line checkbox-row
 input id=110 class=unit content-feed-subscribe checkbox mrm 
 type=checkbox value=content-feed- name=content_feed_QA 
 data-subscription-url=/content_feeds/110/subscribe?channel_id=57 
 data-content-feed-id=110
 label class=unit label-for-checkbox for=110QA/label
 /div
 /div
 /div
 /li
 /ul
 
 I just want the h2 header.
 
 On Fri, Oct 21, 2011 at 5:07 PM, Chuck van der Linden sqa...@gmail.com 
 wrote:
 
 
 On Oct 21, 10:41 am, Joe Fl joeflec...@gmail.com wrote:
  Hi,
 
  I need to retrieve multiple discusion titles from a page. I just want
  the titles only and there can be 5 to 13 on a page with other links
  listed under them.  I have tried the following and it will only return
  the first discussion title or all links:
 
  subject_lines =
  $browser.div(:class,'one_col_select').div(:id,'naph').div(:id,'discussion-
  board').span(:class,'discussion-title').links
 
  subject_lines.each do|link|
  puts title_name = link.text
  end
 
 
 Your problem is that you are telling it to get all the links from
 within a single span.  I think what you need to do is get all the
 spans which contain those links, and then pull the link text, OR if
 the only links on the page are those of the class theme are the ones
 you want, then just go for the links directly
 
 If you can go after the links, then
 
  subject_links = $browser.links(:class, 'theme')
 
  subject_links.each do|link|
puts  link.text
  end
 
 If the links are not unique enough on their own, then unless there are
 other spans on the page with the discussion_title class that you don't
 want, you need to do something more along these lines
 
  subjects = $browser.spans(:class,'discussion-title')
 
  subjects.each do|subject|
puts subject.link.text#presumes we want first link inside the
 span
  end
 
 --
 Before posting, please read http://watir.com/support. In short: search 
 before you ask, be nice.
 
 watir-general@googlegroups.com
 http

Re: [wtr-general] Re: Handling a MAC Pro book File Upload window.

2011-10-17 Thread Michael
Where are you running this code from? The path you specified is relative to 
your current directory as it is missing the slash at the beginning.

You also don't need all the backslashes. Backslash is an escape character that 
escapes the character immediately following it. In your case you're escaping 
characters like j and D. Either way not needed when you wrap your path in 
double quotes.
--
Sent from my Android.

Joe Fleck joeflec...@gmail.com wrote:

I have tried this and it keeps erroring out.


here is my line of code:

#Attach file  

  @browser.file_field(:id, 
the_file).set(Users/\josephfleck/\Documents/\Download 
Docs/\criptDataFile.xls)


The error I am receiving:



/Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/watir-webdriver-0.3.4/lib/watir-webdriver/elements/file_field.rb:13:in
 `set': No such file or directory - Users/josephfleck/Documents/Download Docs/ 
iptDataFile.xls (Errno::ENOENT)

from ./common/helper_methods.rb:182:in `share_documents'

from 
/Users/josephfleck/Sites/within3/qa_automation/discussion/add_multiple_discussion.rb:159

from 
/Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/fastercsv-1.5.4/lib/faster_csv.rb:696:in
 `each'

from 
/Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/fastercsv-1.5.4/lib/faster_csv.rb:696:in
 `each'

from 
/Users/josephfleck/Sites/within3/qa_automation/discussion/add_multiple_discussion.rb:38



The file does exist so I am not sure what the problem might be.

Do I need to change [:id, the_file] to something else?


Thank you, 

Joe


On Mon, Oct 17, 2011 at 11:25 AM, Željko Filipin 
zeljko.fili...@wa-research.ch wrote:

On Mon, Oct 17, 2011 at 4:53 PM, Joe Fleck joeflec...@gmail.com wrote:
 How do click the Open button?


You do not have to click browse or open buttons, all you have to do is this:


browser.file_field(:id, the_file).set(image.png)



Željko 

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.
 
watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.
 
watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


Re: [wtr-general] Re: My Watir Scripts Failed. Please help

2011-10-13 Thread Michael
  

We run automated watir tests remotely using psexec which allows us to
attach to a specific user's session. If the VM/workstation reboots and this user
is not logged back on the tests will fail due to not being able to open Internet
Explorer. 

Good luck figuring out what is going on. Scheduling it to run while
you're at the office, but have locked the computer or do whatever you do at
night might help you debug it. 

On Thu, 13 Oct 2011 08:23:43 -0700 (PDT),
sridhar wrote: 

 I think it is worth mentioning this. Out of all the scripts
that were
 schedules to run, Some of the scripts that deal with

Watir::Browser.start(url) passed and some failed. When it started
 failing all
the subsequent scripts that deal with
 Watir::Browser.start(url). failed.
 

On Oct 13, 9:16 am, sridharwrote:
 
 Yesterday, I scheduled my watir scripts
to run at 3 AM. Today When i came in the morning i saw that a bunch of scripts
failed on Watir::Browser.start(url). But when i ran those individual scripts
that failed one by one, they passed. Any idea why will it fail like that? failed
to create WIN32OLE object from `InternetExplorer.Application' HRESULT error
code:0x80004005 Unspecified error (WIN32OLERuntimeError)
C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.7.1/lib/watir/ie-class.rb: 165:in
`initialize' C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.7.1/lib/watir/ie-class.rb:
165:in `new' C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.7.1/lib/watir/ie-class.rb:
165:in `create_browser_window'
C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.7.1/lib/watir/ie-class.rb:89:in
`_new_window_init'
C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.7.1/lib/watir/ie-class.rb:79:in
`new_window' C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.7.1/lib/watir/ie-class.rb:
103:in `start_window'
C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.7.1/lib/watir/ie-class.rb:97:in `start'
C:/Ruby/lib/ruby/gems/1.8/gems/commonwatir-1.7.1/lib/watir/browser.rb: 71:in
`start' Thanks, Sridhar
 
 -- Before posting, please read
http://watir.com/support [1]. In short: search before you ask, be nice.
watir-general@googlegroups.com [2] http://groups.google.com/group/watir-general
[3] watir-general+unsubscr...@googlegroups.com [4]

  

Links:
--
[1]
http://watir.com/support
[2] mailto:watir-general@googlegroups.com
[3]
http://groups.google.com/group/watir-general
[4]
mailto:watir-general+unsubscr...@googlegroups.com

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


Re: [wtr-general] Watir script compartmentalization

2011-09-28 Thread Michael
I use MiniTest to drive my tests, so in my case they'd all go in one file as 3 
separate tests in there. That way each can fail individually andbe reported in 
a nice summary.
--
Sent from my Android.

George george.sand...@gmail.com wrote:

Hello, I was curious to know how granular folks are making their Watir
scripts. As an example, I have an authentication script that contains
three parts:

1. Checking the elements of the login page
2. Performing valid logins and validating the output
3. Performing invalid logins and validating the output

Currently, all three parts are in one script. I'm wondering if I
should separate each of these into its own script. It would seem to
make sense, but I'd like to see what your opinion is.

Thanks!

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: finding all links on a page

2011-09-14 Thread Michael
# Do the basic watir initialization, then you should be able to get
away with something like this.

links = browser.links.to_a
links.select! {|link| link.href =~ /yp.kd.com/} # Omit all links to
different domains

puts Writing #{links.length} links to links.txt

# Write each link to the file
File.open( 'links.txt', 'w' ) do |file|
  links.each do |link|
file.puts #{link.text}; #{link.href.gsub(/^http:\/\//, )}
  end
end

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


Re: [wtr-general] Getting Error: `WebDriverError': Element is not currently visible and so may not be interacted with (Selenium::WebDriver::Error::ElementNotDisplayedError)

2011-08-31 Thread Michael
Your HTML and code snippets would help us see what is going on.

In general you cannot interact with elements that are hidden (not visible). 
This may be occurring for a few reasons:
- element is hidden (or positioned off the screen) by CSS styles or JavaScript
- your selector found a different element matching your selector, and this 
element is hidden

On 2011-08-31, at 12:06 AM, Amit Bobade wrote:

 Hi, 
 
 
 I am getting following error while running my script on FF.
 
 `WebDriverError': Element is not currently visible and so may not be 
 interacted with (Selenium::WebDriver::Error::ElementNotDisplayedError)
 
 I am using Ruby187 and Watir-webdriver.
 
 Could someone tell me why this error is occuring? 
 
 -- 
 Thanks and Regards,
 Amit
 
 
 -- 
 Before posting, please read http://watir.com/support. In short: search before 
 you ask, be nice.
  
 watir-general@googlegroups.com
 http://groups.google.com/group/watir-general
 watir-general+unsubscr...@googlegroups.com

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


Re: [wtr-general] TableRow#text returns text of the wrong row

2011-08-31 Thread Michael
That bug is captured in: http://jira.openqa.org/browse/WTR-486

And fixed in commit: 
https://github.com/bret/watir/commit/3846b6f300f5210df6b196eeeb15684b6e25378b
You should see it in the next patch release.

There is another discussion post about it titled watir 2.0.1 table rows method 
broken that has a workaround.


On 2011-08-31, at 3:02 PM, brettsykes wrote:

 Ruby Version: 1.8.7
 WATIR Version: 2.0.1
 OS: Win 7
 
 So I came across this issue as I just upgraded to 2.0.1. Basically,
 when i get a TableRow object using the [] method, and then try to get
 the text value from it, it always returns the text of the row with
 index of zero.
 
 Steps to reproduce:
 1) HTML
 
 html
table id=a_table
trtdboring text/tr/td
trtdgreat text/td/tr
trtdthe best text evertd/tr
/table
 /html
 
 2) Code
 
 #
 require 'rubygems'
 gem 'watir', '=2.0.1'
 require 'watir'
 
 b = Watir::IE.new
 b.goto 'http://localhost/test.html'
 
 #get the third table row with text 'the best text ever'
 table = b.table(:id, 'a_table')
 row = table.rows[2]
 
 
 #the TableRow object has the correct ole_object stored within it
 #before we call row.text
 puts row.ole_object.invoke('innerHTML')
 
 #trying to get the text unfortunately outputs the text from row 0:
 'boring text'
 puts row.text
 
 #now the TableRow object has the wrong ole_object in it
 puts row.ole_object.invoke('innerHTML')
 
 #it looks like this happens because our TableRow object is using an
 index of zero and not two
 puts row.inspect
 #
 
 3) Summary
 
 So, I read through some of the code, and it looks like this is
 happening because when we call
 table.row[2], our each method in elements_collection.rb doesn't pass
 on any index information to
 tagged_element_locator in container.rb. So, when we call set_specifier
 inside tagged_element_locator, we set a
 default value to an index of zero. Later on when we call row.text,
 it's locate method thinks we are looking
 for the row with an index of zero and not two. It then sets our
 ole_object in the TableRow object to the zero index value.
 
 Brett
 
 -- 
 Before posting, please read http://watir.com/support. In short: search before 
 you ask, be nice.
 
 watir-general@googlegroups.com
 http://groups.google.com/group/watir-general
 watir-general+unsubscr...@googlegroups.com

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


Re: [wtr-general] Getting Error: `WebDriverError': Element is not currently visible and so may not be interacted with (Selenium::WebDriver::Error::ElementNotDisplayedError)

2011-08-31 Thread Michael
Please post your ruby code as well so we can see how you are trying to locate 
this element. You can always use wait_until { … locate link … }, but if this is 
truly static HTML I would be surprised if that was necessary.

On 2011-08-31, at 12:32 AM, Amit Bobade wrote:

 Thanks for your prompt reply, Micheal. 
 
 Element is not hidden. It is very simple HTML code. I tried using sleep( ) 
 method for this and fortunately it worked 
 
 I don't know the exact problem and this may not be a proper solution. Could 
 you please suggest something more productive? 
 
 HTML CODE:
 div class=attch-img
 
 a href=javascript:void(0); class=attach_link dashboard_sprites OFF 
 id=showlink title=Link/a
 
  /div
  div class=attch-img
  a href=javascript:void(0); style=opacity: 0.5; class=OFF 
 attach_video dashboard_sprites title=Configure Youtube to upload video/a
 
  /div
 
 
 Thanks, 
 -Amit
 
 On Wed, Aug 31, 2011 at 11:51 AM, Michael mmcwill...@gmail.com wrote:
 Your HTML and code snippets would help us see what is going on.
 
 In general you cannot interact with elements that are hidden (not visible). 
 This may be occurring for a few reasons:
 - element is hidden (or positioned off the screen) by CSS styles or JavaScript
 - your selector found a different element matching your selector, and this 
 element is hidden
 
 On 2011-08-31, at 12:06 AM, Amit Bobade wrote:
 
 Hi, 
 
 
 I am getting following error while running my script on FF.
 
 `WebDriverError': Element is not currently visible and so may not be 
 interacted with (Selenium::WebDriver::Error::ElementNotDisplayedError)
 
 I am using Ruby187 and Watir-webdriver.
 
 Could someone tell me why this error is occuring? 
 
 -- 
 Thanks and Regards,
 Amit
 
 
 -- 
 Before posting, please read http://watir.com/support. In short: search 
 before you ask, be nice.
  
 watir-general@googlegroups.com
 http://groups.google.com/group/watir-general
 watir-general+unsubscr...@googlegroups.com
 
 
 -- 
 Before posting, please read http://watir.com/support. In short: search before 
 you ask, be nice.
  
 watir-general@googlegroups.com
 http://groups.google.com/group/watir-general
 watir-general+unsubscr...@googlegroups.com
 
 
 
 -- 
 Thanks and Regards,
 Amit
 
 
 -- 
 Before posting, please read http://watir.com/support. In short: search before 
 you ask, be nice.
  
 watir-general@googlegroups.com
 http://groups.google.com/group/watir-general
 watir-general+unsubscr...@googlegroups.com

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


Re: [wtr-general] run watir with ruby 1.9.2

2011-08-30 Thread Michael
I don't know about the latest ruby, but it definitely runs with 1.9.2p180. To 
keep things simple, uninstall 1.8.7 (especially if you're on windows), and 
install the desired version of ruby. From there you can install watir the same 
way you did for previous versions.

gem update --system
gem install watir


On 2011-08-30, at 10:36 AM, ottoman wrote:

 Hi,
 I have installed watir and ruby 1.8.7 as suggested watir.com. I see
 some solutions implemented with latest ruby 1.9.2 and watir. is it
 possible to run watir with latest ruby? how?
 
 -- 
 Before posting, please read http://watir.com/support. In short: search before 
 you ask, be nice.
 
 watir-general@googlegroups.com
 http://groups.google.com/group/watir-general
 watir-general+unsubscr...@googlegroups.com

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


Re: [wtr-general] IE 9 execute_script broken

2011-08-26 Thread Michael
What version of Watir should I expect to see that fix in? 2.0.2 when it comes 
out?

On 2011-08-24, at 9:32 PM, parolkar wrote:

 Hi Michael,
  This was a bug which was fixed in this commit :
 https://github.com/bret/watir/commit/f9b351c99352160d6becec4bd1ec1d54f570bc18
  Are you still facing this issue, bring it to my attention in detail
 and I will look at it :-)
 
 -parolkar
 
 On Aug 12, 11:10 pm, Michael mmcwill...@gmail.com wrote:
 Hello,
 
 I am recently trying to run our tests on IE 9, and am running into the
 following error. It occurs both with Watir 1.9.2 and 2.0.1, does
 anyone have a solution? We are using Ruby 1.9.2.
 
 We have extended the Waitr Element as follows (and with similar code
 for deny):
 module Watir
 class Element
 
 def confirm
 page_container.execute_script(window.alert = 
 function() {return
 true;})
 page_container.execute_script(window.confirm = 
 function() {return
 true;})
 self
 end # end confirm method
 
 end # end Element class
 end # end Watir module
 
 Then when trying to suppress the JavaScript popups on certain buttons
 we'd do something like:
 browser.button( :name, 'aButton' ).confirm.click
 
 This works great in IE 7 and 8 on Windows XP. On Windows 7 using IE 9
 we get the following error:
   NoMethodError: unknown property or method: `eval'
   HRESULT error code:0x80020006
   Unknown name.
   HTML saved in logs\html/CleanupInstance/
 testDeleteUserClasses.0.html
 C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-2.0.1/lib/watir/
 ie-class.rb:415:in `method_missing'
 C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-2.0.1/lib/watir/
 ie-class.rb:415:in `execute_script'
 P:/release-71/test/watir/core/watir/Element.rb:12:in
 `confirm'
 P:/release-71/test/watir/configuration/pam/
 ReplicatedCheckinCheckoutCleanup.rb:45:in `testDeleteUserClasses'
 
 Any suggestions or ideas would be greatly appreciated.
 
 Michael
 
 -- 
 Before posting, please read http://watir.com/support. In short: search before 
 you ask, be nice.
 
 watir-general@googlegroups.com
 http://groups.google.com/group/watir-general
 watir-general+unsubscr...@googlegroups.com

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


Re: [wtr-general] watir 2.0.1 table rows method broken

2011-08-26 Thread Michael
Thanks for the update and workaround Alister. I'll add the 'if Watir do it that 
way, else do it the compatible way' to my code.

I'll look forward to a fix in a future version of Watir. :-)


On 2011-08-24, at 7:48 PM, Alister Scott wrote:

 Yeah, it looks bust.
 You can use:
 
 browser.table(:id, 'administrators').each do |row| 
   puts 
   puts row.inspect 
   puts row.text 
 end 
 
 which works, but isn't watir-webdriver compatible.
 
 Cheers,
 Alister
 
 
 -- 
 Before posting, please read http://watir.com/support. In short: search before 
 you ask, be nice.
  
 watir-general@googlegroups.com
 http://groups.google.com/group/watir-general
 watir-general+unsubscr...@googlegroups.com

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] watir 2.0.1 table rows method broken

2011-08-24 Thread Michael
I've created this bug report for an issue I am seeing, curious if
anyone else has run into the same issue or is it just my environment?
I completely removed ruby today to start completely fresh, and it
still occurs.

http://jira.openqa.org/browse/WTR-486

Summary:
The rows/trs method on a table returns a reference to the first row
for each row in the table.

Example watir code:
require 'watir'
browser = Watir::Browser.new
browser.goto http://jira.openqa.org/secure/Administrators.jspa;
browser.table(:id, 'administrators').rows.each do |row|
  puts
  puts row.inspect
  puts row.text
end

Output:
#Watir::TableRow:0x7f3d4a12 located=true how={:index=0} what=nil
System Administrators

#Watir::TableRow:0x..fc39cc0a located=true how={:index=0} what=nil
System Administrators

Explanation of what I am seeing:
The correct number rows are returned, but each row is a reference to
the first row. The HTML and text are always that of the first row. The
index in the inspection is always 0.

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] IE 9 execute_script broken

2011-08-12 Thread Michael
Hello,

I am recently trying to run our tests on IE 9, and am running into the
following error. It occurs both with Watir 1.9.2 and 2.0.1, does
anyone have a solution? We are using Ruby 1.9.2.

We have extended the Waitr Element as follows (and with similar code
for deny):
module Watir
class Element

def confirm
page_container.execute_script(window.alert = 
function() {return
true;})
page_container.execute_script(window.confirm = 
function() {return
true;})
self
end # end confirm method

end # end Element class
end # end Watir module

Then when trying to suppress the JavaScript popups on certain buttons
we'd do something like:
browser.button( :name, 'aButton' ).confirm.click

This works great in IE 7 and 8 on Windows XP. On Windows 7 using IE 9
we get the following error:
  NoMethodError: unknown property or method: `eval'
  HRESULT error code:0x80020006
  Unknown name.
  HTML saved in logs\html/CleanupInstance/
testDeleteUserClasses.0.html
C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-2.0.1/lib/watir/
ie-class.rb:415:in `method_missing'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-2.0.1/lib/watir/
ie-class.rb:415:in `execute_script'
P:/release-71/test/watir/core/watir/Element.rb:12:in
`confirm'
P:/release-71/test/watir/configuration/pam/
ReplicatedCheckinCheckoutCleanup.rb:45:in `testDeleteUserClasses'

Any suggestions or ideas would be greatly appreciated.

Michael

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


Re: [wtr-general] Need to click a Link In Table

2011-08-10 Thread Michael
I could be wrong, but I seem to remember a 
browser.element_by_xpath(//a[contains(@onclick,'1002')]).click

I've personally never used the generic element method.


On 2011-08-09, at 1:40 AM, Mahi wrote:

 I Have following Gem list
 
 builder (3.0.0)
 childprocess (0.1.9)
 commonwatir (1.9.2, 1.9.2.rc1)
 ffi (1.0.9 x86-mingw32)
 firewatir (1.9.2, 1.9.2.rc1, 1.1.1)
 hoe (2.10.0)
 json_pure (1.5.3)
 nokogiri (1.5.0 x86-mingw32)
 rake (0.9.2)
 rautomation (0.6.2, 0.6.1)
 rubygems-update (1.8.5)
 rubyzip (0.9.4)
 s4t-utils (1.0.4)
 selenium-webdriver (0.2.2)
 user-choices (1.1.6.1)
 watir (1.9.2, 1.9.2.rc1)
 watir-webdriver (0.2.6, 0.2.5)
 win32-api (1.4.8 x86-mingw32)
 win32-process (0.6.5)
 windows-api (0.4.0)
 windows-pr (1.2.0)
 xml-simple (1.1.0)
 
 Code:
 require rubygems
 require test/unit
 require win32ole
 require firewatir
 
 require 'watir/screen_capture'
 # To get attribute value
 require 'watir/element.rb'
 
 $br.element(:xpath = //a[contains(@onclick,'1002')]).click
 
 And I am getting the following Error : in `element': wrong number of
 arguments (1 for 2) (ArgumentError)
 
 Plz let me know how to overcome this. Do i need update the version?
 
 
 On Jul 14, 3:10 pm, Mahi mahindra...@gmail.com wrote:
 Watir 1.9.2.rc1 , IE 8.0
 
 On Jul 14, 2:58 pm, Željko Filipin zeljko.fili...@wa-research.ch
 wrote:
 
 And this works?
 
 browser.element(:xpath = //a[contains(@onclick, '1002')]).click
 
 Please provide your watir and browser versions.
 
 Željko
 
 -- 
 Before posting, please read http://watir.com/support. In short: search before 
 you ask, be nice.
 
 watir-general@googlegroups.com
 http://groups.google.com/group/watir-general
 watir-general+unsubscr...@googlegroups.com

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: Iterate over direct successor divs which are not unique identifiable

2011-08-08 Thread Michael
You should be able to do pretty much exactly that.
browser.div(:class, myclass).divs.select { | div | div.divs.length 
0 }

On Aug 8, 4:31 am, Alister Scott alister.sc...@gmail.com wrote:
 I'd do something like

 browser.div(:class, myclass).divs.select { | div | div.div.exists? }

 (that should be select not collect)

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: Waitr fails to fire_event for select_list

2011-07-08 Thread Michael
Seems to be a valid bug - created bug report 
http://jira.openqa.org/browse/WTR-485

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: Waitr fails to fire_event for select_list

2011-07-06 Thread Michael
Hi Abe, thanks for the suggestion.

In this case the element is there, it did locate it, it just can't
find the fireEvent method for it...

JavaScript can find it and fire events no problem, so I'm not sure why
Watir is having issues here. I'll create a bug report.

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: string to boolean?

2011-07-06 Thread Michael
Jarmo - your example just proved that doesn't work because both the
string true and the string false return true when double negated.

I think you'll have to handle it in some way, for example:
value = ( value == true.to_s )

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


Re: [wtr-general] Error when Clicking a link using watir

2011-07-04 Thread Michael Raj
Hi ,

Still I am not able to solve this issue,

the equivalent HTML is below.

a href=inloggen.do;jsessionid=BHc5XLt5uaExj7R-tzwbX51:-1
target=inhoudimg src=images/inloggen.gif width=122 height=26
border=0 //a

Kindly help me on this.

Thanks and Regards
Peter.

Željko Filipin wrote:
 On Wed, Jun 1, 2011 at 1:24 PM, Michael Raj peetz...@gmail.com wrote:
   ie.link(:xpath,//a[contains(@href='inloggen.do')]/).click

 Please provide link HTML.

 In the meantime, try this:

 browser.link(:href = /inloggen\.do/).click

 Željko
 --
 watir.com - community manager
 watir.com/book - author
 watirpodcast.com - host
 viaqa.mobi conference on software testing - organizer

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Watir 1.9.1 upgrade (from 1.9.1rc or 1.9.0) breaks two things

2011-07-04 Thread Michael
Was running Watir 1.9.1 pre1 and everything was running smoothly.

This morning I updated to Wait 1.9.1 to debug an issue a colleague was
having. These two issues arose as a result of updating (all tests
passed immediately before update, and fail immediately after).

1. bring_to_front no longer works (due to a missing activate method)

This is the line of code in our tests that fails (meant to bring IE to
the front, but not break on Firewatir):
browser.bring_to_front if browser.respond_to? :bring_to_front

With this error:
C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-1.9.1/lib/watir/ie-class.rb:
449:in `activate': undefined method `activate' for
#RAutomation::Window:0x2875080 (NoMethodError)
from C:/michael/projects/fox/release-71/test/watir/core/
Session.rb:89:in `initialize'


2. NameError: uninitialized constant Watir::Container::Divs

This is the code that fails. In the case when it fails noticeBox does
exist.
  noticeDivs = []
  noticeBox = browser.div( :class, /noticeBox/ )
  noticeBox.divs.each { |div| noticeDivs.push div } if
noticeBox.exists?

The HTML from noticeBox (noticeBox.html):

DIV class=noticeBoxTABLE border=0 cellSpacing=0 cellPadding=0
TBODY
TR
TD class=icon vAlign=topIMG title=Info alt=Info src=docs/pics/
icon_info.png width=19 height=19 /TD
TD class=body
DIV class=entry
DIV class=resultYour last successful login was at 04/07/2011 9:52 AM
(GMT-07:00).BRYou've had 0 failed attempts since your last
successful login./DIV/DIV/TD/TR/TBODY/TABLE/DIV

Error:

ERROR initialSetup (4.61s)
  NameError: uninitialized constant Watir::Container::Divs
C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-1.9.1/lib/watir/
container.rb:644:in `divs'

Does anyone know what change to Waitr 1.9.1 might have caused this,
and if it was intentional, and what a work-a-round is?

Thanks,
Michael

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: Watir 1.9.1 released - IE9 bug fixes

2011-07-04 Thread Michael
We have a few errors we're encountering as a result of this upgrade:
http://groups.google.com/group/watir-general/browse_thread/thread/c03b7bee932b265a

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: Watir 1.9.1 upgrade (from 1.9.1rc or 1.9.0) breaks two things

2011-07-04 Thread Michael
Thanks Hugh - I had previously created this watir bug report:
http://jira.openqa.org/browse/WTR-483

I'll downgrade for now and listen on rautomation development - thanks
again.

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: Need help with Rspec and Watir Webdriver

2011-06-30 Thread Michael
Fix the indenting of your code and it should become clear:


require 'rubygems'
require 'watir-webdriver'
describe 'MySite' do
  before(:all) { @browser = Watir::Browser.new :firefox }
  it 'contains Google' do
@browser.goto 'http://google.com/'
@browser.text.should include 'google'
  end


# Code randomly in here - not in a validation or check that would
have
# before(:all) run before it.
@browser.text_field(:xpath,/html/body/div[@id='searchform']/
form[@id='tsf']/div/div[2]/table/tbody/tr[1]/td[1]/table/tbody/tr/
td[1]/div/table[@id='sftab']/tbody/tr/td[@id='lst-xbtn']/div/div[2]/
input).set (ruby)
@browser.button(:xpath,/html/body/div[@id='searchform']/
form[@id='tsf']/div/div[3]/center/input[1]).click



it 'contains Ruby'  do
@browser.text.should_not include 'Rails'
  end
  after(:all) { @browser.quit }
end

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: Need help with Rspec and Watir Webdriver

2011-06-30 Thread Michael
Sorry for the extra email - but easier to see properly indented (with
the tabs converted to spaces):

require 'rubygems'
require 'watir-webdriver'
describe 'MySite' do
  before(:all) { @browser = Watir::Browser.new :firefox }
  it 'contains Google' do
@browser.goto 'http://google.com/'
@browser.text.should include 'google'
  end


  # Code randomly in here - not in a validation or check that would
have
  # before(:all) run before it.
  @browser.text_field(:xpath,/html/body/div[@id='searchform']/
form[@id='tsf']/div/div[2]/table/tbody/tr[1]/td[1]/table/tbody/tr/
td[1]/div/table[@id='sftab']/tbody/tr/td[@id='lst-xbtn']/div/div[2]/
input).set (ruby)
  @browser.button(:xpath,/html/body/div[@id='searchform']/
form[@id='tsf']/div/div[3]/center/input[1]).click



  it 'contains Ruby'  do
@browser.text.should_not include 'Rails'
  end
  after(:all) { @browser.quit }
end

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Waitr fails to fire_event for select_list

2011-06-29 Thread Michael
Watir is able to fire an event for a select list if there are events
of the required type registered to the element. If, however, there are
no objects registered via JavaScript to the select element, then it
fails.

From a testing stand point for a JavaScript rich application, it would
be nice to be able to fire the event and have it succeed even if there
are no registered events. The test code can then be far more versatile
and general.

Versions:
IE 8.0.6001.18702
Ruby 1.9.2p180
Watir 1.9.1.rc1

HTML Code Sample:
!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
html xmlns=http://www.w3.org/1999/xhtml;
  head
titlefire event sample/title
 /head
  body
select name=select
  option value=1value1/option
  option value=2value2/option
/select
  /body
/html

Ruby Code Sample:
require 'watir'
browser = Watir::Browser.new
browser.goto http://path.to/testPage.html
browser.select_list(:name, 'select').fire_event('change')

Expected Result:
Code should execute without any errors, firing events if there were
any, and otherwise doing nothing (just like the equivalent behaviour
in JavaScript).

Actual Result:
C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-1.9.1.rc1/lib/watir/
element.rb:339:in `method_missing': (in OLE method `fireEvent': )
(WIN32OLERuntimeError)
OLE error code:80070057 in htmlfile
  Invalid argument.
HRESULT error code:0x80020009
  Exception occurred.
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-1.9.1.rc1/lib/
watir/element.rb:339:in `dispatch_event'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-1.9.1.rc1/lib/
watir/element.rb:325:in `fire_event'
from IE8FireEventBug.rb:21:in `main'

Let me know what you think. :-)

Thanks!
Michael

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] IE9 unknown property or method: 'gsub'

2011-06-24 Thread Michael
We are starting to run our tests on IE9 on Windows 7 x64 (but 32bit
version of IE), and am receiving thousands of the same error. It
appears to be occurring for every element search and action (like
click).

Has anyone else run into this? There's no stack trace or anything, so
I'm guessing its an issue with communicating with IE.

unknown property or method: `gsub'
HRESULT error code:0x80020006
  Unknown name.

Michael

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: IE9 unknown property or method: 'gsub'

2011-06-24 Thread Michael
Hi Charley, I hadn't debugged it at the time of my first message and
was curious if anyone else had come across it before I spent time
trying to find a minimum set of code that reproduced the issue.

I have done some  tracing now and have a code example that reproduces
the issue. It seems to be an issue with the xpath selectors.

Environment:
Windows 7 64-bit with Service Pack 1
Internet Explorer 32-bit 9.0.8112.16421
Ruby 1.9.2p180
Gem 1.5.2
Watir 1.9.0

Sample code:
require 'watir'
browser = Watir::Browser.new
browser.goto 'http://google.ca'
field = browser.text_field(:xpath, input[@name='q'])
field.exists?

When I run the above code I get the follow three lines printed 70
times in a row:
unknown property or method: `gsub'
HRESULT error code:0x80020006
  Unknown name.

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Is Firewatir Dead?

2011-06-22 Thread Michael
From a bit of web research it doesn't look like there is going to be a
version of jssh for Firefox 4...

Does that mean Firewatir is dead?

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Error when Clicking a link using watir

2011-06-01 Thread Michael Raj
Hi,

  I am able to open an application through watir. I am checking the
link as
if ie.link(:xpath,//a[contains(@href='inloggen.do')]/)
if so i am calling
 ie.link(:xpath,//a[contains(@href='inloggen.do')]/).click

but i am getting error as

C:/Ruby187/lib/ruby/gems/1.8/gems/watir-1.8.1/lib/watir/ie-class.rb:
465:in `method_missing': unknown property or method
`document' (WIN32OLERuntimeError)
HRESULT error code:0x80010108
  The object invoked has disconnected from its clients.
from C:/Ruby187/lib/ruby/gems/1.8/gems/watir-1.8.1/lib/watir/ie-
class.rb:465:in `document'
from C:/Ruby187/lib/ruby/gems/1.8/gems/watir-1.8.1/lib/watir/ie-
class.rb:719:in `create_xml_parser_doc'
from C:/Ruby187/lib/ruby/gems/1.8/gems/watir-1.8.1/lib/watir/ie-
class.rb:708:in `xmlparser_document_object'
from C:/Ruby187/lib/ruby/gems/1.8/gems/watir-1.8.1/lib/watir/ie-
class.rb:922:in `elements_by_xpath'
from C:/Ruby187/lib/ruby/gems/1.8/gems/watir-1.8.1/lib/watir/ie-
class.rb:915:in `element_by_xpath'
from C:/Ruby187/lib/ruby/gems/1.8/gems/watir-1.8.1/lib/watir/link.rb:
21:in `locate'
from C:/Ruby187/lib/ruby/gems/1.8/gems/watir-1.8.1/lib/watir/
element.rb:55:in `assert_exists'
from C:/Ruby187/lib/ruby/gems/1.8/gems/watir-1.8.1/lib/watir/
element.rb:275:in `click!'
from C:/Ruby187/lib/ruby/gems/1.8/gems/watir-1.8.1/lib/watir/
element.rb:230:in `click'
from APS.rb:16

Kindly help me on this.

Thanks
Peter

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


Re: [wtr-general] Can't find an element in a page with javascript:gotolink

2011-03-01 Thread Michael Sillers

Thanks everyone for your assistance.

I managed to get it working with Zeljko's suggestions. It turns out  
the page eppears to be closing the main frame and opening another as a  
different name so I had to direct Watir to the new frame.


xpath does look very interesting and I'll keep it in mind for future  
projects as well as test it against this one when the heat is off. It  
will probably make future projects a lot simpler.


Mike.

Quoting Dave McNulla mcnu...@gmail.com:


mss,

from your attachment, I was able to find the link with xpath:
browser.link(:xpath, //a[contains(@href ,
'showDownloadLanding.do')]).click

Here's a tutorial on it:
http://angrez.blogspot.com/2006/06/xpath-and-watir.html

Good Luck,

Dave

--
Before posting, please read http://watir.com/support. In short:  
search before you ask, be nice.


watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com





--
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


Re: [wtr-general] Click on link with href Javascript:calllogout()

2011-01-19 Thread Michael Hwee
Did you try
$ie.link(:text,'Logout').click

Michael





From: Aravind aravindredd...@gmail.com
To: watir-general@googlegroups.com
Sent: Wed, January 19, 2011 4:46:52 AM
Subject: Re: [wtr-general] Click on link with href Javascript:calllogout()


thanks for the reply
 
liahref=javascript:callLogOut(); onclick='javascript:return 
navigateTo(/abcd/LogOut.jsp);'Logout/a/li
 
Can you please give me the code to click on logout link
 
thanks
aravind


 
On Wed, Jan 19, 2011 at 7:41 AM, Željko Filipin zeljko.fili...@wa-research.ch 
wrote:

On Wed, Jan 19, 2011 at 1:24 PM, Aravind aravindredd...@gmail.com wrote:

 I am trying to click on a link with href = javascript:callLogOut(); and 
 text 
= Logout
 but failed to click.

Show us your code.

Željko
--
watir.com - community manager
watirpodcast.com - host
testingpodcast.com - audio podcasts on software testing. all of them 


-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.
 
watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.
 
watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


Re: [wtr-general] Click on link with href Javascript:calllogout()

2011-01-19 Thread Michael Hwee
Also did you try

$ie.link(:text,'Logout').fire_event(onclick)





From: Aravind aravindredd...@gmail.com
To: watir-general@googlegroups.com
Sent: Wed, January 19, 2011 6:45:40 AM
Subject: Re: [wtr-general] Click on link with href Javascript:calllogout()


Hi
 
I have tried using both href and text as perameters.

 
On Wed, Jan 19, 2011 at 6:26 PM, Željko Filipin zeljko.fili...@wa-research.ch 
wrote:

2011/1/19 Aravind aravindredd...@gmail.com 

 lia href=javascript:callLogOut(); onclick='javascript:return 
navigateTo(/abcd/LogOut.jsp);'Logout/a/li

What have you tried so far?

Željko 

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.
 
watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.
 
watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


Re: [wtr-general] Handling of Jquery objects by Watir

2010-12-01 Thread Michael


We too have a lot of JavaScript, and the trick to get it all to work
was to use watir-webdriver which fires the events properly for MooTools
and Jquery to work. Watir was very unsuccessful on this front, and
Firewatir was so-so. 

On Wed, 1 Dec 2010 05:23:54 -0800 (PST),
the_zonker wrote: 

 Hi guys,
 
 my customers ask me to investigate
the possibilities of using Watir
 for test automation.
 It's assumed
that future service site will have a lot of Jquery
 elements.
 So I
try to use Watir for their handling on some Jquery element
 examples
and faced with the problem for the foolowing Menu bar (please
 observe
section Example):

http://onehackoranother.com/projects/jquery/droppy/# [1]
 
 I 'm
trying to navigate through Menu in the following way:
 1. Click on Top
level 2
 2. On mouse over Sub 2 - 2
 3. On mouse over Sub 2 - 2 -
3
 
 I'm stopped on step 2. I tried to open sub menu Sub 2 - 2 in
several
 ways:
 
 irb(main):029:0 ie.link(:text,/Sub 2 -
2/).fireEvent(onmousedown)
 = nil
 irb(main):030:0
ie.link(:text,/Sub 2 - 2/).fireEvent(onmousedown)
 = nil

irb(main):031:0 ie.link(:text,/Sub 2 - 2/).fireEvent(onclick)
 =
nil
 irb(main):032:0 ie.link(:text,/Sub 2 - 2/).click
 = 0.025997


 But non of them does it.
 
 Please, help me.
 

Regards!


Links:
--
[1]
http://onehackoranother.com/projects/jquery/droppy/#

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


Re: [wtr-general] variablize ff.link(identifier,keyword).exists?

2010-11-30 Thread Michael
You can assign symbol to a variable though:
sname = :name

The same is true with regular expressions:
skeyword = /google/

ff.link(sname, skeyword).exists?

I'm not sure if you've modified your code for the example, because links don't 
typically have name attributes - href would be more common.



On 2010-11-30, at 1:17 PM, Charley Baker wrote:

 Symbols and strings aren't interchangeable, but you can convert.
 
 name.to_sym
 = :name
 :name.to_s
 = name
 
 The first part of the method argument takes a symbol, not a string:
 sname = name
 ff.link(sname.to_sym,skeyword).exists?
 
 Not tested, but should work. As an aside, hungarian notation in Ruby
 looks weird and kind of makes no sense. :)
 
 Charley Baker
 Lead Developer, Watir, http://watir.com
 
 
 
 On Tue, Nov 30, 2010 at 12:41 PM, dave davidrey...@gmail.com wrote:
 Currently,
 
 ff.link(:name,/google/).exists? works and returns true.
 
 However, if I variablize things
 
 sname = :name
 skeyword = /google.
 
 ff.link(sname,skeyword).exists? returns false.
 
 Is there any text that states how to go about this?
 
 Thanks
 
 --
 Before posting, please read http://watir.com/support. In short: search 
 before you ask, be nice.
 
 watir-general@googlegroups.com
 http://groups.google.com/group/watir-general
 watir-general+unsubscr...@googlegroups.com
 
 
 -- 
 Before posting, please read http://watir.com/support. In short: search before 
 you ask, be nice.
 
 watir-general@googlegroups.com
 http://groups.google.com/group/watir-general
 watir-general+unsubscr...@googlegroups.com
 

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


Re: [wtr-general] Re: watir-webdriver fire_event('onmouseover') failing in IE

2010-11-25 Thread Michael


Looks like the backport to trunk is now complete
http://code.google.com/p/selenium/source/detail?r=10401 [10] 

Quoted
from http://code.google.com/p/selenium/issues/detail?id=849 [11] 

On
Mon, 22 Nov 2010 19:53:04 +0100, Jari Bakken wrote: 

 On Mon, Nov 22,
2010 at 7:05 PM, Michael wrote:
 This bug is making webdriver pretty
useless on IE for any type of JavaScript testing. It has now been fixed
in the selenium repository.
 The IE driver has been rewritten on a
branch, so the fix isn't yet in Selenium trunk. I'll release a new
selenium-webdriver gem as soon as it's merged (or the fix is backported
to the old driver). 
 
 Are there any known work-a-rounds until a new
version of selenium- webdriver is released?
 Not that I know of. Th


 der-left:#1010ff 2px solid; margin-left:5px; width:100%On Sat, Nov
6, 2010 at 1:41 AM, Michael wrote: 
 

Selenium::WebDriver::Error::UnexpectedJavascriptError: Cannot execute
script (17)
 You're probably running into this known bug in the IE
driver: http://code.google.com/p/selenium/issues/detail?id=849 [1]
(comment 5 has a failing test) -- Before posting, please read
http://watir.com/support. [2] In short: search before you ask, be nice.
watir-general@googlegroups.com [3]
http://groups.google.com/group/watir-general [4]
watir-general+unsubscr...@googlegroups.com [5] -- Before posting, please
read http://wa
 rt. In short: search before you ask, be nice.
watir-general@googlegroups.com [7]
http://groups.google.com/group/watir-general [8]
watir-general+unsubscr...@googlegroups.com [9]


Links:
--
[1]
http://code.google.com/p/selenium/issues/detail?id=849
[2]
http://watir.com/support.
[3] mailto:watir-general@googlegroups.com
[4]
http://groups.google.com/group/watir-general
[5]
mailto:watir-general+unsubscr...@googlegroups.com
[6]
mailto:mmcwill...@gmail.com
[7]
mailto:watir-general@googlegroups.com
[8]
http://groups.google.com/group/watir-general
[9]
mailto:watir-general+unsubscr...@googlegroups.com
[10]
http://code.google.com/p/selenium/source/detail?r=10401
[11]
http://code.google.com/p/selenium/issues/detail?id=849

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: watir-webdriver fire_event('onmouseover') failing in IE

2010-11-22 Thread Michael
This bug is making webdriver pretty useless on IE for any type of
JavaScript testing. It has now been fixed in the selenium repository.

Are there any known work-a-rounds until a new version of selenium-
webdriver is released?

Thanks :-)

On Nov 5, 6:08 pm, Jari Bakken jari.bak...@gmail.com wrote:
 On Sat, Nov 6, 2010 at 1:41 AM, Michael mmcwill...@gmail.com wrote:
  Selenium::WebDriver::Error::UnexpectedJavascriptError: Cannot execute
  script (17)

 You're probably running into this known bug in the IE driver:

 http://code.google.com/p/selenium/issues/detail?id=849

 (comment 5 has a failing test)

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


Re: [wtr-general] watir-webdriver fire_event('onmouseover') failing in IE

2010-11-08 Thread Michael


Yes, it does look related to that. Is there an updated build of the
dll anywhere for download instead of recompiling myself with that fix in
there. It still hasn't made it into a release. 

On Sat, 6 Nov 2010
02:08:18 +0100, Jari Bakken wrote: 

 On Sat, Nov 6, 2010 at 1:41 AM,
Michael wrote:
 Selenium::WebDriver::Error::UnexpectedJavascriptError:
Cannot execute script (17)
 You're probably running into this known bug
in the IE driver: http://code.google.com/p/selenium/issues/detail?id=849
[2] (comment 5 has a failing test)


Links:
--
[1]
mailto:mmcwill...@gmail.com
[2]
http://code.google.com/p/selenium/issues/detail?id=849

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


Re: [wtr-general] watir-webdriver fire_event('onmouseover') failing in IE

2010-11-08 Thread Michael


I know, but there was a patch attached to the ticket. No worries.


On Mon, 8 Nov 2010 21:46:04 +0100, Jari Bakken wrote: 

 On Mon, Nov
8, 2010 at 6:35 PM, Michael wrote:
 Yes, it does look related to that.
Is there an updated build of the dll anywhere for download instead of
recompiling myself with that fix in there. It still hasn't made it into
a release.
 It's not fixed yet - the bug is still
open.


Links:
--
[1] mailto:mmcwill...@gmail.com

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] watir-webdriver fire_event('onmouseover') failing in IE

2010-11-05 Thread Michael
Has anyone else run into this issue?

icon.fire_event('onmouseover')

In my example it is an image that I am trying to mouse over. It works
fine in FF, but gives the following exception in IE.


Selenium::WebDriver::Error::UnexpectedJavascriptError: Cannot execute
script (17)
C:/Ruby/187/lib/ruby/gems/1.8/gems/selenium-webdriver-0.0.29/lib/
selenium/webdriver/ie/bridge.rb:587:in `check_error_code'
C:/Ruby/187/lib/ruby/gems/1.8/gems/selenium-webdriver-0.0.29/lib/
selenium/webdriver/ie/bridge.rb:154:in `executeScript'
C:/Ruby/187/lib/ruby/gems/1.8/gems/selenium-webdriver-0.0.29/lib/
selenium/webdriver/common/driver.rb:207:in `execute_script'
C:/Ruby/187/lib/ruby/gems/1.8/gems/watir-webdriver-0.1.1/lib/watir-
webdriver/container.rb:18:in `browserbot'
C:/Ruby/187/lib/ruby/gems/1.8/gems/watir-webdriver-0.1.1/lib/watir-
webdriver/elements/element.rb:137:in `fire_event'

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Watir with MooTools

2010-11-01 Thread Michael
Has anyone used Watir with MooTools on IE? Everything works as I'd
expect in Firefox, but in IE none of the events are sent to the
browser when sent via methods like set, select etc. I can emulate most
events with actual mouse clicks if necessary (for checkboxes and radio
sets), but a select list is more difficult, so I would like to get to
the root of the problem.

Watir 1.6.7
Ruby 1.8.7
IE 8.0.6001.18702
MooTools Core 1.3

If I remove the MooTools framework and add the onchange attribute
directly to the select element, I do get the alert, but as soon as I
include the JS framework I am no longer able to receive the events in
IE 8. Changing the element with the mouse in IE does create the
expected events.

My guess is that it is an issue with the lower level way that Watir
accesses objects using win32ole. Is there any documentation about what
ole_object.fireEvent(...) actually does?

MooTools overwrites the native fireEvent method, but it should still
be called assuming OLE calls the JS method.

I'm looking for any insight on this incompatibility.

Thanks,
Michael


Watir sample:
  trigger1 = @browser.select_list(:name, 'trigger1')
  trigger1.set('option2')
  trigger1.set('option3')
  // Also tried, select and select_value, but they all use the same
select_item_in_select_list method.

HTML sample:
  select name=trigger1
option value=option1option1/option
option value=option2option2/option
option value=option3option3/option
  /select trigger1

JS sample:
  document.addEvent( 'domready', function() {
document.getElement( 'select[name=trigger1]' ).addEvent( 'change',
function(e) {
  alert( 'changed' );
});
  });

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


Re: [wtr-general] Re: A stupid question ... how do I apply patches to Watir? :-(

2010-04-13 Thread Michael Hwee
Can you use click!



- Original Message 
From: Rats crapats...@yahoo.com.au
To: Watir General watir-general@googlegroups.com
Sent: Tue, April 13, 2010 5:13:50 PM
Subject: [wtr-general] Re: A stupid question ... how do I apply patches to  
Watir? :-(

On Apr 14, 9:05 am, Rats crapats...@yahoo.com.au wrote:
 As per my previous posts I am having problems with click_no_wait.
 Apparently the following patch will fix the problem:

 http://jira.openqa.org/browse/WTR-320

 I can't seem to find any info on how to apply the patch on this page.
 All flames welcome as long as you show me how to apply the patch! ;-)

Ok, I have good news and bad news on my battle with click_no_wait.
Thanks to Ethan from the #Watir IRC channel for helping me understand
how to install the patch. I was simply required to replace a line
from the page-container.rb file.

The bad news is the patch did not fix the problem. I'm still getting
blinking yellows and no clicks. :-(

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: watir-general@googlegroups.com

To unsubscribe, reply using remove me as the subject.

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: watir-general@googlegroups.com


Re: [wtr-general] HP acquires the Watir project, announces Wativ

2010-04-01 Thread Michael Hwee
Is that April fool?





From: arihan sinha arihan.si...@googlemail.com
To: watir-general@googlegroups.com
Sent: Thu, April 1, 2010 3:25:53 AM
Subject: Re: [wtr-general] HP acquires the Watir project, announces Wativ

Can any one please confirm that this is the correct news.


On Thu, Apr 1, 2010 at 11:19 AM, Melkon, Raffi rmel...@gmail.com wrote:











Good luck!!!
 

From:watir-general@googlegroups.com [mailto:watir-gene...@googlegroups.com] On
Behalf Of Željko Filipin
Sent: Thursday, April 01, 2010 6:05 AM
To: watir-general@googlegroups.com; watir
Subject: Re: [wtr-general] HP acquires the Watir project, announces
Wativ

 
Alister and I are flying to HP headquarters (Palo Alto,
Calif.) as I write this (from the plane). We have heard that Watir users are
gathering in front of the headquarters. There are some rumors about them having
signs and shouting stuff. I hope we will manage to record a podcast with a few
of the Watir users and hear what they think.

Željko
-- 
Before posting, please read http://watir.com/support.
In short: search before you ask, be nice.
 
You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: watir-general@googlegroups.com
To unsubscribe: watir-general+unsubscr...@googlegroups.com
No virus
found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.437 / Virus Database: 271.1.1/2782 - Release Date: 03/31/10
18:32:00




-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.
 
You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: watir-general@googlegroups.com
To unsubscribe: watir-general+unsubscr...@googlegroups.com


-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.
 
You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: watir-general@googlegroups.com
To unsubscribe: watir-general+unsubscr...@googlegroups.com

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: watir-general@googlegroups.com
To unsubscribe: watir-general+unsubscr...@googlegroups.com

To unsubscribe, reply using remove me as the subject.


[wtr-general] Re: Iterate buttons in the page and call a method

2009-11-05 Thread Michael Hwee
I think he meant there are multiple buttons and he wanted to click on each one.
But, it is clicking only first one.

He needs to use the indexing to get to next button.





From: Ethan notet...@gmail.com
To: watir-general@googlegroups.com
Sent: Thu, November 5, 2009 2:10:18 PM
Subject: [wtr-general] Re: Iterate buttons in the page and call a method

yeah, I read this a couple of times, couldn't make a bit of sense out of it, 
and moved along. 


On Thu, Nov 5, 2009 at 16:45, Paul Rogers paul.rog...@shaw.ca wrote:

Im going to guess you didnt get any answer because your question is difficult 
to understand. Check the posting guidleines, and Im sure some one will help

Paul



On Thu, Nov 5, 2009 at 12:36 PM, Shlomit Gazit shlomitpatr...@gmail.com 
wrote:


Any idea anybody?


On Nov 4, 4:04 pm, Shlomit Gazit shlomitpatr...@gmail.com wrote:
 Hello,

 I have MultipleSelectPopup.clear(/ID_OPEN/, nil) method which I want
 to call it as many as buttons I have in the page that has id /
 ID_OPEN/.

 The method is clicking on the button I am sending it the id (/
 ID_OPEN/) and clearing the content from the popup.

 What so far is happening is that I am clicking on the same button each
 time. How can I make ititeratethrough all the buttons in the page

 with id /ID_OPEN/?







--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: onMouseover

2009-08-25 Thread Michael Hwee

I might give some sleep between mouseover and clicking.



- Original Message 
From: sd qajan2...@gmail.com
To: Watir General watir-general@googlegroups.com
Sent: Tuesday, August 25, 2009 2:05:56 PM
Subject: [wtr-general] onMouseover


Hi,

I have an item. Once I mouseover that item, I get an image which I
need to click on.  I used fire_event(onMouseover) which shows me the
button which is an image, but I need to click on that image.
Using .click on that image was not very successful.

Does anyone have any suggestions?

Exact code I used:

$b.link(:href = /aa/, :index = 8).fire_event(onMouseover)
$b.button(:alt, prev).click


Thanks.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: :index = 0 with firewatir

2009-08-15 Thread Michael Hwee

I would rather use
browser.links.length
This is already 1-based.




- Original Message 
From: Jari Bakken jari.bak...@gmail.com
To: watir-general@googlegroups.com
Sent: Friday, August 14, 2009 11:20:30 AM
Subject: [wtr-general] Re: :index = 0 with firewatir


On Fri, Aug 14, 2009 at 5:49 PM, Michael Hweemichael_h...@yahoo.com wrote:

 : index= 0 is not the last item.


Well, that depends on how the 1-indexed Watir collections are implemented. :)

The best solution for getting the last item in this case is:

browser.links.select { |l| l.text == 'foo' }.last


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: :index = 0 with firewatir

2009-08-14 Thread Michael Hwee

: index= 0 is not the last item.




- Original Message 
From: Alexandre neonoe123...@gmail.com
To: WATIR watir-general@googlegroups.com
Sent: Friday, August 14, 2009 5:40:55 AM
Subject: [wtr-general] :index = 0 with firewatir


Hello,
using firewatir, ff.link(:text = foo,:index = 2).click  works fine
but I would like to click on the last link found on the page.
Then ff.link(:text = foo,:index = 0).click should work.
But firewatir can not find this element.
Do you have another solution ?
Thank you.

-- 
Alexandre Delanoë


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Not able to run automatically a script automatically using rufus-scheduler

2009-08-13 Thread Michael Hwee

I think you need to use system().

system(ruby test1.rb)



- Original Message 
From: Maumita maumita.majum...@gmail.com
To: Watir General watir-general@googlegroups.com
Sent: Thursday, August 13, 2009 3:26:52 AM
Subject: [wtr-general] Not able to run automatically a script automatically 
using rufus-scheduler


I'm trying to use rufus-scheduler to run automatically a script in
every 1 hr. But not able to do that..
This is the script -

require 'rubygems'
require 'rufus/scheduler'

class Scheduler
  def start
    scheduler = Rufus::Scheduler.start_new
    scheduler.every '1h' do
      puts running test
      `ruby test1.rb`
    end
    scheduler.join
  end
end

Running test1.rb at the command line pops up an instance of IE,log in
to the application,search a keyword and log out from application.

How to run this script?
Is there anything I am missing?
Please help.

Thanks
Maumita

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Watir on Ruby 1.9.1

2009-08-10 Thread Michael Hwee

This is so great, Jari.
Thanks for working on this.



- Original Message 
From: Jari Bakken jari.bak...@gmail.com
To: watir-general@googlegroups.com
Sent: Sunday, August 9, 2009 3:49:59 AM
Subject: [wtr-general] Re: Watir on Ruby 1.9.1


On Fri, Aug 7, 2009 at 2:18 AM, Jari Bakkenjari.bak...@gmail.com wrote:
 At the moment you need my ruby191 branch from GitHub:
 http://github.com/jarib/watir/tree/ruby191
 I'll make sure it get merged to master before the next release of Watir - if
 no one has any objections.

I've pushed the 1.9 fixes to Bret's master on GitHub and all tests are
passing for FireWatir and Watir on both 1.8.6 and 1.9.1.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: stop ie from code

2009-08-08 Thread Michael Hwee
Well, that is why you asked because you don't know it does exist.
Did you try?





From: bao bao btb8...@gmail.com
To: watir-general@googlegroups.com
Sent: Friday, August 7, 2009 7:07:13 PM
Subject: [wtr-general] Re: stop ie from code

Thanks for your reply.
I don't think there is such method(ie.ie.stop)
My ruby version 1.8.6 and watir version is 1.6.2.
Is there any other soultion?




On Sat, Aug 8, 2009 at 12:28 AM, Michael Hwee michael_h...@yahoo.com wrote:


Try ie.ie.stop




- Original Message 
From: Alex.Dev btb8...@gmail.com
To: Watir General watir-general@googlegroups.com
Sent: Friday, August 7, 2009 2:01:38 AM
Subject: [wtr-general] stop ie from code


I tried to open a very slowly website, i want to stop it(like click
stop button in toolbar, but i need to do this from code) when it's
readState is interactive.

here is my code snippets:

require 'rubygems'
require 'watir'
require 'watir/ie'


ie = Watir::IE.new
ie.speed =:fast


@thread = Thread.new do
  loop {
sleep 0.5
if (ie.document.readyState =~ /interactive/)
  #stop ie and break the loop, now the problem is how to
complete the code
  #like ie.abort, but there is no this method.
end
  }
end


ie.goto 'http://www.flickr.com/'

Regards,
Alex.Dev





--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: stop ie from code

2009-08-07 Thread Michael Hwee

Try ie.ie.stop



- Original Message 
From: Alex.Dev btb8...@gmail.com
To: Watir General watir-general@googlegroups.com
Sent: Friday, August 7, 2009 2:01:38 AM
Subject: [wtr-general] stop ie from code


I tried to open a very slowly website, i want to stop it(like click
stop button in toolbar, but i need to do this from code) when it's
readState is interactive.

here is my code snippets:

require 'rubygems'
require 'watir'
require 'watir/ie'


ie = Watir::IE.new
ie.speed =:fast


    @thread = Thread.new do
      loop {
        sleep 0.5
        if (ie.document.readyState =~ /interactive/)
          #stop ie and break the loop, now the problem is how to
complete the code
          #like ie.abort, but there is no this method.
        end
      }
    end


ie.goto 'http://www.flickr.com/'

Regards,
Alex.Dev

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Watir on Ruby 1.9.1

2009-08-06 Thread Michael Hwee
Good job, Jari.
Does it work with Watir 1.6.1 or 1.6.2?





From: Jari Bakken jari.bak...@gmail.com
To: watir-general@googlegroups.com
Sent: Wednesday, August 5, 2009 3:51:55 PM
Subject: [wtr-general] Re: Watir on Ruby 1.9.1

I figured out the WIN32OLE issue - all the tests are now passing on 1.9. 

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: attach while browser is still processing

2009-06-18 Thread Michael Hwee


To answer your question, it is 'No'.
I have similar experience with this issue, but not exactly situation in Eric's 
case.

The attach() function uses Shell.Application loop to search for the IE window.
Unfortunately, this weird IE would not show up at all.
It just basically stuck there.

Michael


- Original Message 
From: brettsykes brettcsy...@gmail.com
To: Watir General watir-general@googlegroups.com
Sent: Thursday, June 18, 2009 2:41:15 PM
Subject: [wtr-general] Re: attach while browser is still processing


The next time this happens open up irb and try to call
Watir::IE.attach to the hanging browser window from there. Does this
work or does it hang from the command line as well?


On Jun 18, 11:09 am, Eric Thompson eri...@gmail.com wrote:
 Watir Version: 1.6.2
 Browser: IE7

 I have notice an issue with attaching to a browser window while that
 window is still processing a request.  This causes the browser session
 to hang indefinitely.  When registering a user account in our web app,
 the registration process sends a verification email to the email
 address provided during registration.  I open a second browser window
 to navigate to gmail to interact with the verification email and in
 this email, there is a verification link.  When I click this link, a
 third browser window is opened and it is this window that is
 exhibiting the problem.

 When this third window first loads, it executes some javascript that
 authenticates and redirects.  When I try to attach to this window
 while it is doing this, the browser hangs and never completes it
 process.  I have added a hard sleep of 3 seconds to the test fixture
 to wait to attach and this seems to have helped a bit but the problem
 is still intermittent (when before it failed every time).  When I run
 this process manually, it executes fine so I can only assume it is the
 call to attach() while this third browser window is still processing
 the authentication request that is causing the problem.

 Has anyone experienced a similar issue and if so what was your
 workaround?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Setting HTML Properties

2009-06-18 Thread Michael Hwee


I think you could.

ie.table(:index,1).attributes['display'].value='block'
ie.table(:index,1).link(:index,1).click



- Original Message 
From: Ray rayjh...@gmail.com
To: Watir General watir-general@googlegroups.com
Sent: Thursday, June 18, 2009 4:13:31 PM
Subject: [wtr-general] Setting HTML Properties


Is there a way to set a property in html using watir? I have a table
that is not visible and i need to set it visibility property to
visible so that watir can click on it.


Thanks in advance

Ray

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: how to set IE screen width height?

2009-06-12 Thread Michael Hwee


Or, single line with javascript.

$ie.ie.document.parentWindow.execScript(resizeTo(x,y))



- Original Message 
From: orde ohil...@gmail.com
To: Watir General watir-general@googlegroups.com
Sent: Friday, June 12, 2009 9:59:48 AM
Subject: [wtr-general] Re: how to set IE screen width  height?


There are minimize and maximize methods in the IE class:
http://wtr.rubyforge.org/rdoc/classes/Watir/IE.html

As far as setting the browser height/width, this thread might point
you in the right direction:

http://groups.google.com/group/watir-general/browse_thread/thread/eafa73c6077b5a20/577c99de68e44f10?lnk=gstq=set+browser+size#577c99de68e44f10

Hope that helps.

orde

On Jun 12, 6:40 am, Encaps encapsu...@gmail.com wrote:
 How to resize the browser window?
 how to set IE screen width  height?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: element search recursive?

2009-06-03 Thread Michael Hwee


Frame object is entirely different entity from $ie.
So, it does not navigate into a frame to find frame objects.
What you finding is expected behavior.



- Original Message 
From: MatchBook jeffrey.fl...@gmail.com
To: Watir General watir-general@googlegroups.com
Sent: Wednesday, June 3, 2009 11:44:52 AM
Subject: [wtr-general] element search recursive?



I noticed that sometimes watir searches within its nested containers
for items, and sometimes it does not.  I would like to know the rules
by which it decides to do so or not.

For example, I noticed that in an Amazon.com page 'ie.link(:text,
Advanced Search)' returned the same link as 'ie.table.link(:text,
Advanced Search)' (here, table is a table element), which lead me to
believe that watir will search sub-containers for the item requested.

But when I was in the gmail web page, ie.text_fields returned a
different set of items than ie.canvas_frame.text_fields (here,
canvas_frame is a frame element), which puzzled me given my experience
above.

Jeff

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: forms in subframes - elements not found

2009-05-27 Thread Michael Hwee


Have you tried omitting form()?

For example, ff.frame(index, 1).select_list(:id,LOV6)



- Original Message 
From: jason jason.franklin.sto...@gmail.com
To: Watir General watir-general@googlegroups.com
Sent: Wednesday, May 27, 2009 6:02:01 AM
Subject: [wtr-general] forms in subframes - elements not found


Hi - here is the issue,

to get some element of a form - you can do this...

url = http://www.siemens.de/jobs/jobs_bewerbung/jobboerse/Seiten/
jobboerse.aspx

ff = FireWatir::Firefox.new
ff.goto(url)
ff.form(:name, lay0803234_src350a).select_list(:id, LOV6)

however, if the form happens to be in a subframe, like this

ff.frame(index, 1).form(:name, lay0803234_src350a).select_list(:id,
LOV6)

then firewatir terminates with `assert_exists': Unable to locate
element using :id, LOV6 (Watir::Exception::UnknownObjectException)

does anyone have any ideas on this??

help would be highly appreciated!!

Jason.





--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: How can I compare the captured web pages

2009-05-26 Thread Michael Hwee
if first == second
  puts same
else
  puts not the same
end





From: Durgesh Nadkarni fordurg...@yahoo.co.in
To: watir-general@googlegroups.com
Sent: Monday, May 25, 2009 3:12:39 AM
Subject: [wtr-general] Re: How can I compare the captured web pages


Hi Michael,

Thank you for the reply. I was busy with other stuff so replying after few days.

Can you give me sample code or syntax for comparing two images once I had both 
the images in md5 hash format?

So I will first take both the images keyword.jpg  newimage.jpg in the same way 
by capturing them through screen_capture method and then would go for hash 
comparison.

Please let me know on above.

Thanks  Regards
Durgesh.


--- On Fri, 8/5/09, Michael Hwee michael_h...@yahoo.com wrote:


From: Michael Hwee michael_h...@yahoo.com
Subject: [wtr-general] Re: How can I compare the captured web pages
To: watir-general@googlegroups.com
Date: Friday, 8 May, 2009, 8:44 PM


Instead of comparing the image to image, you can use MD5 key comparision.
Here is an example.


require 'digest/md5'


first = Digest::MD5.hexdigest(File.read(keywords.jpg))


second = Digest::MD5.hexdigest(File.read(NewImage.jpg))


Compare that two md5 hash.


Michael




From: Durgesh Nadkarni durgeshnadka...@gmail.com
To: watir-general@googlegroups.com
Sent: Friday, May 8, 2009 4:13:17 AM
Subject: [wtr-general] How can I compare the captured web pages

Hi,

I have used following method to capture the image of a web page
screen_capture(keywords.jpg,true)

Then I have captured the one more page.

Now I want to compare both the pages. 

What method can I use?

Also how can I compare a specific portion of a page with other page?

Please update me on above

Thanks  Regards
Durgesh.




 

Explore and discover exciting holidays and getaways with Yahoo! India Travel 
Click here!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Weirdness when working with multiple Firefox windows - using Watir::Browser

2009-05-21 Thread Michael Hwee
I think it is more like a problem with 'attach'.
There is known issue with attaching to Firefox.





From: Alan Ark ar...@compli.com
To: watir-general@googlegroups.com watir-general@googlegroups.com
Sent: Thursday, May 21, 2009 10:02:50 AM
Subject: [wtr-general] Weirdness when working with multiple Firefox windows - 
using Watir::Browser


Hi folks.
 
Running ruby 1.8.6
Win XP SP3
Version of Watir from github from (5/20/2009) – reports as 1.6.2, but its not 
the released version.
 
It appears that my browser windows are getting their wires crossed somehow.  
I’m attaching code that should show the problem.
 
What I see:
  Browser A goes to a page and clicks on a link to open a print friendly view 
of the page.
  Browser C should attach to the new window.
  Somehow Browser A now thinks that it’s the same thing as Browser C?
 
What I expected:
  Browser A and Browser C remain separate.
  
Code to use in IRB
#watir_browser is set to FF - using v 3.0.0.10 on my local machine.
require 'Watir'
a=Watir::Browser.new
a.goto(http://sportsillustrated.cnn.com/2009/baseball/mlb/05/21/peavy.trade/index.html;)
a.image(:alt,PRINT).click
# wait_until(30) { c=Watir::Browser.attach(:url,/printthis/) }  # this line is 
not working yet.
sleep 10  # attach will throw exception if the window does not appear in time.
c=Watir::Browser.attach(:url,/printthis/)  # if the window does not appear in 
time.
a.url   #  returns the URL from c!
 
 
I’m thinking that I should probably log this in JIRA, but I figured that I’d 
open the discussion 1st.
 
Thanks
-Alan
 



Alan Ark | QA Manager| Complí | ar...@compli.com | office: 503.294.2020 
x106 | fax: 503.294.1200 | www.compli.com
 

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: How to simulate right mouse action

2009-05-19 Thread Michael Hwee


You should search the group first.
There is a good info and sample codes for that.



- Original Message 
From: Jungle_hunter junglehuanggangzh...@gmail.com
To: Watir General watir-general@googlegroups.com
Sent: Tuesday, May 19, 2009 1:43:37 AM
Subject: [wtr-general] How to simulate right mouse action


hello
      everyone

    Now I use Watir to create some automation test script. I have a
problem with watir in testing my project. That is how to  simulate
right mouse action?

    can anyone help me or give me some idea?

        thank you


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Unable to locate element

2009-05-19 Thread Michael Hwee
check to see the object is in a frame.





From: Kamesh G kameshg...@gmail.com
To: watir-general@googlegroups.com
Sent: Tuesday, May 19, 2009 7:45:17 AM
Subject: [wtr-general] Re: Unable to locate element

Hi ,

I have tried with all the three options.

Still i am getting same error message

Thanks,
Kamesh


On Tue, May 19, 2009 at 7:37 PM, Željko Filipin zeljko.fili...@wa-research.ch 
wrote:

On Tue, May 19, 2009 at 3:44 PM, Kamesh kameshg...@gmail.com wrote:
 ie.link(:href, /faces/faces/client/inbox/userInbox.jspx).click

I think that Internet Explorer always sees absolute links (site.com/page), not 
relative links (/page). Any of these should work:

ie.link(:href, /userInbox.jspx/).click 

ie.link(:href, /\/faces\/faces\/client\/inbox\/userInbox.jspx/).click
ie.link(:href, MyTestSite.com/faces/faces/client/inbox/userInbox.jspx).click

Replace `MyTestSite.com` with your site in the third example.

If you want to know more about the code I have sent, let me know.

Željko 






--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Count Open Browsers

2009-04-14 Thread Michael Hwee


If you want someone's suggestion, you need to provide your codes where it 
happens.
Not just telling everyone that you have below error.

Don't assume everyone knows your problem already.



- Original Message 
From: zeroin23 zeroi...@gmail.com
To: Watir General watir-general@googlegroups.com
Sent: Tuesday, April 14, 2009 5:08:24 AM
Subject: [wtr-general] Re: Count Open Browsers


am getting the below error... (vista) dont mind, I am a noobie.

NameError: uninitialized constant Watir::Process::WIN32OLE
from C:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/
process.rb:6:in `count'
from C:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/
process.rb:17:
in `process_count'
from (irb):4



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: First level children only

2009-04-14 Thread Michael Hwee


Can you try xpath?


- Original Message 
From: andrew.d...@lthree.com andrew.d...@lthree.com
To: Watir General watir-general@googlegroups.com
Sent: Tuesday, April 14, 2009 7:54:53 AM
Subject: [wtr-general] First level children only


I have a large tree of nested divs, and I want to get an array of just
the direct children of any particular div. I do not know ahead of time
how many divs there will be at any level. Starting from a div, what is
the Watir code for getting the divs that are direct children (and yes,
there are other element types mixed in throughout)?

Example

div id=1
  div/
  div
 div/
 div/
   /div
   div/
/div

divs() returns the entire list of all descendant div elements. I want
just the first level children.

Andy

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Yahoo mail, creating a new email message.

2009-04-09 Thread Michael Hwee


Check that it could be in a frame.


- Original Message 
From: cboudreau carlboudreau...@gmail.com
To: Watir General watir-general@googlegroups.com
Sent: Thursday, April 9, 2009 11:32:56 AM
Subject: [wtr-general] Re: Yahoo mail, creating a new email message.


I am new to this Watir, and having some difficulty figuring this out.

I thought I would be starting something easy, by logging into Yahoo
and then creating a new email. However I can not get the Xpath line to
work.

#Include the FireWatir file.

require 'firewatir'

#include the FireWatir Module.

include FireWatir

ff=Firefox.new

#Open yahoo mail.

ff.goto(http://mail. yahoo.com)

#Put your user name.

ff.text_field( :name,login ).set(username )

#Put your password.

ff.text_field( :name,passwd ).set(password )

#Click Sign In button.

ff.button(:value, Sign In).click

# Locate the table cell element on the page.

ff.cell(:xpath, //td[contains( text, 'New')]/).click

#Click Sign Out button.

#ff.link(:text, Sign Out).click

#Close the browser.

#ff.close





--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Creating Frame objects before a page with a frame exists

2009-04-08 Thread Michael Hwee


Frame object always checked before you can use it.




- Original Message 
From: Tony ynot...@gmail.com
To: Watir General watir-general@googlegroups.com
Sent: Wednesday, April 8, 2009 2:30:49 AM
Subject: [wtr-general] Creating Frame objects before a page with a frame exists


Hi,

Having trouble creating a frame object before a particular page
contains the object.

The framework contains an object repository which contains all the
objects and methods that act on a particular page.Using textfields,
links, buttons etc work fine, because this is not checked on the page
if it exists when the object is created.But when creating a frame
object, it is checked against the current page if the frame exists,
which does not allow you store the frame objects.

Below is an example-
class Videopage
  def initialize(brow)
usrtxtfield = brow.frame(:id, loginframe).text_field
(:id,lgnId1)
srchtxtfield = brow.text_field(:id, topQuery2)
  end
#... other methods doing complex steps like login etc
end

Now the test code will require the above file.
require 'watir'
require 'watir/ie'
require 'Videopage' #--- object repository file
class Checktest  Test::Unit::TestCase
  def test_thisframe
Watir::Browser.default = ie
mybrow = Watir::Browser.new
vid = Videopage.new(mybrow)
mybrow.goto(http://video.aol.com;)
mybrow.link(:text, Sign In).click
sleep 5
  end
end

This returns an error in `locate': Unable to locate a frame using id
and loginframe.  (Watir::Exception::UnknownFrameException)

Is there a way to avoid the frame object from checking if the frame
exists on the page when it is being created?
Check only when doing an action on the frame or object within the
frame.
Want it to act like text_fields, buttons , links etc 

The other way to store the frame object i found was, by using it as a
string.
Is there any other way ???
example -
txtfield = 'mybrow.frame(:id, loginframe).text_field(:id, lgnId1)'
eval(txtfield).set(newone)

Thanks,
Tony

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: ff.frame(:index,1).button(:index, 2) does not work?

2009-04-06 Thread Michael Hwee


That is strange.
Your email summary said index,2, but you used index,0

Index is based 1.



- Original Message 
From: jason jason.franklin.sto...@gmail.com
To: Watir General watir-general@googlegroups.com
Sent: Friday, April 3, 2009 10:23:14 AM
Subject: [wtr-general] ff.frame(:index,1).button(:index, 2) does not work?



has anyone an idea about this?
is it me - or is this not supported in firewatir?

ff.frame(:index,1).button(:index, 0).click

#Unable to locate element, using :index, 0
(Watir::Exception::UnknownObjectException)


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Obect not found to Firewatir

2009-03-26 Thread Michael Hwee


Can you provide part of your script and html source where the object found?


- Original Message 
From: KiranD kir...@sikkasoft.com
To: watir-general@googlegroups.com
Sent: Wednesday, March 25, 2009 9:19:10 PM
Subject: [wtr-general] Re: Obect not found to Firewatir


Yes, I was there. I also used sleep command. But not worked.

Regards,


Kirand

-Original Message-
From: watir-general@googlegroups.com [mailto:watir-gene...@googlegroups.com]
On Behalf Of Bret Pettichord
Sent: Thursday, March 26, 2009 5:26 AM
To: watir-general@googlegroups.com
Subject: [wtr-general] Re: Obect not found to Firewatir


Could be a timing issue. Are you sure that the object exists on the page 
at the very moment that this code is being executed?

Bret

KiranD wrote:

 Hi,

 My script is running on IE without an error.

 I am trying to run same script using firewater.

 But it is showing an error

  


c:/ruby/lib/ruby/gems/1.8/gems/firewatir-1.6.2/lib/firewatir/MozillaBaseElem
ent.rb:967:in 
 `assert_exists': Unable to locate element, using :id, 
 ctl00_ContentPlaceHolder1_GridView1_ctl04_Image4 
 (Watir::Exception::UnknownObjectException)

 from 

c:/ruby/lib/ruby/gems/1.8/gems/firewatir-1.6.2/lib/firewatir/MozillaBaseElem
ent.rb:1112:in 
 `click'

  

 I checked source code, that object is exists in code.

  

 Why this is happening ? pls help..

  

 Regards,

 Kirand

  


 


-- 
Bret Pettichord
CTO, WatirCraft LLC, www.watircraft.com
Lead Developer, Watir, www.watir.com
Blog, www.io.com/~wazmo/blog
Twitter, www.twitter.com/bpettichord

Watir Training: Portland/Beaverton April 16-17
www.watircraft.com/training






--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Multiple Attributes for Input Elements

2009-03-24 Thread Michael Hwee


Hmm, actually think of that, you are right.
It should be no matter.
But for being good scripter, the index should be always at the end.
That is the way I do anyway.

Thanks.
Michael


- Original Message 
From: Bret Pettichord b...@pettichord.com
To: watir-general@googlegroups.com
Sent: Tuesday, March 24, 2009 8:08:11 AM
Subject: [wtr-general] Re: Multiple Attributes for Input Elements


Actually, no. The order makes no difference. Index is always applied 
last no matter where it is specified in the arguments.

Bret

Michael Hwee wrote:
 There is high important to less important in multiple attributes search.

 In your case, you haveie.text_field(:index = 2 , :name = q)
 To us, it means
 - find text_field with index=2
 - comfirm that it also has name='q'

 So, no wonder you are getting non_existance error if you have other 
 text_fields with no 'q' as name.

 Correct way is: ie.text_field(:name = q, :index = 2)




 - Original Message 
 From: Isabel joybe...@gmail.com
 To: Watir General watir-general@googlegroups.com
 Cc: charley.ba...@gmail.com
 Sent: Sunday, March 22, 2009 10:20:19 PM
 Subject: [wtr-general] Multiple Attributes for Input Elements


 Hi,
 I tried to use the code below to set a value in the text box of the
 google search page.

 require 'watir'
 ie=Watir::IE.new
 ie.goto http://google.com/;
 ie.text_field(:index = 2 , :name = q).set(xyz)

 But I receive an error which is:

  
 ruby testmultiAttri.rb

 c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/element.rb:52:in
 `assert_exists': Unable to locate element, using
 {:index=2, :name=q} (Watir::Exception::UnknownObjectException)
 from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/element.rb:
 284:in `enabled?'
 from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/element.rb:
 56:in `assert_enabled'
 from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/
 input_elements.rb:323:in `set'
 from testmultiAttri.rb:4
  
 Exit code: 1


 Please do let me know where I am going wrong.
 The text box gets identified correctly if I use any one of the two
 attributes.

 Thanks and Regards.



 On Feb 7, 9:51 pm, Charley Baker charley.ba...@gmail.com wrote:
  
 Multiple attributes for input elements are now supported in the latest
 version of Watir - 1.6.2. The wiki has also been updated.

 Charley Baker
 blog:http://charleybakersblog.blogspot.com/
 Lead Developer, Watir,http://wtr.rubyforge.org
 QA Architect, Gap Inc Direct

 On Fri, Feb 6, 2009 at 11:20 PM, Vens venugopal.devarako...@gmail.comwrote:








 Hi:
  
 I just started using Watir for automating few web UIs. During this I
 came across a situation where I had to put in data to a text field but
 incidently there are 2 text boxes having the same name. Please look at
 the snippet below:
  
 div class=boxed
 h3 class=title Authorize NG IDs /h3
  form action=ser.do method=post name=sAFrm
   input type=hidden value=authorize name=dispatch/
   table
  tbody
tr
td colspan=2div class=infomark You can enter comma
 separated multiple ngids /div/td
/tr
tr
  th MID /th
  td select size=1 name=mid/select/td
   /tr
tr
  th NG IDs /th
   tdinput type=text value= size=100
 maxlength=200
 name=ngids//td
   /tr
 /tbody
 /table
 /form
 /div
  
 div class=boxed
 h3 class=title Authorize NG IDs /h3
  form action=ser.do method=post name=sAFrm
   input type=hidden value=unauthorize name=dispatch/
   table
  tbody
tr
td colspan=2div class=infomark You can enter comma
 separated multiple ngids /div/td
/tr
tr
  th MID /th
  td select size=1 name=mid/select/td
/tr
tr
  th NG IDs /th
   tdinput type=text value= size=100
 maxlength=200
 name=ngids//td
   /tr
 /tbody
 /table
 /form
 /div
  
 When I looked into
 http://wiki.openqa.org/display/WTR/Multiple+Attributesit
 said it is not implemented for input elements.  Can you help me solve
 this.
  
 Regards
 Venu
  

 
  


-- 
Bret Pettichord
CTO, WatirCraft LLC, www.watircraft.com
Lead Developer, Watir, www.watir.com
Blog, www.io.com/~wazmo/blog
Twitter, www.twitter.com/bpettichord

Watir Training: Austin March 25-26, Portland/Beaverton April 16-17
www.watircraft.com/training



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Multiple Attributes for Input Elements

2009-03-24 Thread Michael Hwee


Ok, here is your misunderstanding.

For example, if you have: text_field(:index, 20)
The index number '20' is for all text_field objects on the page.

For example, if you have: text_field(:name='q', :index=20)
It does not mean the same text_field object above.
It means the index '20' of all text_field with 'name=p'.

If you have 'name=p' less than 20, you get 'non-existance' error.

Hope that helps.
Michael


- Original Message 
From: Isabel joybe...@gmail.com
To: Watir General watir-general@googlegroups.com
Sent: Tuesday, March 24, 2009 1:55:07 AM
Subject: [wtr-general] Re: Multiple Attributes for Input Elements


actually i am trying to create a framework around watir so by default
i get the indices for all the elements and then pass the multiple
attributes, so i need to work this out with both the attributes...

On Mar 24, 1:38 pm, Željko Filipin zeljko.fili...@wa-research.ch
wrote:
 On Tue, Mar 24, 2009 at 09:33, Isabel joybe...@gmail.com wrote:
  ie.text_field(:name = q ,:index = 2).set(xyz)
  Still I am getting an error.

 Because it can not find the second text field with name q.

  ie.text_field(:name = q ,:index = 1).set(xyz)
  and
  ie.text_field(:index = 2).set(xyz)
  both work fine...

 I just do not understand the problem. You got it working. What do you want
 to do?

 Željko

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Maximizng the Browser

2009-03-24 Thread Michael Hwee


'ie' and '$ie' are not the same object.

If you use 'ie', you have to follow what Charley said to get your browser 
maximize.
Otherwise, no help.



- Original Message 
From: Isabel joybe...@gmail.com
To: Watir General watir-general@googlegroups.com
Sent: Tuesday, March 24, 2009 1:13:57 AM
Subject: [wtr-general] Re: Maximizng the Browser


Hi Charley,
I have consistently used ie as the handle but still I am getting the
same error.

Is there a replacement to ie.maximize()??

On Mar 20, 6:30 am, Charley Baker charley.ba...@gmail.com wrote:
 In a few of your recent posts, the code you're using is mixing local
 variables (ie) and global variables ($ie). You need to first understand the
 difference between these two, the Ruby Pickaxe guide has information on
 variable types in Ruby.

 ie = Watir::IE.start(http://groups.google.com/group;)
 ie.goto(http://http://groups.google.com/group;)
 ie.maximize()

 Charley Baker
 blog:http://blog.charleybaker.org/
 Lead Developer, Watir,http://wtr.rubyforge.org
 QA Architect, Gap Inc Direct

 On Fri, Mar 20, 2009 at 1:25 AM, Shweta nagman...@gmail.com wrote:

  When i am trying to maximize the ie with the folllowing code am
  getting this error message can anyone pls guide me where am doing
  mistake

  ie = Watir::IE.start(http://groups.google.com/group;)
  ie.goto(http://http://groups.google.com/group;)
  $ie.maximize()

  am getting the following error message

  c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie.rb:113:in
  `initialize': unknown OLE server:
  `AutoItX3.Control' (WIN32OLERuntimeError)
 HRESULT error code:0x800401f3
   Invalid class string  from c:/ruby/lib/ruby/gems/1.8/gems/
  watir-1.6.2/lib/watir/ie.rb:113:in `new'
 from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie.rb:
  113:in `autoit'
 from
  c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie-class.rb:
  425:in `autoit'
 from
  c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie-class.rb:
  422:in `set_window_state'
 from
  c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie-class.rb:
  398:in `maximize'

  So i used this methtod

  ie.set_window_state :SW_MAXIMIZE

  even though showing some error

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Multiple Attributes for Input Elements

2009-03-23 Thread Michael Hwee


There is high important to less important in multiple attributes search.

In your case, you haveie.text_field(:index = 2 , :name = q)
To us, it means
- find text_field with index=2
- comfirm that it also has name='q'

So, no wonder you are getting non_existance error if you have other text_fields 
with no 'q' as name.

Correct way is: ie.text_field(:name = q, :index = 2)




- Original Message 
From: Isabel joybe...@gmail.com
To: Watir General watir-general@googlegroups.com
Cc: charley.ba...@gmail.com
Sent: Sunday, March 22, 2009 10:20:19 PM
Subject: [wtr-general] Multiple Attributes for Input Elements


Hi,
I tried to use the code below to set a value in the text box of the
google search page.

require 'watir'
ie=Watir::IE.new
ie.goto http://google.com/;
ie.text_field(:index = 2 , :name = q).set(xyz)

But I receive an error which is:

ruby testmultiAttri.rb
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/element.rb:52:in
`assert_exists': Unable to locate element, using
{:index=2, :name=q} (Watir::Exception::UnknownObjectException)
from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/element.rb:
284:in `enabled?'
from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/element.rb:
56:in `assert_enabled'
from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/
input_elements.rb:323:in `set'
from testmultiAttri.rb:4
Exit code: 1

Please do let me know where I am going wrong.
The text box gets identified correctly if I use any one of the two
attributes.

Thanks and Regards.



On Feb 7, 9:51 pm, Charley Baker charley.ba...@gmail.com wrote:
 Multiple attributes for input elements are now supported in the latest
 version of Watir - 1.6.2. The wiki has also been updated.

 Charley Baker
 blog:http://charleybakersblog.blogspot.com/
 Lead Developer, Watir,http://wtr.rubyforge.org
 QA Architect, Gap Inc Direct

 On Fri, Feb 6, 2009 at 11:20 PM, Vens venugopal.devarako...@gmail.comwrote:







  Hi:

  I just started using Watir for automating few web UIs. During this I
  came across a situation where I had to put in data to a text field but
  incidently there are 2 text boxes having the same name. Please look at
  the snippet below:

  div class=boxed
  h3 class=title Authorize NG IDs /h3
   form action=ser.do method=post name=sAFrm
input type=hidden value=authorize name=dispatch/
table
   tbody
 tr
 td colspan=2div class=infomark You can enter comma
  separated multiple ngids /div/td
 /tr
 tr
   th MID /th
   td select size=1 name=mid/select/td
/tr
 tr
   th NG IDs /th
tdinput type=text value= size=100
  maxlength=200
  name=ngids//td
/tr
  /tbody
  /table
  /form
  /div

  div class=boxed
  h3 class=title Authorize NG IDs /h3
   form action=ser.do method=post name=sAFrm
input type=hidden value=unauthorize name=dispatch/
table
   tbody
 tr
 td colspan=2div class=infomark You can enter comma
  separated multiple ngids /div/td
 /tr
 tr
   th MID /th
   td select size=1 name=mid/select/td
 /tr
 tr
   th NG IDs /th
tdinput type=text value= size=100
  maxlength=200
  name=ngids//td
/tr
  /tbody
  /table
  /form
  /div

  When I looked into
 http://wiki.openqa.org/display/WTR/Multiple+Attributesit
  said it is not implemented for input elements.  Can you help me solve
  this.

  Regards
  Venu

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Multiple Attributes and form

2009-03-19 Thread Michael Hwee


I don't get is why are you using :action = /.*/ ?
Can you just take it off, so that the execution is much more efficient and work 
w/o any issue?




- Original Message 
From: alexey s. radiact...@gmail.com
To: Watir General watir-general@googlegroups.com
Sent: Wednesday, March 18, 2009 10:16:04 PM
Subject: [wtr-general] Multiple Attributes and form


There is problem with Multiple Attributes and form.

I use FireWatir on Ubuntu Linux with FireFox.
when I run next code:

a = ff.form(:action = /.*/, :index = 1)
p a

gets:
/var/lib/gems/1.8/gems/firewatir-1.6.2/lib/firewatir/
MozillaBaseElement.rb:967:in `assert_exists': Unable to locate
element, using :name, {:action=/.*/, :index=1}
(Watir::Exception::UnknownObjectException)
from /var/lib/gems/1.8/gems/firewatir-1.6.2/lib/firewatir/
MozillaBaseElement.rb:748:in `inspect'
from test.rb:84:in `p'

But
a = ff.link(:text = /.*/, :index = 2)
work successfully

firewatir - 1.6.2
Mozilla Firefox 3.0.7
ruby 1.8.7 (2008-08-11 patchlevel 72)
Ubuntu 8.10

Can you help me ?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Problems locating basic elements in Watir

2009-03-17 Thread Michael Hwee


This is your problem -- Unable to locate element, using :id, c_ddlCategory

Make sure you have this element visible and enable.

Your Html code did not show this element, only login which is fine you said.



- Original Message 
From: Mark Lehky mark.le...@aclaro.com
To: watir-general@googlegroups.com
Sent: Tuesday, March 17, 2009 8:05:47 AM
Subject: [wtr-general] Problems locating basic elements in Watir


Hello all.

I am new to Watir as well as Ruby, but have had experience with other
tools and languages. Installed Ruby+Watir (no issues), ran through the
basic tutorial, everything worked just fine.

I then tried to create the first test for my AUT. The test was quite
simple: login and try to locate some text on the next page.
The login portion worked: found the two text boxes
(username/password), found the login button. However, the next page is
effectively blank to Watir. For any element that I tried to .flash, I
always got the error:
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/element.rb:52:in
`assert_exists': Unable to locate element, using :id, c_ddlCategory
(Watir::Exception::UnknownObjectException)
from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/element.rb:239:in
`flash'
from petroLook_login.rb:15

After searching through past posts here, I was led to Webmetrics RIA
Script Recorder. That tool cannot see of the elements either -
nothing is recorded after the login page. :(

Here is my sample Watir test:
require watir
test_site = http://localhost/petroLook4410;
ie = Watir::IE.new
ie.goto test_site
if ! ie.text.include? Login
  puts Test Failed! Could not find: 'Login'.
  exit 1
end
ie.text_field(:id, c__txtUsername).set bootstrap
ie.text_field(:id, c__txtPassword).set bootstrap
ie.button(:id, c__btnLogin).click
# everything past this point is gone
if ! ie.text.include? Activating the database
  puts Test Failed! Could not find: 'Activating the database'.
  exit 1
end
puts All good!
exit 0

Here is the HTML code snippet grabbed from IE Developer Toolbar of the
above text (I wonder how e-mail clients are going to handle this - I
am typing this in plaintext-mode):
!DOCTYPE HTML PUBLIC -//W3C//DTD HTML Transitional//EN
META http-equiv=Content-Type content=text/html; charset=windows-1252
HTML class= page id=html
HEAD
STYLE /* No matching styles were found. */ /STYLE
/HEAD
BODY class= page ie id=body
  FORM id=frmControlHost name=frmControlHost
action=WebPages_ControlHost.aspx?control=aclaro.petroLook.WebControls.Generic.PageHostpagetype=Admincategory=Bootstrapgroup=Schema
method=post
   PActivating the database enables petroLook users to log in and
disables the bootstrap user. /P
  /FORM
/BODY
/HTML

TIA for any help.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Problems locating basic elements in Watir

2009-03-17 Thread Michael Hwee


So, you might want to try:
$ie.frame(:index,1).text.include?(Activating the database)




- Original Message 
From: Mark Lehky mark.le...@aclaro.com
To: watir-general@googlegroups.com
Sent: Tuesday, March 17, 2009 10:20:03 AM
Subject: [wtr-general] Re: Problems locating basic elements in Watir


The puts ie.html.inspect generates:
HTML
HEAD
   TITLEpetroLook - aclaro softworks, inc./TITLE\r\n
   META content=favorite name=save
/HEAD
FRAMESET tabIndex=999
   FRAME id=contentFrame tabIndex=999
src=\/petroLook4410/plugins/cache/webresources/aclaro_petroLook_WebResources/4_4_3353_10382/WebPages_Administration_AdministrationFrameset.aspx?category=Bootstrap\
/FRAMESET
/HTML

So apparently there is nothing there. :( Now what do I do?


2009/3/17 marekj marekj@gmail.com:
 Welcome to Ruby and Watir.
 Glad you jumped in. It's a great language and Watir is a nice library.

 about your issue: you may try right after you login click to capture the
 html and see what's there; try with;
 puts ie.html.inspect
 after ie.button(how, what).click line

 Another possible issue may be a hidden frame (frameset). Just a wild guess
 since I've seen it happen in a couple of apps I worked with.

 Also I noticed that the HTML generated by IEDeveloperToolbar is not really
 the HTML that's on the page. The IEDevToolbar adds its own head info for
 meta doctype and styles.


 marekj

 Watirloo: Semantic Page Objects in UseCases
 http://github.com/marekj/watirloo/



 On Tue, Mar 17, 2009 at 10:05 AM, Mark Lehky mark.le...@aclaro.com wrote:

 Hello all.

 I am new to Watir as well as Ruby, but have had experience with other
 tools and languages. Installed Ruby+Watir (no issues), ran through the
 basic tutorial, everything worked just fine.

 I then tried to create the first test for my AUT. The test was quite
 simple: login and try to locate some text on the next page.
 The login portion worked: found the two text boxes
 (username/password), found the login button. However, the next page is
 effectively blank to Watir. For any element that I tried to .flash, I
 always got the error:
 c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/element.rb:52:in
 `assert_exists': Unable to locate element, using :id, c_ddlCategory
 (Watir::Exception::UnknownObjectException)
 from
 c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/element.rb:239:in
 `flash'
 from petroLook_login.rb:15

 After searching through past posts here, I was led to Webmetrics RIA
 Script Recorder. That tool cannot see of the elements either -
 nothing is recorded after the login page. :(

 Here is my sample Watir test:
 require watir
 test_site = http://localhost/petroLook4410;
 ie = Watir::IE.new
 ie.goto test_site
 if ! ie.text.include? Login
   puts Test Failed! Could not find: 'Login'.
   exit 1
 end
 ie.text_field(:id, c__txtUsername).set bootstrap
 ie.text_field(:id, c__txtPassword).set bootstrap
 ie.button(:id, c__btnLogin).click
 # everything past this point is gone
 if ! ie.text.include? Activating the database
   puts Test Failed! Could not find: 'Activating the database'.
   exit 1
 end
 puts All good!
 exit 0

 Here is the HTML code snippet grabbed from IE Developer Toolbar of the
 above text (I wonder how e-mail clients are going to handle this - I
 am typing this in plaintext-mode):
 !DOCTYPE HTML PUBLIC -//W3C//DTD HTML Transitional//EN
 META http-equiv=Content-Type content=text/html; charset=windows-1252
 HTML class= page id=html
 HEAD
 STYLE /* No matching styles were found. */ /STYLE
 /HEAD
 BODY class= page ie id=body
  FORM id=frmControlHost name=frmControlHost

 action=WebPages_ControlHost.aspx?control=aclaro.petroLook.WebControls.Generic.PageHostpagetype=Admincategory=Bootstrapgroup=Schema
 method=post
   PActivating the database enables petroLook users to log in and
 disables the bootstrap user. /P
  /FORM
 /BODY
 /HTML

 TIA for any help.




 



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Help....

2009-02-19 Thread Michael Hwee


Actually, this is nothing to do with Watir.

For your problem, you can solve through Registry.
Add these lines to your Registry.

[HKEY_CURRENT_USER\Control Panel\Desktop]
ForegroundFlashCount=dword:0001
ForegroundLockTimeout=dword:




- Original Message 
From: venky venkatesh...@gmail.com
To: Watir General watir-general@googlegroups.com
Sent: Wednesday, February 18, 2009 11:16:32 PM
Subject: [wtr-general] Help


Hi,

Kindly help me in this issue. Iam using Watir 1.6.2 installed on 17-
Feb-09. The Problem is $ie.bring_to_front() is not working application
does't comes to front but the script is running fine. Please help me
in this. Is it a problem in Gem

Thanks,
Venkat

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Help....

2009-02-19 Thread Michael Hwee
Even bring_to_front() uses AutoIt, it did not give error on WIN32OLE.
So, I don't think that is registering issue.
But, I could be wrong.





From: pink hiii pinkh...@yahoo.com
To: watir-general@googlegroups.com
Sent: Thursday, February 19, 2009 5:16:29 AM
Subject: [wtr-general] Re: Help


Hi Venky,
 
In your case, Autoit.dll is not registed with your operating system. First 
register Autoit.dll with regsrv32 compand. and try the same function like, 
bring_to_front, maximize etc..
 
Regards
Siva

--- On Thu, 19/2/09, venky venkatesh...@gmail.com wrote:

From: venky venkatesh...@gmail.com
Subject: [wtr-general] Help
To: Watir General watir-general@googlegroups.com
Date: Thursday, 19 February, 2009, 12:46 PM


Hi,

Kindly help me in this issue. Iam using Watir 1.6.2 installed on 17-
Feb-09. The Problem is $ie.bring_to_front() is not working application
does't comes to front but the script is running fine. Please help me
in this. Is it a problem in Gem

Thanks,
Venkat

 

 Check out the all-new Messenger 9.0! Click here.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: FireWatir and unicode IDs/input, etc... Works with Watir/IE...

2009-02-19 Thread Michael Hwee


Is it for Japanese chars(two bytes) or Western chars?

Do you have sample html codes that we can take a look?





- Original Message 
From: John Kolokotronis johnj...@gmail.com
To: Watir General watir-general@googlegroups.com
Sent: Thursday, February 19, 2009 7:42:46 AM
Subject: [wtr-general] Re: FireWatir and unicode IDs/input, etc... Works with 
Watir/IE...

Furthermore, I tried Željko's solution here:

http://zeljkofilipin.com/2007/02/26/enter-non-english-character-in-text-field/

Works perfectly with Watir/IE - I adapted the example for FireWatir:

require 'watir'
require 'win32ole'

Watir::Browser.default = 'firefox'

excel = WIN32OLE::new('excel.Application')
workbook = excel.Workbooks.Open(C:/data.xls) # open file
worksheet = workbook.Worksheets(1) # the first worksheet
cell = worksheet.Range('a1')['Value'] # value of single cell

@browser = Watir::Browser.start(http://www.google.com/;)
@browser .text_field(:index, 1).set(cell) # set text field to value
from cell

And the Männlich string becomes garbage:
MÃÂÂÂÂÂÂ
¤nnlich

Not sure what else to try... FF itself is set to UTF-8 page encoding
and displays all unicode fine - it's only values manipulated/input by
my scripts that are being messed up...

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: On Error Resume Next - Equal statement in Ruby

2009-02-12 Thread Michael Hwee


This is the same as Exception handling.
begin
 ...
rescue
 ...
end



- Original Message 
From: Prince3105 prince3...@gmail.com
To: Watir General watir-general@googlegroups.com
Sent: Wednesday, February 11, 2009 11:11:36 PM
Subject: [wtr-general] On Error Resume Next - Equal statement in Ruby


Hi This is Prince3105,

Fairly newbie to watir, and i am using QTP for a long time, since  a
Vbscripter, i couldn't get all features of Ruby.
In Vbscript we are using one statement On error Resume Next and On
error Goto 0 these two will help us in error handling.

so Experts can you throw some light on my request, please give some
examples about, if any error occurs in a particular code watir should
leave this code and move to next line that process should be
continued  until the err handler got disabled.

Thanks,

Prince3105



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: count the number of div elements (without divs.find_all)

2009-02-10 Thread Michael Hwee


Very cool, Jarmo.
If you don't mind, can you explain how to find such powerful neat methods?


That helps all of us.

Thanks.


- Original Message 
From: Jason freezingki...@gmail.com
To: Watir General watir-general@googlegroups.com
Sent: Monday, February 9, 2009 4:47:19 PM
Subject: [wtr-general] Re: count the number of div elements (without 
divs.find_all)


Beautiful.  html.scan is exactly what I was after, that does the trick
immensely faster.

Thanks Jarmo.

- Jason

Jarmo Pertman wrote:
 try something like:
 puts $ie.html.scan(/div.*class\s*=\s*details/i).size

 pay attention to the  part. If you get 0 results, try it with '.
 Also, it is possible that you have some with  and some with ' if
 that's the case, then you should make this regular expression even
 more abstract. Anyway, this should be quite fast if you get your
 regexp correct.

 
  On Wed, Feb 4, 2009 at 9:34 PM, Jason freezingki...@gmail.com wrote:
 
   I've got anywhere from 1 to 10 div elements on my page with the same
   class.
 
   div class=details
 
   I want a robust and quick way of determining how many, or iterating
   through each of these divs.
 
   divs.find_all does the job, but it's rather slow because it appears to
   be iterating through EVERY div on my page (300+) and then attempting
   to match these to the class, i.e.
 
 $ie.divs.find_all{|dv|/details/.match(dv.class_name)}.length
 
   A little bit slow.
 
   Alternatively I thought of using :index until I resulted in an error,
   i.e.
 
 for i in 1..10 (until an error occurs)
$ie.div(:class=details, :index=i)
 end
 
   But this seems a little messy.
 
   Any better suggestions? Something simple I'm missing?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: count the number of div elements (without divs.find_all)

2009-02-10 Thread Michael Hwee


Thanks, Alex.
I need to catch up my readings.




- Original Message 
From: Alex Collins a.j.collins...@gmail.com
To: watir-general@googlegroups.com watir-general@googlegroups.com
Sent: Tuesday, February 10, 2009 10:06:52 AM
Subject: [wtr-general] Re: count the number of div elements (without 
divs.find_all)


Michael,

The scan method is part of the String class. If you look at the rdoc  
for the classes you can find some very useful methods.

The pickaxe book and other ruby tutorials are also helpful.

Alex

On 10 Feb 2009, at 16:14, Michael Hwee michael_h...@yahoo.com wrote:



 Very cool, Jarmo.
 If you don't mind, can you explain how to find such powerful neat  
 methods?


 That helps all of us.

 Thanks.


 - Original Message 
 From: Jason freezingki...@gmail.com
 To: Watir General watir-general@googlegroups.com
 Sent: Monday, February 9, 2009 4:47:19 PM
 Subject: [wtr-general] Re: count the number of div elements  
 (without divs.find_all)


 Beautiful.  html.scan is exactly what I was after, that does the trick
 immensely faster.

 Thanks Jarmo.

 - Jason

 Jarmo Pertman wrote:
 try something like:
 puts $ie.html.scan(/div.*class\s*=\s*details/i).size

 pay attention to the  part. If you get 0 results, try it with '.
 Also, it is possible that you have some with  and some with ' if
 that's the case, then you should make this regular expression even
 more abstract. Anyway, this should be quite fast if you get your
 regexp correct.


 On Wed, Feb 4, 2009 at 9:34 PM, Jason freezingki...@gmail.com  
 wrote:

 I've got anywhere from 1 to 10 div elements on my page with the  
 same
 class.

 div class=details

 I want a robust and quick way of determining how many, or iterating
 through each of these divs.

 divs.find_all does the job, but it's rather slow because it  
 appears to
 be iterating through EVERY div on my page (300+) and then  
 attempting
 to match these to the class, i.e.

  $ie.divs.find_all{|dv|/details/.match(dv.class_name)}.length

 A little bit slow.

 Alternatively I thought of using :index until I resulted in an  
 error,
 i.e.

  for i in 1..10 (until an error occurs)
 $ie.div(:class=details, :index=i)
  end

 But this seems a little messy.

 Any better suggestions? Something simple I'm missing?

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Extending the IE class

2009-02-06 Thread Michael Hwee


If you are using IE as sole browser, you can do that follow.

require 'watir/ie'


Or, use if statement or inside begin/rescue block.


- Original Message 
From: Brian Tomlin tendonstren...@gmail.com
To: Watir General watir-general@googlegroups.com
Sent: Thursday, February 5, 2009 8:32:17 AM
Subject: [wtr-general] Re: Extending the IE class


I took the include Watir out and that gave me a different error:

./portal.rb:20: uninitialized constant IE (NameError)
from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
31:in `ge
m_original_require'
from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
31:in `re
quire'
from C:/eclipse/workspace/tests/watir/portal/
report_test_setup.rb:3

Scott, I found the post you were talking about. Can you please
elaborate a little on the approach you ended up taking?

Thanks everybody for the help.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Retaining variables between tests in a thread-safe manner

2009-02-05 Thread Michael Hwee


If you use only IE, try replacing following
Watir::IE.new
with
Watir::IE.new_process

Michael



- Original Message 
From: Justin Ko justin.t...@gmail.com
To: Watir General watir-general@googlegroups.com
Sent: Thursday, February 5, 2009 4:11:24 AM
Subject: [wtr-general] Retaining variables between tests in a thread-safe manner


We are creating a smoke test for our web based application using the
Test/Unit module in Ruby (v1.8.6) with Watir (v1.6.2).

The smoke test would consist of a series of tests such as:

Test 1: Open an IE browser and goto to the application's home page
Test 2: Sign into the application
Test 3: Test some feature that is accessible to the signed in user
Test 4: Test some other feature that is accessible to the signed in
user

We would like to:
1) Use the same browser (Watir::IE object) throughout the entire
series of tests and
2) Be able to run the smoke test multiple times concurrently.

In trying to do this, we are running into problems with variable
scope.

When we assigned the Watir::IE object to an instance variable (@), the
variable appeared to be destroyed during the teardown of each test.
This prevents us from re-using the same browser across multiple tests.

When we assigned the Watir::IE object to a class (@@) or global ($)
variable, we could use the same browser throughout the series of
tests.  However, when using multiple threads to run the smoke test
multiple times concurrently, the threads collided due to everyone
using the same browser.

The below code illustrates our problem.

If you run the code as it is, two browsers will be opened and all of
the .goto() commands end up being performed on the last created
browser (ie both threads are sharing one browser).  If you change the
'@@browser' to '@browser', the test_open_browser test completes as
expected (ie two browsers open and each navigates to a page).
However, the browser is not retained from test to test, resulting in
the test_navigate_somewhere_else test giving the following error:

test_navigate_somewhere_else(TC_MyTest):
NoMethodError: undefined method `goto' for nil:NilClass
caller.rb:16:in `test_navigate_somewhere_else'


Question: Are there any ideas on how we can retain a variable (the
browser) between tests, yet still be thread-safe?

Thanks,
Justin Ko


Code:

require 'watir'
require 'watir/ie'
require 'test/unit'
require 'test/unit/ui/console/testrunner'

class TC_MyTest  Test::Unit::TestCase
  def test_open_browser
pages = ['www.google.ca', 'www.bestbuy.ca', 'www.futureshop.ca']
@@browser = Watir::IE.new
sleep(2+rand(10))
@@browser.goto( pages[rand(pages.length)] )
  end

  def test_navigate_somewhere_else
pages = ['www.henrys.com', 'www.gmail.com', 'maps.google.ca']
@@browser.goto( pages[rand(pages.length)] )
  end
end

class TS_MyTests
  def self.suite
suite = Test::Unit::TestSuite.new
suite  TC_MyTest.suite
return suite
  end
end

threads = []

2.times do |x|
  threads  Thread.new(x) { |myPage|
Test::Unit::UI::Console::TestRunner.run(TS_MyTests)
  }
end
threads.each { |aThread|  aThread.join }

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Unable to work with IFrame

2009-01-30 Thread Michael Hwee
Try with attribute.

frame(x) is  hack. So, it still might not support properly.

frame(:id, '').exists?  if frame has 'id'.

Michael





From: Niharika Patro niharikapa...@gmail.com
To: watir-general@googlegroups.com
Sent: Thursday, January 29, 2009 10:34:21 PM
Subject: [wtr-general] Re: Unable to work with IFrame

Hi Michael,

Thanks for providing a quick solution. I tried out this, but its still not 
working:

Even though the iframe is existing, the following code is returning false:

puts (@@browser.frame(loginframe).exists?())

Output: false

Any idea, what could be the issue here?

Regards
Niharika


On Thu, Jan 29, 2009 at 11:00 PM, Michael Hwee michael_h...@yahoo.com wrote:

frame does not support exists?().

However, you can *monkey-patch* as followed.

module Watir
  class Frame
alias_method :_locate, :locate
def locate
  begin
return _locate
  rescue
return nil
  end
end  
def exists?
  return @o != nil
end
  end
end  

Michael





From: Niharika Patro niharikapa...@gmail.com
To: watir-general@googlegroups.com
Sent: Thursday, January 29, 2009 4:57:13 AM
Subject: [wtr-general] Unable to work with IFrame



Hi,
 
In my application, when I click on a link it opens a Iframe.
 
I am trying to verify whether the iframe appears or not with the following code:
 
@@browser.frame(loginframe).exist?() or @@browser.frame(:id, 
loginframe).exist?()  
It throws the following error:
test_au_in_utility_panel(VideoPortal_Commenting_Notify):
Watir::Exception::UnknownFrameException: Unable to locate a frame with name 
loginframe
 Please help in handling this.
Regards
Niharika
 







--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: QA w/ Watir

2009-01-30 Thread Michael Hwee
Neeraj,
Matt said call him





From: neeraj girdhar er.neeraj...@gmail.com
To: watir-general@googlegroups.com
Sent: Thursday, January 29, 2009 11:59:44 PM
Subject: [wtr-general] Re: QA w/ Watir

Dear Sir,

I have experience in WATIR  Selenium. I am mailing my resume for this 
requirement.So, can u please forward my resume to your client.Please find the 
attached resume.

Regards,

Neeraj Girdhar
Software Quality Engineer
Crestech Software Systems
Contact No: +91 9810032935




On Thu, Jan 29, 2009 at 4:36 AM, Matt 007mik...@gmail.com wrote:


If anyone is looking for a position, I have a client who has a need
for a QA Tester/Analyst who is experienced with Watir.  I have an
exclusive on this opportunity so if you, or someone you know is
interested, please call me asap.

Thanks

Matt

800 428 9073 x189
mrich...@eliassen.com





--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Unable to work with IFrame

2009-01-29 Thread Michael Hwee
frame does not support exists?().

However, you can *monkey-patch* as followed.

module Watir
  class Frame
alias_method :_locate, :locate
def locate
  begin
return _locate
  rescue
return nil
  end
end  
def exists?
  return @o != nil
end
  end
end  

Michael





From: Niharika Patro niharikapa...@gmail.com
To: watir-general@googlegroups.com
Sent: Thursday, January 29, 2009 4:57:13 AM
Subject: [wtr-general] Unable to work with IFrame


Hi,
 
In my application, when I click on a link it opens a Iframe.
 
I am trying to verify whether the iframe appears or not with the following code:
 
@@browser.frame(loginframe).exist?() or @@browser.frame(:id, 
loginframe).exist?()  
It throws the following error:
test_au_in_utility_panel(VideoPortal_Commenting_Notify):
Watir::Exception::UnknownFrameException: Unable to locate a frame with name 
loginframe
 Please help in handling this.
Regards
Niharika
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Need help with verifying if text exists!

2009-01-28 Thread Michael Hwee


Replace if verify($ie.text.include?(searchedtext))==true
with if $ie.text.include?(searchedtext)



- Original Message 
From: Margam nk.mar...@gmail.com
To: Watir General watir-general@googlegroups.com
Sent: Tuesday, January 27, 2009 11:16:06 AM
Subject: [wtr-general] Need help with verifying if text exists!


HI all,
I am trying to verify if particular text is present in the page using
verify method. And also output corresponding passmessage and
failmessage. This is the code snippet I am using:
-
def verify_text(searchedtext,passmessage,failmessage)
if verify($ie.text.include?(searchedtext))==true
  puts passmessage
  else
  puts failmessage
  end
end
---

Note: all arguments for this function are passed from the main script.

The problem I am facing is, even if the verify passes, only the
failmessage is output. The passmessage is never output.

The reason I want to use verify instead of a simple
$ie.text.inclue? is, so that not only the failmessage is output but
also a failure is raised.

Hope I am clear.
Can someone tell me what the problem is?
Thank you

Margam

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: undefined method `flash'

2009-01-27 Thread Michael Hwee


You cannot flash the frame or exists? check.

But, you can use as follow.

$browser.frame(:name,ctl140_ctl00_ctl03_ctl01).text_field(:value,'FOO').flash




- Original Message 
From: Monkeybuns shaml...@twia.org
To: Watir General watir-general@googlegroups.com
Sent: Tuesday, January 27, 2009 9:04:14 AM
Subject: [wtr-general] undefined method `flash'


I'm getting the following error when I try to call the 'flash' method:

   NoMethodError: undefined method `flash' for #Watir::Frame:
0x47d42dc

My attempted call to 'flash' looks like this:

   $browser = Watir::IE.new
   ...many intermediate $browser commands not included here...
   $browser.frame(:name,ctl140_ctl00_ctl03_ctl01).flash

I wonder if I'm not requiring/including something I should be.  What I
currently have is the following:

   require 'rubygems'
   require 'watir'
   require 'test/unit/assertions'
   include Test::Unit::Assertions

Is there something else I should do so 'flash' will be defined?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: ie.contains_text problem

2009-01-26 Thread Michael Hwee


Or, ie.text_field(:value, 'FOO').exists?

Monkeybun, please make sure you asked the right question after your 
investigation.
So, we can help you solved your problems properly.

Michael



- Original Message 
From: dara dara.lil...@gmail.com
To: Watir General watir-general@googlegroups.com
Sent: Friday, January 23, 2009 3:13:11 PM
Subject: [wtr-general] Re: ie.contains_text problem


Using your example HTML, you can verify the contents of the text field
with either of the following:

assert(ie.text_field(:id, 'ctl140_ctl00_ctl09_txtValue').value ==
'FOO')
or
assert(ie.text_field(:name, 'ctl140$ctl00$ctl09$txtValue').value
== 'FOO')

You identify the text field by either the id or the name, and output
the value attribute.

Cheers,

-Dara

On Jan 23, 12:59 pm, Monkeybuns shaml...@twia.org wrote:
 dara, you are correct.  'FOO' is an entry in a text field, not part of
 the text of the page.  It does not appear in ie.text.

 When I view the source with FOO in the text field, the following HTML
 is the part of the source containing FOO:

 /div/tdtd class=InterParamPadding/tdtd
 class=ParamLabelCellspanAdjuster/span/tdtd
 class=ParamEntryCell style=padding-right:0px;div
 input name=ctl140$ctl00$ctl09$txtValue type=text value=FOO
 size=30 id=ctl140_ctl00_ctl09_txtValue / span style=white-
 space:nowrap;input id=ctl140_ctl00_ctl09_cbNull type=checkbox
 name=ctl140$ctl00$ctl09$cbNull onclick=document.getElementById
 ('ctl140_ctl00').ParametersController.UpdateParam1
 ('ctl140_ctl00_ctl09_cbNull', 'ctl140_ctl00_ctl09_txtValue'); /label 
 for=ctl140_ctl00_ctl09_cbNullNULL/label/span

 /div/td

 On Jan 23, 12:25 pm, dara dara.lil...@gmail.com wrote:

  It sounds as though 'FOO' is in your HTML but not in the text of the
  page.

  'FOO' appearing in ie.show_all_objects does not mean it will appear in
  ie.text.

  If 'FOO' does not appear in ie.text (try puts ie.text), then
  ie.contains_text('FOO') and ie.text.include?('FOO') are always going
  to return false.

  Including a HTML example in your post would help figure this out.

  On Jan 23, 10:53 am, Michael Hwee michael_h...@yahoo.com wrote:

   Or, just get ride of 'assert' and 'contains_text'.

   Just use

   if ie.text.include?(FOO)
 puts FOO found
   else
 puts FOO not found
   end

   Michael

   - Original Message 
   From: Bret Pettichord b...@pettichord.com
   To: watir-general@googlegroups.com
   Sent: Friday, January 23, 2009 7:05:46 AM
   Subject: [wtr-general] Re: ie.contains_text problem

   I'm not sure if contains_text returns false or nil when fails to find a
   match. Try this instead:

   if assert(ie.contains_text(FOO))

   Monkeybuns wrote:
The following code returns FOO not found even though
FOO is present in the output of ie.show_all_objects:

   ie = Watir::IE.attach(:title,FooBar Report)
   ie.show_all_objects
   if assert(ie.contains_text(FOO) != nil)
 puts FOO found
   else
 puts FOO not found
   end

Seems to me like this should work, though I'm very new
to Watir.  I get the following result:

C:/ruby/lib/ruby/1.8/test/unit/assertions.rb:48:in `assert_block':
false is not true. (Test::Unit::AssertionFailedError)
from C:/ruby/lib/ruby/1.8/test/unit/assertions.rb:500:in
`_wrap_assertion'
from C:/ruby/lib/ruby/1.8/test/unit/assertions.rb:46:in
`assert_block'
from C:/ruby/lib/ruby/1.8/test/unit/assertions.rb:63:in `assert'
from C:/ruby/lib/ruby/1.8/test/unit/assertions.rb:495:in
`_wrap_assertion'
from C:/ruby/lib/ruby/1.8/test/unit/assertions.rb:61:in `assert'

Any wisdom?- Hide quoted text -

  - Show quoted text -

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



  1   2   >