[wtr-general] Re: Getting errro in Chrome. Please suggest answer.

2011-08-30 Thread Alister Scott
have you downloaded the chromdriver and put it on your path 
http://watirwebdriver.com/chrome/

-- 
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: Getting errro in Chrome. Please suggest answer.

2011-08-30 Thread Amit Bobade
Thank you very much for your reply, Alister.

I am using watir-webdriver, so still do I need to download Chrome driver? I
think, watir -webdriver support Chrome, FF and IE.

Thanks,


On Tue, Aug 30, 2011 at 12:03 PM, Alister Scott alister.sc...@gmail.comwrote:

 have you downloaded the chromdriver and put it on your path
 http://watirwebdriver.com/chrome/

 --
 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


[wtr-general] Re: how do I select li link with id from a jquery dynamic list

2011-08-30 Thread Jarmo
Yes, but why are you trying to click on a link inside of the button?
Should't you just click on the button itself? And isn't it already present
at this stage, e.g. shouldn't ie.button(:src, /btn_continue.png/).click just
work?

Jarmo

On Tue, Aug 30, 2011 at 1:03 AM, M mo10soc...@gmail.com wrote:

 For some reason I was able to click on all the link in the li's fine but
 when clicking on the button image the
 ie.button(:src, /btn_continue.png/).when_present.a.click
 doen't work. Not sure why. I thought that when_present.a.click will ensure
 that the element is present before clicking on it


 On Mon, Aug 29, 2011 at 11:26 AM, Jarmo jarm...@gmail.com wrote:

 In great essence it doesn't make a difference, but i prefer Watir::Browser
 all the time.

 Jarmo


 On Mon, Aug 29, 2011 at 9:23 PM, M mo10soc...@gmail.com wrote:

 Thanks Jarmo,

 This worked for me
 ie.li(:id = industry_Technology__Internet).when_present.a.click
 I was doing this before, I didn't add the a between present and click

 ie.li(:id = industry_Technology__Internet).when_present.click

 I really appreciate your help. Sorry for the Novice questions, I am new
 to Watir, But I really like it and I'll update my posts so that everyone who
 is having the same problem knows

 Thanks


 On Mon, Aug 29, 2011 at 11:08 AM, M mo10soc...@gmail.com wrote:

 Does it make a difference if I use

 #ie=Watir::IE.new

 instead of

 #ie=Watir::Browser.new


 On Mon, Aug 29, 2011 at 10:55 AM, Jarmo jarm...@gmail.com wrote:

 I used jQuery to fill these radios at one point:
 $(input[type=radio]).attr(checked, checked) :)

 But the problem was in the end that you clicked on the li, but you
 had to click on the link inside of the li. This code works for me:

 require watir
 b = Watir::Browser.attach :url, //
 b.link(:id = launchIndustry).click
 b.li(:id = industry_Basic_Materials).when_present.a.click

 Jarmo

 On Mon, Aug 29, 2011 at 8:51 PM, M mo10soc...@gmail.com wrote:

 Sorry for the long registration...  :) , I normally just tab and enter
 to fill the personality radios...sorry
 all the ul and li are dynamically generated by the server (jquery). so
 they will not be there until the user clicks on the first link, and then 
 the
 next list will appear and the user will choose from it and so on. I'll 
 try
 to add the timing issue and see what happens.

 I'll keep you posted.

 Thanks


 On Mon, Aug 29, 2011 at 10:42 AM, Jarmo jarm...@gmail.com wrote:

 The registration process was too tedious :(

 By looking at you html then indeed, the ul is empty. As long as it's
 empty then you can't find the li :) Are you sure that the li should be
 there? Maybe it's a timing issue. Try something like this:
 # do something to trigger the popup
 wait_until {div(:id = industry).ul.lis.size  0}

 What happens? Can you see that the list is filled and does it still
 timeout? Anyway, i suspect it is a timing issue - just find out some 
 nice
 way to say to Watir that wait as long as this condition is met meaning 
 that
 the list is loaded properly. As long as the ul is empty and there 
 should be
 li-s in there, Watir can't find the li's. Also, remember that Watir does
 most of the things a lot faster than you can do manually and having
 JavaScript in the game means that there could be some race conditions.

 Good luck!

 Jarmo

 On Mon, Aug 29, 2011 at 7:46 PM, M mo10soc...@gmail.com wrote:

 I am attaching the page.html.
 I replaced the click_no_wait with click. ie.wait_until
 {container.present?} means that I am waiting for the view of the 
 screenshot
 to be visible.
 Also if you want to see a real example, you can go to:
 http://qa.jobsync.com/
 and sign up for a new account. During the registration process
 you'll have to go through that page. Experience section


 Thanks for the help


 On Mon, Aug 29, 2011 at 9:27 AM, Jarmo jarm...@gmail.com wrote:

 I'm not sure that #click_no_wait is needed. Send me the actual html
 code instead. Do it somehow like this:
 ie.link(:id, launchIndustry).click_no_wait # this bottom is to
 launch the form - attached
 container = ie.div(:id, industry)
 ie.wait_until {container.present?} # does this mean that the view
 on the screenshot is visible now?
 File.open(page.html, w) {|f| f.puts ie.html}

 Now, send us the page.html :)

 Jarmo


 On Mon, Aug 29, 2011 at 7:18 PM, M mo10soc...@gmail.com wrote:

 Thanks Jarmo,

 I tried to use your solutions with no luck - i still can't locate
 the elements. Here is my code and the HTML code, I also attached a 
 screen
 shot of the page so you know the type of pop up that I am dealing 
 with. any
 help is appreciated

 ie.link(:id, launchIndustry).click_no_wait # this bottom is to
 launch the form - attached
 container = ie.div(:id, industry)
 ie.wait_until {container.present?}
 ie.li(:id = industry_Technology__Internet).when_present.click
 ie.li(:id =
 supersector_Technology__Internet).when_present.click
 ie.li(:id =
 sector_Software__Computer_Services).when_present.click
 ie.li(:id =
 

Re: [wtr-general] Re: Getting errro in Chrome. Please suggest answer.

2011-08-30 Thread Yuping Zhong
Hi Amit,

You need to download the chrome driver and put it on your PATH.

On Tue, Aug 30, 2011 at 5:15 PM, Amit Bobade amit.sr...@gmail.com wrote:

 Thank you very much for your reply, Alister.

 I am using watir-webdriver, so still do I need to download Chrome driver? I
 think, watir -webdriver support Chrome, FF and IE.

 Thanks,


 On Tue, Aug 30, 2011 at 12:03 PM, Alister Scott 
 alister.sc...@gmail.comwrote:

 have you downloaded the chromdriver and put it on your path
 http://watirwebdriver.com/chrome/

 --
 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] Re: Getting errro in Chrome. Please suggest answer.

2011-08-30 Thread Amit Bobade
Okay..Thank you four great help Yuping and Alister.

Thanks,
-Amit
On Tue, Aug 30, 2011 at 3:33 PM, Yuping Zhong littlezhong...@gmail.comwrote:

 Hi Amit,

 You need to download the chrome driver and put it on your PATH.


 On Tue, Aug 30, 2011 at 5:15 PM, Amit Bobade amit.sr...@gmail.com wrote:

 Thank you very much for your reply, Alister.

 I am using watir-webdriver, so still do I need to download Chrome driver?
 I think, watir -webdriver support Chrome, FF and IE.

 Thanks,


 On Tue, Aug 30, 2011 at 12:03 PM, Alister Scott 
 alister.sc...@gmail.comwrote:

 have you downloaded the chromdriver and put it on your path
 http://watirwebdriver.com/chrome/

 --
 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




-- 
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


[wtr-general] Waiting for a user response

2011-08-30 Thread byung
Is there a way to make Watir code to wait for user's click event??

I would like to run the Watir code.. and while it is running, wait
till the user click a link on the web page..

If the user click a link on the page, and then the code go to next
step...

How would it be possible to do this??

Wait, User Click the link, go to next step in the Watir code.. Wait,
User Click the link, and then go to next step..

any help will be deeply appreciated.

-- 
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: way to check whether new page has been loaded..

2011-08-30 Thread George
This thread may answer your question:

http://bit.ly/nW5Acu



On Aug 29, 6:52 pm, byung jinuacad...@gmail.com wrote:
 is there a way to check whether a new page has been loaded in WATIR??

 could anyone tell me a way to check new page load in WATIR??

 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


[wtr-general] Re: way to check whether new page has been loaded..

2011-08-30 Thread byung
I made below code:

require 'watir'

ie = Watir::IE.start(www.testsite.com)

file = File.open(c:/test.txt, a)


while(ie.status != Done) do



file.puts ie.url()


end

file.close


and I got below error message:

'method_missing'; statusText WIN32OLERuntimeError



On Aug 30, 10:22 am, George george.sand...@gmail.com wrote:
 This thread may answer your question:

 http://bit.ly/nW5Acu

 On Aug 29, 6:52 pm, byung jinuacad...@gmail.com wrote:



  is there a way to check whether a new page has been loaded in WATIR??

  could anyone tell me a way to check new page load in WATIR??

  thanks.- Hide quoted text -

 - Show quoted text -

-- 
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] way to check whether new page has been loaded..

2011-08-30 Thread Rahul Sharma
How would you manually assert that the page has been loaded? If you are waiting 
for something on a loaded page, make an assertion on that element.

What are your reasons to know that the page has been loaded?
On 30 Aug 2011, at 18:37, byung wrote:

 I made below code:
 
 require 'watir'
 
 ie = Watir::IE.start(www.testsite.com)
 
 file = File.open(c:/test.txt, a)
 
 
 while(ie.status != Done) do
 
 
 
file.puts ie.url()
 
 
 end
 
 file.close
 
 
 and I got below error message:
 
 'method_missing'; statusText WIN32OLERuntimeError
 
 
 
 On Aug 30, 10:22 am, George george.sand...@gmail.com wrote:
 This thread may answer your question:
 
 http://bit.ly/nW5Acu
 
 On Aug 29, 6:52 pm, byung jinuacad...@gmail.com wrote:
 
 
 
 is there a way to check whether a new page has been loaded in WATIR??
 
 could anyone tell me a way to check new page load in WATIR??
 
 thanks.- Hide quoted text -
 
 - Show quoted text -
 
 -- 
 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

Regards,
Rahul Sharma

-- 
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: way to check whether new page has been loaded..

2011-08-30 Thread Super Kevy
Rahul makes good points
I usually fingerprint my page looking for unique items using .include?
and .exists?

Looks like your trying to look for the dom page attribute readyState
See http://www.w3schools.com/jsref/prop_doc_readystate.asp



On Aug 30, 1:51 pm, Rahul Sharma rahulsharma@gmail.com wrote:
 How would you manually assert that the page has been loaded? If you are 
 waiting for something on a loaded page, make an assertion on that element.

 What are your reasons to know that the page has been loaded?
 On 30 Aug 2011, at 18:37, byung wrote:





  I made below code:

  require 'watir'

  ie = Watir::IE.start(www.testsite.com)

  file = File.open(c:/test.txt, a)

  while(ie.status != Done) do

         file.puts ie.url()

  end

  file.close

  and I got below error message:

  'method_missing'; statusText WIN32OLERuntimeError

  On Aug 30, 10:22 am, George george.sand...@gmail.com wrote:
  This thread may answer your question:

 http://bit.ly/nW5Acu

  On Aug 29, 6:52 pm, byung jinuacad...@gmail.com wrote:

  is there a way to check whether a new page has been loaded in WATIR??

  could anyone tell me a way to check new page load in WATIR??

  thanks.- Hide quoted text -

  - Show quoted text -

  --
  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

 Regards,
 Rahul Sharma- Hide quoted text -

 - Show quoted text -

-- 
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] meaning of

2011-08-30 Thread byung
I come across below code..


while(ie.status! = Done) do

sleep(1)


end



Can anybody tell me what the meaning of ..
-
ie.status! = Done
-
means??

I do not understand what role ! mark does in the code..

-- 
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: meaning of

2011-08-30 Thread orde
 I do not understand what role ! mark does in the code..

!= is the negated form of the == operator.  Take a look at Table
7.1 : Common comparison operators on
http://phrogz.net/programmingruby/tut_expressions.html#expressions.

orde

On Aug 30, 12:54 pm, byung jinuacad...@gmail.com wrote:
 I come across below code..

 while(ie.status! = Done) do

 sleep(1)

 end

 Can anybody tell me what the meaning of ..
 -
 ie.status! = Done
 -
 means??

 I do not understand what role ! mark does in the code..

-- 
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: Waiting for a user response

2011-08-30 Thread Super Kevy
Not sure why you want manual stops but consider this:

def method_messagebox(txt,title,buttons)


On Aug 30, 11:54 am, byung jinuacad...@gmail.com wrote:
 Is there a way to make Watir code to wait for user's click event??

 I would like to run the Watir code.. and while it is running, wait
 till the user click a link on the web page..

 If the user click a link on the page, and then the code go to next
 step...

 How would it be possible to do this??

 Wait, User Click the link, go to next step in the Watir code.. Wait,
 User Click the link, and then go to next step..

 any help will be deeply appreciated.

-- 
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: Waiting for a user response

2011-08-30 Thread Super Kevy
Ok... fat fingers so I continue

Consider this:
It will popup and OK msgbox

require 'dl'

def method_messagebox(txt,title,buttons)
  puts ' * method_messagebox'
  user32 = DL.dlopen('user32')
  msgbox = user32[ 'MessageBoxA', 'ILLSI' ]
  r, rs = msgbox.call(0,txt,title,buttons)
 return r
end

# Main script stuff here
# Now wait tile the user answers the prompt by clicking OK
response = method_messagebox('Script is waiting for user to click OK',
'Manual Interrupt', 0)
. your other watir code 

Details at this link:
http://rubyonwindows.blogspot.com/2007/06/displaying-messagebox-using-windows-api.html






On Aug 30, 11:54 am, byung jinuacad...@gmail.com wrote:
 Is there a way to make Watir code to wait for user's click event??

 I would like to run the Watir code.. and while it is running, wait
 till the user click a link on the web page..

 If the user click a link on the page, and then the code go to next
 step...

 How would it be possible to do this??

 Wait, User Click the link, go to next step in the Watir code.. Wait,
 User Click the link, and then go to next step..

 any help will be deeply appreciated.

-- 
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] Waiting for a user response

2011-08-30 Thread Rahul Sharma
Would like to know why you would want to wait between steps in your automated 
tests as when they will run, who will click on these links when they run on a 
daily basis.

I haven't tried this myself but give it a try to see what it does:

wait_until{browser.button(:id = 'button').click}

On 30 Aug 2011, at 21:25, Super Kevy wrote:

 Not sure why you want manual stops but consider this:
 
 def method_messagebox(txt,title,buttons)
 
 
 On Aug 30, 11:54 am, byung jinuacad...@gmail.com wrote:
 Is there a way to make Watir code to wait for user's click event??
 
 I would like to run the Watir code.. and while it is running, wait
 till the user click a link on the web page..
 
 If the user click a link on the page, and then the code go to next
 step...
 
 How would it be possible to do this??
 
 Wait, User Click the link, go to next step in the Watir code.. Wait,
 User Click the link, and then go to next step..
 
 any help will be deeply appreciated.
 
 -- 
 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

Regards,
Rahul Sharma

-- 
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: meaning of

2011-08-30 Thread Super Kevy
Its a typo  in your context

   !=   means is not equal to,  You see notation everywhere except
maybe excel and legacy languages where its 




On Aug 30, 2:54 pm, byung jinuacad...@gmail.com wrote:
 I come across below code..

 while(ie.status! = Done) do

 sleep(1)

 end

 Can anybody tell me what the meaning of ..
 -
 ie.status! = Done
 -
 means??

 I do not understand what role ! mark does in the code..

-- 
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] How to get associated table column cell content

2011-08-30 Thread Super Kevy
I have a search table that returns 3 columns and N rows
the colums contain a link, a city/state and a distance
I know the link and can easily validate it using .include? and .exist?
Is there a method, that could return table row the link is in so i can
check the content of  the associated columns Perhaps some parent
method?

Regards

-- 
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: Waiting for a user response

2011-08-30 Thread Super Kevy
in the call statement the
First value is an integer it should be Zero
Second Value is a string
Third Value is a string
Fourth value is an integer in the sample its a Zero

check your inputs

On Aug 30, 3:51 pm, byung jinuacad...@gmail.com wrote:
 i get below error..

 in 'call': can't convert String into Integer TypeError  from
 xxx.code.rb:22: in 'method_messagebox'

 On Aug 30, 1:31 pm, Rahul Sharma rahulsharma@gmail.com wrote:



  Would like to know why you would want to wait between steps in your 
  automated tests as when they will run, who will click on these links when 
  they run on a daily basis.

  I haven't tried this myself but give it a try to see what it does:

  wait_until{browser.button(:id = 'button').click}

  On 30 Aug 2011, at 21:25, Super Kevy wrote:

   Not sure why you want manual stops but consider this:

   def method_messagebox(txt,title,buttons)

   On Aug 30, 11:54 am, byung jinuacad...@gmail.com wrote:
   Is there a way to make Watir code to wait for user's click event??

   I would like to run the Watir code.. and while it is running, wait
   till the user click a link on the web page..

   If the user click a link on the page, and then the code go to next
   step...

   How would it be possible to do this??

   Wait, User Click the link, go to next step in the Watir code.. Wait,
   User Click the link, and then go to next step..

   any help will be deeply appreciated.

   --
   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

  Regards,
  Rahul Sharma- Hide quoted text -

  - Show quoted text -- Hide quoted text -

 - Show quoted text -

-- 
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: Waiting for a user response

2011-08-30 Thread byung
I put below code..

def method_messagebox(txt,title,buttons)
  puts ' * method_messagebox'
  user32 = DL.dlopen('user32')
  msgbox = user32[ 'MessageBoxA', 'ILLSI' ]
  r, rs = msgbox.call(0,txt,title,0)
return r
end
response = method_messagebox('Script is waiting for user to click
OK','Manual Interrupt', 0)


but I get below error..


in 'call': can't convert String into Integer TypeError  from
xxx.code.rb:22: in 'method_messagebox'




On Aug 30, 2:03 pm, Super Kevy kpe...@scholarshipamerica.org wrote:
 in the call statement the
 First value is an integer it should be Zero
 Second Value is a string
 Third Value is a string
 Fourth value is an integer in the sample its a Zero

 check your inputs

 On Aug 30, 3:51 pm, byung jinuacad...@gmail.com wrote:



  i get below error..

  in 'call': can't convert String into Integer TypeError  from
  xxx.code.rb:22: in 'method_messagebox'

  On Aug 30, 1:31 pm, Rahul Sharma rahulsharma@gmail.com wrote:

   Would like to know why you would want to wait between steps in your 
   automated tests as when they will run, who will click on these links when 
   they run on a daily basis.

   I haven't tried this myself but give it a try to see what it does:

   wait_until{browser.button(:id = 'button').click}

   On 30 Aug 2011, at 21:25, Super Kevy wrote:

Not sure why you want manual stops but consider this:

def method_messagebox(txt,title,buttons)

On Aug 30, 11:54 am, byung jinuacad...@gmail.com wrote:
Is there a way to make Watir code to wait for user's click event??

I would like to run the Watir code.. and while it is running, wait
till the user click a link on the web page..

If the user click a link on the page, and then the code go to next
step...

How would it be possible to do this??

Wait, User Click the link, go to next step in the Watir code.. Wait,
User Click the link, and then go to next step..

any help will be deeply appreciated.

--
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

   Regards,
   Rahul Sharma- Hide quoted text -

   - Show quoted text -- Hide quoted text -

  - Show quoted text -- Hide quoted text -

 - Show quoted text -

-- 
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] run watir with ruby 1.9.2

2011-08-30 Thread ottoman
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


[wtr-general] Watir general question

2011-08-30 Thread bhuvanesh barani
This is a discussion on *Watir general question - RUBY* ; hi everyone it was 
really difficult to find a watir forum at all, so i hope i can find some 
help in here anyway. is there a way of veryfying that an IE spawned browser 
window exists? from what i ...

 For more details:

http://123maza.com/65/babul739/
 

-- 
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] questions from newbie

2011-08-30 Thread Duke

Hi folks,

Please welcome the newest user of watir! I just heard about watir when 
searching for web automation, and after reading some how-to articles, I 
was quite excited with my first script running below (run fine in ubuntu 
x86, havent tried in mac or windows yet):


 CODE START 
#!/usr/bin/env ruby

require 'rubygems'
require 'watir'
require 'nokogiri'
#require 'watir-webdriver'

#start the browser up
#browser = Watir::Browser.new :chorme
browser = Watir::Browser.start 
https://www.google.com/accounts/ServiceLogin?service=mail;


#pass in current page's html to nokogiri for parsing
page_html = Nokogiri::HTML.parse(browser.html)
text = page_html.xpath(.//*[@id='quota']).inner_text

while((text.to_f)7621.00)
  page_html = Nokogiri::HTML.parse(browser.html)
  text = page_html.xpath(.//*[@id='quota']).inner_text
  puts text
  sleep 2
end
 CODE END 

Since I am totally new to watir, I would appreciate any one helping me 
with my questions below:


 * Main advantage of watir compared to traditional method (manual 
crawling), as far as I understand, is to reduce the number of automated 
queries sent to the interested page. With what I am doing above, am I 
doing it right? Is it considered as one query each time when I call 
page_html.xpath(.//*[@id='quota']).inner_text? If not, then anyone can 
explain to me how it is working?


 * I have the feeling that the code above works as to extract infos 
from HTML code, whereas the quote produced from gmail is from a 
javascript. Is there a way that I capture infos from javascript instead 
of HTML code?


 * Now if I want to *detect* the change of quota, meaning I want a kind 
of *real-time* code that reports me quota anytime when quote on gmail 
changes its value. Anyone can recommend me how to achieve that?


Thanks so much in advances, and sorry for many questions.

D.

--
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] Unable to locate element, using :jssh_name (Watir::Exception: :UnknownObjectException)

2011-08-30 Thread Hari
I'm trying to retrieve the text from within the aanchor tags from
the
html shown below. i'm running firewatir on Windows Xp and have the
jssh
plugin installed.

a onblur=webFXTreeHandler.blur(this);
onfocus=webFXTreeHandler.focus(this); id=cwc_menu_local:ROOT.Find a
Request-anchor onclick=var stat=webFXTreeHandler.select(this); if(!
stat)return stat;; ondblclick=webFXTreeHandler.selectOpen(this);
target=detail href=/smweb/cwc/nav.menu?name=navStartamp;id=ROOT
%2FFind%20a%20Request
span class=cwc_navMenuLabelFind a Request/span/a

my code is as below and click the link

ff.link(:text, 'Find a Request').click

ff.element_by_xpath(//html/body/div[2]/ul/li[4]/a/span[text='Find a
Request']).click

ff.link(:xpath, //html/body/div[2]/ul/li[4]/a/span[@text='Find a
Request']).exists?

ff.link(:id = 'cwc_menu_local:ROOT.Find a Request-anchor').text

however the output of the text fails with the error
Unable to locate element, using :jssh_name
(Watir::Exception::UnknownObjectException)
Anyone know where i've gone wrong ?

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


[wtr-general] Re: Unable to click anchor with image inside LI tag

2011-08-30 Thread Alister Scott
you can't use a click on a non visible element.
tru

element.fire_event onclick

-- 
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: Unable to click anchor with image inside LI tag

2011-08-30 Thread Alister Scott
try 

element.fire_event onclick

-- 
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