[wtr-general] Trying to test for table data
I'm attempting to check a table for a string of data, however I keep getting this: 9if browser.table(:id, "dataTableBody").include?("146173") 10 puts "Data Verify passed" 11else 12 puts "Data Verify FAILED. Ouch." 13end _ NoMethodError: undefined method `include?' for # at top levelin Test for Cell Data.rb at line 9 Program exited with code #1 after 5.25 seconds. Is there something wrong with my .include? or am I just generally messing it up somehow? can this even work??lol Thank you in advance ANYONE that can help me out here. :) Sean -- 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
[wtr-general] Re: Trying to test for table data
I appreciate everyone's input! :) however I still get NoMethodErrors... I have a similar version of the script I'm trying to create here for just some random website with table data: require 'rubygems' require 'safariwatir' browser = Watir::Safari.new browser.goto("http://www.hurricaneaquasports.com/santee-100.html";) if browser.table(:id, "Table_01").cell(:text, "33 lbs").exists? puts "Data Verify passed" else puts "Data Verify FAILED. Ouch." end When I run that I get this. _ NoMethodError: undefined method ‘cell’ for # at top levelin Test for Cell Data.rb at line 6 _ any thoughts? On Sep 15, 11:41 am, Chuck van der Linden wrote: > If Z's approach below doesn't work (first thing I would have > suggested) you could also try something along these lines (especially > the first one if you know that a single cell should contain just that > text and nothing more) > > if browser.table(:id, "dataTableBody").cell(:text, "146173").exists? > or > if browser.table(:id, "dataTableBody").row(:text, /146173/).exists? > > On Sep 15, 1:02 am, Željko Filipin > wrote: > > > On Tue, Sep 14, 2010 at 9:58 PM, Watir General wrote: > > > 9 if browser.table(:id, "dataTableBody").include?("146173") > > > NoMethodError: undefined method `include?' for > > > # > > > You are calling "include?" method on a table object, and Ruby complains. You > > should call the method on table text (or html). > > > Example (not tested): > > > browser.table(:id, "dataTableBody").text.include?("146173") > > > Ž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. 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
[wtr-general] Re: Trying to test for table data
For those I get: NoMethodError: undefined method ‘text’ for # at top levelin Test for Cell Data Kayaks.rb at line 6 NoMethodError: undefined method ‘html’ for # at top levelin Test for Cell Data Kayaks.rb at line 6 Thank you but still nothing. This is strange :/ On Sep 15, 1:31 pm, Rajiv Nanduani wrote: > hi > try this as Z suggested > > require 'rubygems' > require 'safariwatir' > browser = Watir::Safari.new > browser.goto("http://www.hurricaneaquasports.com/santee-100.html";) > if browser.table(:id, "Table_01").text.include?("33 lbs") > puts "Data Verify passed" > else > puts "Data Verify FAILED. Ouch." > end > > or > > require 'rubygems' > require 'safariwatir' > browser = Watir::Safari.new > browser.goto("http://www.hurricaneaquasports.com/santee-100.html";) > if browser.table(:id, "Table_01").html.include?("33 lbs") > puts "Data Verify passed" > else > puts "Data Verify FAILED. Ouch." > end > > > > On Wed, Sep 15, 2010 at 10:52 PM, Watir General wrote: > > I appreciate everyone's input! :) however I still get > > NoMethodErrors... > > > I have a similar version of the script I'm trying to create here for > > just some random website with table data: > > > require 'rubygems' > > require 'safariwatir' > > browser = Watir::Safari.new > > browser.goto("http://www.hurricaneaquasports.com/santee-100.html";) > > if browser.table(:id, "Table_01").cell(:text, "33 lbs").exists? > > puts "Data Verify passed" > > else > > puts "Data Verify FAILED. Ouch." > > end > > > When I run that I get this. > > _ > > NoMethodError: undefined method ‘cell’ for # > 0x1010ede48> > > > at top level in Test for Cell Data.rb at line 6 > > _ > > > any thoughts? > > > On Sep 15, 11:41 am, Chuck van der Linden wrote: > > > If Z's approach below doesn't work (first thing I would have > > > suggested) you could also try something along these lines (especially > > > the first one if you know that a single cell should contain just that > > > text and nothing more) > > > > if browser.table(:id, "dataTableBody").cell(:text, "146173").exists? > > > or > > > if browser.table(:id, "dataTableBody").row(:text, /146173/).exists? > > > > On Sep 15, 1:02 am, Željko Filipin > > > wrote: > > > > > On Tue, Sep 14, 2010 at 9:58 PM, Watir General > > wrote: > > > > > 9 if browser.table(:id, "dataTableBody").include?("146173") > > > > > NoMethodError: undefined method `include?' for > > > > > # > > > > > You are calling "include?" method on a table object, and Ruby > > complains. You > > > > should call the method on table text (or html). > > > > > Example (not tested): > > > > > browser.table(:id, "dataTableBody").text.include?("146173") > > > > > Željko > > > > -- > > > > watir.com - community manager > > > > watirpodcast.com - host > > > > testingpodcast.com - audio podcasts on software testing. all of them > > > -- > > Before posting, please readhttp://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 > > -- > RAJIV KUMAR > > <http://rajivkumarnandvani.wordpress.com/> > <http://learnqtphelp.blogspot.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
[wtr-general] Re: Trying to test for table data
For this: require 'rubygems' require 'safariwatir' browser = Watir::Safari.new browser.goto("http://www.hurricaneaquasports.com/santee-100.html";) puts browser.table(:id, "Table_01").methods.sort Output: == === =~ [] __id__ __send__ blank? class clone column_count display dup each enum_for eql? equal? extend freeze frozen? hash how id inspect instance_eval instance_exec instance_of? instance_variable_defined? instance_variable_get instance_variable_set instance_variables is_a? kind_of? method methods nil? object_id private_methods protected_methods public_methods respond_to? row_count send singleton_methods tag taint tainted? tap to_a to_enum to_s type untaint what Everything else I get errors... On Sep 15, 1:56 pm, Rajiv Nanduani wrote: > hi do one thing just check this > > puts browser.table(:id, "Table_01").exists? > > wt is output ? > > then check methods > > puts browser.table(:id, "Table_01").methods.sort > > or > > check is table with in frame or not? > if yes > then > > puts browser.frame(:id,"uridvalue").table(:id, "Table_01").text > > > > On Wed, Sep 15, 2010 at 11:18 PM, Watir General wrote: > > For those I get: > > > NoMethodError: undefined method ‘text’ for # > 0x1010edec0> > > at top level in Test for Cell Data Kayaks.rb at line 6 > > > NoMethodError: undefined method ‘html’ for # > 0x1010edec0> > > at top level in Test for Cell Data Kayaks.rb at line 6 > > > Thank you but still nothing. This is strange :/ > > > On Sep 15, 1:31 pm, Rajiv Nanduani > > wrote: > > > hi > > > try this as Z suggested > > > > require 'rubygems' > > > require 'safariwatir' > > > browser = Watir::Safari.new > > > browser.goto("http://www.hurricaneaquasports.com/santee-100.html";) > > > if browser.table(:id, "Table_01").text.include?("33 lbs") > > > puts "Data Verify passed" > > > else > > > puts "Data Verify FAILED. Ouch." > > > end > > > > or > > > > require 'rubygems' > > > require 'safariwatir' > > > browser = Watir::Safari.new > > > browser.goto("http://www.hurricaneaquasports.com/santee-100.html";) > > > if browser.table(:id, "Table_01").html.include?("33 lbs") > > > puts "Data Verify passed" > > > else > > > puts "Data Verify FAILED. Ouch." > > > end > > > > On Wed, Sep 15, 2010 at 10:52 PM, Watir General > > wrote: > > > > I appreciate everyone's input! :) however I still get > > > > NoMethodErrors... > > > > > I have a similar version of the script I'm trying to create here for > > > > just some random website with table data: > > > > > require 'rubygems' > > > > require 'safariwatir' > > > > browser = Watir::Safari.new > > > > browser.goto("http://www.hurricaneaquasports.com/santee-100.html";) > > > > if browser.table(:id, "Table_01").cell(:text, "33 lbs").exists? > > > > puts "Data Verify passed" > > > > else > > > > puts "Data Verify FAILED. Ouch." > > > > end > > > > > When I run that I get this. > > > > _____ > > > > NoMethodError: undefined method ‘cell’ for # > > > 0x1010ede48> > > > > > at top level in Test for Cell Data.rb at line 6 > > > > _ > > > > > any thoughts? > > > > > On Sep 15, 11:41 am, Chuck van der Linden wrote: > > > > > If Z's approach below doesn't work (first thing I would have > > > > > suggested) you could also try something along these lines (especially > > > > > the first one if you know that a single cell should contain just that > > > > > text and nothing more) > > > > > > if browser.table(:id, "dataTableBody").cell(:text, "146173").exists? > > > > > or > > > > > if browser.table(:id, "dataTableBody").row(:text, /146173/).exists? > > > > > > On Sep 15, 1:02 am, Željko Filipin > > > > > wrote: > > > > > > > On Tue, Sep 14, 2010 at 9:58 PM, Watir General > > > > wrote: > > > > > > > 9 if browser.table(:id, "dataTableBody&q
[wtr-general] Re: Trying to test for table data
For this: require 'rubygems' require 'safariwatir' browser = Watir::Safari.new browser.goto("http://www.hurricaneaquasports.com/santee-100.html";) puts browser.table(:id, "Table_01").methods.sort Output: == === =~ [] __id__ __send__ blank? class clone column_count display dup each enum_for eql? equal? extend freeze frozen? hash how id inspect instance_eval instance_exec instance_of? instance_variable_defined? instance_variable_get instance_variable_set instance_variables is_a? kind_of? method methods nil? object_id private_methods protected_methods public_methods respond_to? row_count send singleton_methods tag taint tainted? tap to_a to_enum to_s type untaint what Everything else I get errors... On Sep 15, 1:56 pm, Rajiv Nanduani wrote: > hi do one thing just check this > > puts browser.table(:id, "Table_01").exists? > > wt is output ? > > then check methods > > puts browser.table(:id, "Table_01").methods.sort > > or > > check is table with in frame or not? > if yes > then > > puts browser.frame(:id,"uridvalue").table(:id, "Table_01").text > > > > On Wed, Sep 15, 2010 at 11:18 PM, Watir General wrote: > > For those I get: > > > NoMethodError: undefined method ‘text’ for # > 0x1010edec0> > > at top level in Test for Cell Data Kayaks.rb at line 6 > > > NoMethodError: undefined method ‘html’ for # > 0x1010edec0> > > at top level in Test for Cell Data Kayaks.rb at line 6 > > > Thank you but still nothing. This is strange :/ > > > On Sep 15, 1:31 pm, Rajiv Nanduani > > wrote: > > > hi > > > try this as Z suggested > > > > require 'rubygems' > > > require 'safariwatir' > > > browser = Watir::Safari.new > > > browser.goto("http://www.hurricaneaquasports.com/santee-100.html";) > > > if browser.table(:id, "Table_01").text.include?("33 lbs") > > > puts "Data Verify passed" > > > else > > > puts "Data Verify FAILED. Ouch." > > > end > > > > or > > > > require 'rubygems' > > > require 'safariwatir' > > > browser = Watir::Safari.new > > > browser.goto("http://www.hurricaneaquasports.com/santee-100.html";) > > > if browser.table(:id, "Table_01").html.include?("33 lbs") > > > puts "Data Verify passed" > > > else > > > puts "Data Verify FAILED. Ouch." > > > end > > > > On Wed, Sep 15, 2010 at 10:52 PM, Watir General > > wrote: > > > > I appreciate everyone's input! :) however I still get > > > > NoMethodErrors... > > > > > I have a similar version of the script I'm trying to create here for > > > > just some random website with table data: > > > > > require 'rubygems' > > > > require 'safariwatir' > > > > browser = Watir::Safari.new > > > > browser.goto("http://www.hurricaneaquasports.com/santee-100.html";) > > > > if browser.table(:id, "Table_01").cell(:text, "33 lbs").exists? > > > > puts "Data Verify passed" > > > > else > > > > puts "Data Verify FAILED. Ouch." > > > > end > > > > > When I run that I get this. > > > > _____ > > > > NoMethodError: undefined method ‘cell’ for # > > > 0x1010ede48> > > > > > at top level in Test for Cell Data.rb at line 6 > > > > _ > > > > > any thoughts? > > > > > On Sep 15, 11:41 am, Chuck van der Linden wrote: > > > > > If Z's approach below doesn't work (first thing I would have > > > > > suggested) you could also try something along these lines (especially > > > > > the first one if you know that a single cell should contain just that > > > > > text and nothing more) > > > > > > if browser.table(:id, "dataTableBody").cell(:text, "146173").exists? > > > > > or > > > > > if browser.table(:id, "dataTableBody").row(:text, /146173/).exists? > > > > > > On Sep 15, 1:02 am, Željko Filipin > > > > > wrote: > > > > > > > On Tue, Sep 14, 2010 at 9:58 PM, Watir General > > > > wrote: > > > > > > > 9 if browser.table(:id, "dataTableBody&q
[wtr-general] Re: Trying to test for table data
Watir? 1.6.5 OS? OSX 10.6.4 Browser? Safari 5.0.2 Ruby? 1.8.7 On Sep 16, 4:32 am, Željko Filipin wrote: > What version of Watir are you using? OS? Browser? Ruby? Rubygems? > > Ž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
[wtr-general] Re: Trying to test for table data
^ Rubygems? 1.3.5 On Sep 16, 9:42 am, Watir General wrote: > Watir? 1.6.5 > > OS? OSX 10.6.4 > > Browser? Safari 5.0.2 > > Ruby? 1.8.7 > > On Sep 16, 4:32 am, Željko Filipin > wrote: > > > What version of Watir are you using? OS? Browser? Ruby? Rubygems? > > > Ž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
[wtr-general] how to install prev versions of watir
so, i had to spin up a new vm for some regression tests and went through the normal installation process using gem install watir and behold we now have the wonderful version 6... unfortunately nothing seems to work in my scripts now, watir-webdriver is depracated, doesn't know what Time is, the list no doubt goes on, anyway what I'm hoping to find out is how to install the previous version of watir so i can continue using watir-webdriver. I intend getting everything upgraded in the future but as many of you will no doubt appreciate "now is not the time". does anyone out there know how i can install a previous version of watir so i can continue to use watir-webdriver? thanks in advance, G -- -- 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: how to install prev versions of watir
great thanks, btw running watir returns the following message so i assume it's on the cards: C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:135:in `require': `require "watir-webdriver"` is deprecated. Please, use `require "watir"`. Have found a workaround for Time.now which is great but also found that watir-scroll doesn't appear to work. I reckon I'll wait a couple of months and wait for things to catch up ;-) Thanks again On Tuesday, 15 November 2016 15:33:27 UTC, Raja gopalan wrote: > > Hi, watir-webdriver is not deprecated, watir-classic is deprecated. If you > install watir, it automatically install watir-webdriver. > > If you use 'gem list watir' it doesn't display watir-webdriver this time. > But it's default anyway. > > But if you still want to go for old version, then you can do by > > gem install watir -v 5.0.0 > gem install watir-classic > > > > > On Tuesday, November 15, 2016 at 8:33:08 PM UTC+5:30, gary wrote: >> >> so, i had to spin up a new vm for some regression tests and went through >> the normal installation process using gem install watir and behold we now >> have the wonderful version 6... unfortunately nothing seems to work in my >> scripts now, watir-webdriver is depracated, doesn't know what Time is, the >> list no doubt goes on, anyway what I'm hoping to find out is how to install >> the previous version of watir so i can continue using watir-webdriver. I >> intend getting everything upgraded in the future but as many of you will no >> doubt appreciate "now is not the time". does anyone out there know how i >> can install a previous version of watir so i can continue to use >> watir-webdriver? thanks in advance, G >> > -- -- 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: how to install prev versions of watir
awesome, thanks On Tuesday, 15 November 2016 15:44:13 UTC, Titus Fortner wrote: > > The watir-webdriver gem is also deprecated. > Use watir > 6.0 (which is based on the watir-webdriver code) > > The latest version of Watir attempts to use monotomic time where supported > and it looks like we grabbed the wrong Time class for where it is not > supported. > > I just updated and pushed the fix to 6.0.2. You should be able to just > bundle update now. > > Titus > > On Tuesday, November 15, 2016 at 3:33:27 PM UTC, Raja gopalan wrote: >> >> Hi, watir-webdriver is not deprecated, watir-classic is deprecated. If >> you install watir, it automatically install watir-webdriver. >> >> If you use 'gem list watir' it doesn't display watir-webdriver this time. >> But it's default anyway. >> >> But if you still want to go for old version, then you can do by >> >> gem install watir -v 5.0.0 >> gem install watir-classic >> >> >> >> >> On Tuesday, November 15, 2016 at 8:33:08 PM UTC+5:30, gary wrote: >>> >>> so, i had to spin up a new vm for some regression tests and went through >>> the normal installation process using gem install watir and behold we now >>> have the wonderful version 6... unfortunately nothing seems to work in my >>> scripts now, watir-webdriver is depracated, doesn't know what Time is, the >>> list no doubt goes on, anyway what I'm hoping to find out is how to install >>> the previous version of watir so i can continue using watir-webdriver. I >>> intend getting everything upgraded in the future but as many of you will no >>> doubt appreciate "now is not the time". does anyone out there know how i >>> can install a previous version of watir so i can continue to use >>> watir-webdriver? thanks in advance, G >>> >> -- -- 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: how to install prev versions of watir
will do thanks On Wednesday, 16 November 2016 15:48:20 UTC, Titus Fortner wrote: > > File a bug on watir-scroll. Alex just needs to switch reference from > watir-webdriver to watir. -- -- 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] browser closing on error
hi again, I'm now running on the latest for everything, with thanks to Titus and Alex. Ruby 2.6.8 & watir v6. I have noticed that whenever my scripts error the browser now closes automajically. This is handy if I'm running multiple scripts over night for example (even though I had a way to deal with that) but it makes it tricky on script creation. If I run a script which fails part way through lets say on an object which is missing. I would usually be on the correct page so can easily identify the missing object, update my script, re run, and carry on. Now the browser closes so I then have to navigate to the same page outside of my script which can take quite a while, especially when creating new scripts. Is there a way to allow the script to fail but keep the browser open where the script ended? Regards, G -- -- 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.
Re: [wtr-general] browser closing on error
Thanks for your reply Titus, unfortunately that didn't quite work require 'watir' caps = Selenium::WebDriver::Capabilities.chrome(chrome_options: {detach: true}) @b = Watir::Browser.new :chrome, desired_capabilities: caps @b.goto('www.google.co.uk') :in `': uninitialized constant Selenium::WebDriver::Capabilities (NameError) but knowing that it's controlled by the chromedriver has given me an option to run scripts in firefox which doesn't close, thanks again, G On Wednesday, 23 November 2016 15:18:31 UTC, Titus Fortner wrote: > > You can pass in a chrome_option for detach: true - > https://sites.google.com/a/chromium.org/chromedriver/capabilities > > caps = Selenium::WebDriver::Capabilities.chrome(chrome_options: {detach: > true}) > Watir::Browser.new :chrome, desired_capabilities: caps > > When the code exits it sends the command to kill the chromedriver process. > If with detatch == true it doesn't force all Chrome browsers opened by that > driver to also close. They will of course close if you have your code set > to execute `browser.close`. > > On Wed, Nov 23, 2016 at 8:04 AM, 'gary' via Watir General < > watir-...@googlegroups.com > wrote: > >> hi again, >> I'm now running on the latest for everything, with thanks to Titus and >> Alex. Ruby 2.6.8 & watir v6. >> I have noticed that whenever my scripts error the browser now closes >> automajically. This is handy if I'm running multiple scripts over night for >> example (even though I had a way to deal with that) but it makes it tricky >> on script creation. >> If I run a script which fails part way through lets say on an object >> which is missing. I would usually be on the correct page so can easily >> identify the missing object, update my script, re run, and carry on. Now >> the browser closes so I then have to navigate to the same page outside of >> my script which can take quite a while, especially when creating new >> scripts. >> Is there a way to allow the script to fail but keep the browser open >> where the script ended? >> >> Regards, >> G >> >> -- >> -- >> Before posting, please read http://watir.com/support. In short: search >> before you ask, be nice. >> >> watir-...@googlegroups.com >> http://groups.google.com/group/watir-general >> watir-genera...@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-genera...@googlegroups.com . >> For more options, visit https://groups.google.com/d/optout. >> > > -- -- 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.
Re: [wtr-general] browser closing on error
works a treat Titus, thanks again. G On Thursday, 24 November 2016 13:52:32 UTC, Titus Fortner wrote: > > Sorry, that needs to be Selenium::WebDriver::Remote::Capabilities. Forgot > the remote piece. -- -- 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: Couldn't start the mozilla using WATIR 6.0.2
is it the latest geckodriver and the latest v. of firefox? On Friday, 25 November 2016 16:28:43 UTC, Raja gopalan wrote: > > I have written the following code >> >> >> require 'watir' >> b=Watir::Browser.new :firefox >> >> b.goto 'www.google.com' > > > It opens the firefox but it's not entering url there, it's waiting for > some time and it's throws the following error > >> >> C:/Ruby23/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.0.1/lib/selenium/webdriver/remote/response.rb:69:in >> >> `assert_ok': Missing 'marionetteProtocol' field in handshake >> (Selenium::WebDriver::Error::UnknownError) > > > The same code works for Chrome. Can anyone help me to figure out the > problem? > -- -- 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] .exists? visible? and .present?
A question which i've found cropping up in a few places and at times appears controversial, not sure why, but i'm also struggling to find an answer for, and in the absence of an answer how does anybody else do this. To put it simply how to confirm if an element is in the users viewport, not if it exists on the page but can the user see it? The previous incarnation of webdriver in firefox would return an element is not clickable type message if you tried to click an item which was off the bottom of the page, meaning i'd use watir-scroll to interact with it. That indicates to me that somehow, somewhere there is a way to identify it, or there used to be? The latest versions of the drivers mean that chrome and firefox both don't seem to care and will just click it anyway. Ideally i'd be using this in conjuction with chromes mobile_emulation so i need to be able to identify if in mobile view, certain elements are in view. Any thoughts and ideas as usual would be greatly appreciated. Cheers, G -- -- 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.
Re: [wtr-general] Re: can you run the scripts on Win10\ chrome? Used to be working a while ago
Sometimes the driver and gem get out of whack. Also, Chrome auto-updates. So 3 things, Ruby gems, webdriver binary and the browser platform/version (Nobody expects the Spanish Inquisition.) Selenium-webdriver 3.13.0 was only released 2 days ago. You want to look at all of those. If you're not using a Gemfile you may want to consider adding one to lock down the gem versions you're using (and make a note of the known good version of the webdriver executable you want to use with them.) To even further lock things down you *could* disable the Chrome browser auto-update, but of course that'd mean that you aren't always testing with the latest browser ver. One other thing that sometimes causes problems is that you can have multiple, stale sessions running if you don't exit cleanly, which can interfere with getting a driver connection. I'm not sure exactly what error you get back for that, may not be this one. If it's happening on multiple systems that's not it. On Thursday, June 28, 2018 at 5:53:25 AM UTC-7, christina wrote: > > This is the error > > c:\automation>ruby try.rb > C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/selenium-webdriver-3.13.0/lib/selenium/webdriver/common/service.rb:142:in > > `connect_until_stable': unable to connect to chromedriver 127.0.0.1:9515 > (Selenium::WebDriver::Error::WebDriverError) > from > C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/selenium-webdriver-3.13.0/lib/selenium/webdriver/common/service.rb:72:in > > `block in start' > from > C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/selenium-webdriver-3.13.0/lib/selenium/webdriver/common/socket_lock.rb:39:in > > `locked' > from > C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/selenium-webdriver-3.13.0/lib/selenium/webdriver/common/service.rb:69:in > > `start' > from > C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/selenium-webdriver-3.13.0/lib/selenium/webdriver/chrome/driver.rb:43:in > > `initialize' > from > C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/selenium-webdriver-3.13.0/lib/selenium/webdriver/common/driver.rb:44:in > > `new' > from > C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/selenium-webdriver-3.13.0/lib/selenium/webdriver/common/driver.rb:44:in > > `for' > from > C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/selenium-webdriver-3.13.0/lib/selenium/webdriver.rb:86:in > > `for' > from > C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/watir-6.11.0/lib/watir/browser.rb:48:in > > `initialize' > from try.rb:7:in `new' > from try.rb:7:in `' > > On Thu, Jun 28, 2018 at 8:46 AM, c w > > wrote: > >> Please tell me what ruby version you use. >> >> I upgraded the webdriver well all gems but I still get the error. >> >> I have no idea what to do in order to run on chrome. >> >> C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/selenium-webdriver-3.13.0/lib/selenium/webdriver/common/service.rb:142:in >> >> `connect_until_stable': unable to connect to chromedriver 127.0.0.1:9515 >> (Selenium::WebDriver::Error::WebDriverError) >> from >> C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/selenium-webdriver-3.13.0/lib/selenium/webdriver/common/service.rb:72:in >> >> `block in start' >> from >> C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/selenium-webdriver-3.13.0/lib/selenium/webdriver/common/socket_lock.rb:39:in >> >> `locked' >> from >> C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/selenium-webdriver-3.13.0/lib/selenium/webdriver/common/service.rb:69:in >> >> `start' >> >> On Thu, Jun 28, 2018 at 1:36 AM, Justin Ko > > wrote: >> >>> The question regarding Chrom is still valid. Can anyone drive the chrome >>>> and goto an url on win 10? >>>> >>> >>> Chrome works for me on Windows 10 Pro using: >>> - Watir 6.11 >>> - Selenium-WebDriver 3.13 >>> - Chrome 67 >>> - Chromedriver 2.4 >>> >>> Justin >>> >>> -- >>> -- >>> Before posting, please read >>> https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group. >>> >>> >>> In short: search before you ask, be nice. >>> >>> watir-...@googlegroups.com >>> http://groups.google.com/group/watir-general >>> watir-genera...@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, sen
[wtr-general] has anyone experience with executing javascript and extracting datalayer?
hi, I'm having trouble converting some selenium scripts to watir, lol please don't ask me why, anyway, the basic selenium script below works a treat: require 'selenium-webdriver' $b=Selenium::WebDriver.for :chrome $b.get'mywebsite' # click cookie message overlay sleep(3) $b.find_element(:xpath=>"//*[@id='continue']").click puts $b.execute_script("return dataLayer;") the watir equivalent appears to fail: require 'watir' $b = Watir::Browser.new :chrome $b.goto('mywebsite') # click cookie message overlay sleep(3) $b.link(id: 'continue').click puts $b.execute_script("return dataLayer;") returning the following error: stale element reference: element is not attached to the page document (Selenium::WebDriver::Error::StaleElementReferenceError) does anyone know of a workaround for this or any ideas as to how to extract the relevant data? Regards, G -- -- Before posting, please read https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group. 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.
Re: [wtr-general] has anyone experience with executing javascript and extracting datalayer?
stale element reference: element is not attached to the page document (Session info: chrome=69.0.3497.100) (Driver info: chromedriver=2.37.544315 (730aa6a5fdba159ac9f4c1e8cbc59bf1b5ce12b7),platform=Windows NT 10.0.17134 x86_64) C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.0.1/lib/selenium/webdriver/remote/response.rb:69:in `assert_ok' C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.0.1/lib/selenium/webdriver/remote/response.rb:32:in `initialize' C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.0.1/lib/selenium/webdriver/remote/http/common.rb:81:in `new' C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.0.1/lib/selenium/webdriver/remote/http/common.rb:81:in `create_response' C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.0.1/lib/selenium/webdriver/remote/http/default.rb:86:in `request' C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.0.1/lib/selenium/webdriver/remote/http/common.rb:59:in `call' C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.0.1/lib/selenium/webdriver/remote/bridge.rb:653:in `raw_execute' C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.0.1/lib/selenium/webdriver/remote/bridge.rb:631:in `execute' C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.0.1/lib/selenium/webdriver/remote/bridge.rb:537:in `element_tag_name' C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.0.1/lib/selenium/webdriver/common/element.rb:88:in `tag_name' C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/watir-6.0.2/lib/watir/browser.rb:343:in `wrap_element' C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/watir-6.0.2/lib/watir/browser.rb:330:in `wrap_elements_in' C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/watir-6.0.2/lib/watir/browser.rb:334:in `block in wrap_elements_in' C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/watir-6.0.2/lib/watir/browser.rb:334:in `each' C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/watir-6.0.2/lib/watir/browser.rb:334:in `wrap_elements_in' C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/watir-6.0.2/lib/watir/browser.rb:332:in `block in wrap_elements_in' C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/watir-6.0.2/lib/watir/browser.rb:332:in `map' C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/watir-6.0.2/lib/watir/browser.rb:332:in `wrap_elements_in' C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/watir-6.0.2/lib/watir/browser.rb:261:in `execute_script' C:/temp/test1.rb:13:in `' On Wednesday, 3 October 2018 15:13:57 UTC+1, Titus Fortner wrote: > > Hmm, it should be really difficult to get that exception in watir. Can you > provide a stack trace? > > > On Wed, Oct 3, 2018, 3:41 AM 'gary' via Watir General < > watir-...@googlegroups.com > wrote: > >> hi, >> >> I'm having trouble converting some selenium scripts to watir, lol please >> don't ask me why, anyway, the basic selenium script below works a treat: >> >> require 'selenium-webdriver' >> $b=Selenium::WebDriver.for :chrome >> $b.get'mywebsite' >> # click cookie message overlay >> sleep(3) >> $b.find_element(:xpath=>"//*[@id='continue']").click >> puts $b.execute_script("return dataLayer;") >> >> >> the watir equivalent appears to fail: >> >> require 'watir' >> $b = Watir::Browser.new :chrome >> $b.goto('mywebsite') >> # click cookie message overlay >> sleep(3) >> $b.link(id: 'continue').click >> puts $b.execute_script("return dataLayer;") >> >> returning the following error: >> >> stale element reference: element is not attached to the page document >> (Selenium::WebDriver::Error::StaleElementReferenceError) >> >> >> does anyone know of a workaround for this or any ideas as to how to >> extract the relevant data? >> >> Regards, >> >> G >> >> -- >> -- >> Before posting, please read >> https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group. >> >> >> In short: search before you ask, be nice. >> >> watir-...@googlegroups.com >> http://groups.google.com/group/watir-general >> watir-genera...@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-genera...@googlegroups.com . >> For more options, visit https://groups.google.com/d/optout. >> > -- -- Before posting, please read https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group. 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.
Re: [wtr-general] has anyone experience with executing javascript and extracting datalayer?
>> `tag_name' >>> C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/watir-6.0.2/lib/watir/browser.rb:343:in >>> >>> `wrap_element' >>> C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/watir-6.0.2/lib/watir/browser.rb:330:in >>> >>> `wrap_elements_in' >>> C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/watir-6.0.2/lib/watir/browser.rb:334:in >>> >>> `block in wrap_elements_in' >>> C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/watir-6.0.2/lib/watir/browser.rb:334:in >>> >>> `each' >>> C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/watir-6.0.2/lib/watir/browser.rb:334:in >>> >>> `wrap_elements_in' >>> C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/watir-6.0.2/lib/watir/browser.rb:332:in >>> >>> `block in wrap_elements_in' >>> C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/watir-6.0.2/lib/watir/browser.rb:332:in >>> >>> `map' >>> C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/watir-6.0.2/lib/watir/browser.rb:332:in >>> >>> `wrap_elements_in' >>> C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/watir-6.0.2/lib/watir/browser.rb:261:in >>> >>> `execute_script' >>> C:/temp/test1.rb:13:in `' >>> >>> On Wednesday, 3 October 2018 15:13:57 UTC+1, Titus Fortner wrote: >>>> >>>> Hmm, it should be really difficult to get that exception in watir. Can >>>> you provide a stack trace? >>>> >>>> >>>> On Wed, Oct 3, 2018, 3:41 AM 'gary' via Watir General < >>>> watir-...@googlegroups.com> wrote: >>>> >>>>> hi, >>>>> >>>>> I'm having trouble converting some selenium scripts to watir, lol >>>>> please don't ask me why, anyway, the basic selenium script below works a >>>>> treat: >>>>> >>>>> require 'selenium-webdriver' >>>>> $b=Selenium::WebDriver.for :chrome >>>>> $b.get'mywebsite' >>>>> # click cookie message overlay >>>>> sleep(3) >>>>> $b.find_element(:xpath=>"//*[@id='continue']").click >>>>> puts $b.execute_script("return dataLayer;") >>>>> >>>>> >>>>> the watir equivalent appears to fail: >>>>> >>>>> require 'watir' >>>>> $b = Watir::Browser.new :chrome >>>>> $b.goto('mywebsite') >>>>> # click cookie message overlay >>>>> sleep(3) >>>>> $b.link(id: 'continue').click >>>>> puts $b.execute_script("return dataLayer;") >>>>> >>>>> returning the following error: >>>>> >>>>> stale element reference: element is not attached to the page document >>>>> (Selenium::WebDriver::Error::StaleElementReferenceError) >>>>> >>>>> >>>>> does anyone know of a workaround for this or any ideas as to how to >>>>> extract the relevant data? >>>>> >>>>> Regards, >>>>> >>>>> G >>>>> >>>>> -- >>>>> -- >>>>> Before posting, please read >>>>> https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group. >>>>> >>>>> >>>>> In short: search before you ask, be nice. >>>>> >>>>> watir-...@googlegroups.com >>>>> http://groups.google.com/group/watir-general >>>>> watir-genera...@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-genera...@googlegroups.com. >>>>> For more options, visit https://groups.google.com/d/optout. >>>>> >>>> -- >> -- >> Before posting, please read >> https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group. >> >> >> In short: search before you ask, be nice. >> >> watir-...@googlegroups.com >> http://groups.google.com/group/watir-general >> watir-genera...@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-genera...@googlegroups.com . >> For more options, visit https://groups.google.com/d/optout. >> > -- -- Before posting, please read https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group. 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] How to keep the Watir browser run on the backend?
Experts Each time when use .goto or open a new tab, the browser window will lump to the frontend of the screen. How to keep the Watir browser run on the backend, so that will not interrupt other works Thanks -- -- Before posting, please read https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group. 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: How to keep the Watir browser run on the backend?
No. This works as the very beginning, but the browser sill jumps into the front of the screen as soon as it's loading.. 在 2019年4月11日星期四 UTC+8上午9:27:21,NaviHan写道: > > args = ['--window-position=-3000,0'] > browser = Watir::Browser.new :chrome, options: {args: args} > > Doesnt work either. > > Can the OP confirm if it works for him? > > On Wednesday, 10 April 2019 22:42:13 UTC+10, watirQ wrote: >> >> Experts >> >> Each time when use .goto or open a new tab, the browser window will lump >> to the frontend of the screen. How to keep the Watir browser run on the >> backend, so that will not interrupt other works >> >> Thanks >> > -- -- Before posting, please read https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group. 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.
Re: [wtr-general] error with new firefox
Someone may have a better idea but I think I've seen something like this in the past and rebooting and/or reinstalling selenium sorted it out. I haven't used FF v29 yet From: gary To: watir-general@googlegroups.com Sent: Wednesday, May 7, 2014 2:43 AM Subject: [wtr-general] error with new firefox hi, has anyone experienced errors with the latest version of firefox (29.0)? basic script extract below used to work: require 'watir-webdriver' @b = Watir::Browser.new @b.goto('www.google.co.uk') but unfortunately now returns: C:/Ruby200/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.37.0/lib/selenium/webdriver/firefox/launcher.rb:79:in `connect_until_stable': unable to obtain stable firefox connection in 60 seconds (127.0.0.1:7055) (Selenium::WebDriver::Error::WebDriverError) from C:/Ruby200/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.37.0/lib/selenium/webdriver/firefox/launcher.rb:37:in `block in launch' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.37.0/lib/selenium/webdriver/firefox/socket_lock.rb:20:in `locked' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.37.0/lib/selenium/webdriver/firefox/launcher.rb:32:in `launch' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.37.0/lib/selenium/webdriver/firefox/bridge.rb:24:in `initialize' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.37.0/lib/selenium/webdriver/common/driver.rb:31:in `new' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.37.0/lib/selenium/webdriver/common/driver.rb:31:in `for' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.37.0/lib/selenium/webdriver.rb:67:in `for' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/watir-webdriver-0.6.4/lib/watir-webdriver/browser.rb:46:in `initialize' Any ideas anyone? -- -- 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. -- -- 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.
Re: [wtr-general] How to handle unknown browser popup with text "Stop running this script?"
+1 for treating it as an application bug rather then a problem with Watir. It's likely the reason that browser.alert.exist? isn't working is that the browser isn't responsive. The developers should look at fixing whatever's causing that popup to show up. You might have some luck using a different browser in the meantime (if that's an option.) ____ From: Joe Fleck To: "watir-general@googlegroups com" Sent: Friday, May 23, 2014 4:41 AM Subject: Re: [wtr-general] How to handle unknown browser popup with text "Stop running this script?" Hi, I have seen this particular error in our application when we try and load large lists. I can not remember what the resolution was but it is something that needs attention by dev team. Thank you, Joe On May 23, 2014 3:10 AM, "v b baba kanchustambham" wrote: Hi, > >We are facing a challenge with an unknown browser popup with text "Stop >running this script?" while running watir-webdriver script on IE8, Win7 >machine. >This popup is appearing after running the script for some time. >browser.alert.exist? method is not working in this case. we have declared >require 'watir-webdriver/extensions/alerts' in library file. Please find the >attached screenshot for reference. >Webdriver version we are using is 0.6.2 > >Can anyone help us on resolving this issue. > >Regards, >Veera. > > > -- >-- >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. > -- -- 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. -- -- 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.
Re: [wtr-general] Re: Get the link to the Next Page
Something like this should work, although it'd be better to restrict the # of links to be checked rather than iterating through all of them link = b.links.find {|link| link.href =~ /Page\$\d+/}link.href.match( /Page\$\(d+)/)[1] # assumes link is actually found From: Joe Fleck To: Watir General Sent: Thursday, October 23, 2014 11:15 AM Subject: Re: [wtr-general] Re: Get the link to the Next Page Can you provide the full html so we can get a better idea what you are trying to do? Joe On Thu, Oct 23, 2014 at 2:03 PM, Genexodus wrote: You description is pretty vague. However, you could do this pretty easy with .link(:text, "2").click Replace 2 with 3 and so on. Should work as they are recognized in the browser and by WATIR as links. On Friday, August 1, 2014 10:31:02 PM UTC-6, Ali SB wrote: Hi all I want to click on different pages in :"http://periodicdisclosures.aec.gov.au/SummaryParty.aspx"element inspect is : href="javascript:__doPostBack('ctl00$ContentPlaceHolderBody$gridViewReturns','Page$1')"how can I Check if there is a link with the next page number?And then click on the link to go for next page?. Cheers -- -- 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. -- -- 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. -- -- 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.
Re: [wtr-general] Problem with Logger and condition if/else Watir | Testwise
Think you need this if @browser.text.include?("Signed in!") == true # Something...elseend Think there's more than one spreadsheet library but you should be able to query the spreadsheet object for the number of of rows that it has (take a look at the rdocs for it.) Then you could do something like spreadsheet.rows.each do # Something ...end And there should be a way of omitting the header row or you could do something like spreadsheet.rows.to_a[1..-1] to get a collection of rows without the header (don't know if to_a would be necessary) From: Mohan MK To: watir-general@googlegroups.com Sent: Thursday, December 18, 2014 4:17 AM Subject: [wtr-general] Problem with Logger and condition if/else Watir | Testwise Hi All, In below code I am trying to iterate 2 loops of data from data sheet one positive and one negative scenario and using “logger” to log “PASS” and “FAIL”. Problem I am facing are 1. When I run the script with negative “say invalid password” the script stops at line marked in Red bold “if @browser.text.include?("Signed in!").should then” Login with Data file Login with Datafile Failure/Error: if @browser.text.include?("Signed in!").should == true then expected: true got: false (using ==) I don’t want the script to stop, it should log as “FAIL” and continue with next iteration with positive condition. What is that I am doing wrong here also is there better way to handle this? Below is the code I am using 2. Is there a way to get the row count of active spreadsheet instead of hardcoding while @rows <= 2 It would be of great help if someone can answer to abovequestions. Thanks in advance. Code :while @rows <= 2 $log.info("** PAGE URL **") $log.info @browser.url username=@wrksheet.cells(@rows,"A") ['text'] password=@wrksheet.cells(@rows,"B") ['text']assesrtion=@wrksheet.cells(@rows,"c") ['text'] @browser.text_field(:id, "username").set(username) $log.info("** UserName Entered **")$log.info username @browser.text_field(:id, "password").set(password)$log.info("** Password Entered **")$log.info password @browser.button(:value,"Sign in").click if @browser.text.include?("Signed in!").should == true then $log.info "PASS" else $log.info "FAIL" end @rows=@rows+1 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 --- 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. -- -- 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.
Re: [wtr-general] Re: Watir - Identifying a Span ID and its Text Element - False
Another way of checking for text (when you don't care about which particular element is displaying it) is: @browser.text =~ /Welcome/ From: Super Kevy To: watir-general@googlegroups.com Sent: Friday, January 2, 2015 6:38 AM Subject: [wtr-general] Re: Watir - Identifying a Span ID and its Text Element - False puts @browser.span(:id,'lblTitleHolder').text.to_s puts @browser.span(:id,'lblTitleHolder').text.include?('Welcome').to_s puts @browser.html.include?('Welcome').to_s On Friday, December 26, 2014 4:15:19 PM UTC-6, Ma St wrote: I have reviewed many posts, but am unable to get passed this. I am basically trying to verify if the text on the web page is displayed. The text is "Welcome" under a span id element. It is not clear what the syntax should be when referencing the text under the span id. I get an error that reads that it cannot find my element. Is there a special format I should follow? I am new to Watir and struggling to find documentation on how to identify elements. I find the documentation, but when I put into practice, I get this error. Thanks. Error:"#"content- holders", :tag_name=>"div"}>" HTML: Welcome My Ruby File:p @browser.driver.current_urlmark = @browser.div(:id => "content-holders") -- -- 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. -- -- 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.
Re: [wtr-general] Undefined method 'goto' for RSpec::Core::ExampleGroup using Watir-Rspec
It's just saying that RSpec doesn't have a goto method. Try calling that on @browser From: trekr5 To: watir-general@googlegroups.com Sent: Monday, January 12, 2015 4:52 AM Subject: [wtr-general] Undefined method 'goto' for RSpec::Core::ExampleGroup using Watir-Rspec Hi, I'm a new user to Watir and am attempting to use it with RSpec and a Chrome browser:- This is the error message I get when I run rspec spec/views/index.erb_spec.rb: C:\git\GG.Infra.UserManager>rspec spec/views/index.erb_spec.rbffi-yajl/json_gem is deprecated, these monkeypatches will be dropped shortly GGInfraUserManager←[31m initial page has username text box (FAILED - 1)←[0m Failures: 1) GGInfraUserManager initial page has username text box ←[31mFailure/Error:←[0m ←[31mbefore { goto "http://localhost:9090/"; }←[0m ←[31mNoMethodError←[0m: ←[31mundefined method `goto' for #←[0m←[36m # ./spec/views/index.erb_spec.rb:9:in `block (2 levels) in '←[0m Finished in 0.04203 seconds←[31m1 example, 1 failure←[0m and this is my index.erb_spec.rb require 'spec_helper' require "watir" browser = Watir::Browser.new :chrome describe "GGInfraUserManager" do before { goto "http://localhost:9090/"; } it "initial page has username text box" do text_field(:username => "bunny").should be_present end end This is within the configure block in spec_helper.rb RSpec.configure do |config| config.before :all do @browser = Watir::Browser.new end config.after :all do @browser.close if @browser end ...end Gems loaded:watir (5.0.0 x86-mingw32)watir-classic (4.0.1)watir-rspec (1.1.2)watir-webdriver (0.6.11) rspec (3.1.0, 2.99.0)rspec-core (2.99.2)rspec-expectations (2.99.2)rspec-mocks (3.1.3, 2.99.2)rspec-support (3.1.2, 3.1.0) I have also copied the chrome driver (for the chrome browser) to the Ruby path. Can you tell me how I can fix this error? Many 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. -- -- 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.
Re: [wtr-general] Re: verify if checkbox is checked
Maybe something like this would work in determining the checkbox state b.span(:text, 'Dependent to an existing member?').parent.html =~ /custom-checkbox checked/ From: "jackstaposit...@gmail.com" To: watir-general@googlegroups.com Sent: Tuesday, January 27, 2015 7:02 PM Subject: [wtr-general] Re: verify if checkbox is checked HI Super Kevy, Thanks for the suggestions.. Unfortunately, the set? and checked? do no work.the checkbox ( does not have any other ids or names on it.. the checkbox is placed as a child to a label control which has all the attributes, where one is the -- now, this one changes to when the checkbox is checked. On Wednesday, January 28, 2015 at 3:50:04 AM UTC+8, Super Kevy wrote: Set/Clear .set? Returns true if the element is checked. alias .checked?.clear Will clear the check. @browser.checkbox(:id,' sampleId').set? if @browser.checkbox(:id=>" sampleId").attribute_value(' class') == "custom-checkbox checked" then puts 'hello' end myCheckedCheckboxes = @browser.checkboxes(:class,' custom-checkbox checked') On Tuesday, January 27, 2015 at 2:17:59 AM UTC-6, jacksta...@gmail.com wrote: hi! can anyone help me with this one? got something like this: Dependent to an existing member? I have a method in ruby for checking the checkbox which works. Now on another method, I want to access/see whether the checkbox is checked, if yes, I will do something. checkbox :dependent_checkbox, xpath: '//label[@class="custom- checkbox"][contains(@data- bind, "css: { checked: isDependent()")]/input[@type=" checkbox"]' def fill_up_form if checkbox is checked fill-up form end end in irb, the checkbox.exists? returns true so I know that the element is in the page. but thing is even if I check or uncheck the checkbox, the checkbox.checked? always returns false. another info is, the label class is "custom-checkbox" when unchecked, then becomes "custom-checkbox checked" when checked. -- -- 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. -- -- 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] Watir Job in SF
Hi all, My company (Recurly) is looking for a QA engineer with Ruby experience to join and help with manual testing and support an existing automation effort. We're using Watir and RSpec. The position will involve a lot of scripting and we'll be looking for someone with good Ruby programming skills. Job description is below. If you're interested, please submit a resume via the website (better not to post back to the group directly.) Thanks John Join Our Team | Jobs | Recurly} | | | | | | | | | | | Join Our Team | Jobs | Recurly}Join the Recurly team. Apply to one of our open positions today. | | | | View on recurly.com | Preview by Yahoo | | | | | -- -- 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.
Re: [wtr-general] Re: Did a Firefox update just break Watir Webdriver?
v28 has been working well for me. Minor snag closing browser windows manually on OS X but closing programmatically works fine. From: Željko Filipin To: watir Sent: Tuesday, March 3, 2015 1:01 AM Subject: Re: [wtr-general] Re: Did a Firefox update just break Watir Webdriver? On Tue, Mar 3, 2015 at 9:44 AM, Chuck van der Linden wrote: finding older regular FF releases can be, um, fun https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/ Ž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 --- 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. -- -- 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.
Re: [wtr-general] unable to click link
I think cancel needs to be in quotes unless that's a variable you're using but didn't mention. Maybe try going through the parent element to get to the link if that's not it $browser.div(:class, 'container').button(:class, 'cancel').click From: rocky To: watir-general@googlegroups.com Sent: Tuesday, May 26, 2015 7:12 AM Subject: [wtr-general] unable to click link Hi All, i am unable to click link using below html attribute, SaveCancel code: $browser.button(:class,cancel).click Kindly help me... Thanks and regards,Siddu.-- -- 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. -- -- 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.
Re: [wtr-general] unable to click link
Oh, wait! Cancel is a link From: 'John Fitisoff' via Watir General To: "watir-general@googlegroups.com" Sent: Tuesday, May 26, 2015 7:31 AM Subject: Re: [wtr-general] unable to click link I think cancel needs to be in quotes unless that's a variable you're using but didn't mention. Maybe try going through the parent element to get to the link if that's not it $browser.div(:class, 'container').button(:class, 'cancel').click From: rocky To: watir-general@googlegroups.com Sent: Tuesday, May 26, 2015 7:12 AM Subject: [wtr-general] unable to click link Hi All, i am unable to click link using below html attribute, SaveCancel code: $browser.button(:class,cancel).click Kindly help me... Thanks and regards,Siddu.-- -- 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. -- -- 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. -- -- 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.
Re: [wtr-general] Code suggestions on how to get a guid from an href to be used to append to other hrefs.
Use a regular expression. Assuming that the URL is "http://www.mysite.com/client/abcde012345": browser.url.match(%r{/client/(.*)})[1] => "abcde012345" From: Lorraine Botros To: watir-general@googlegroups.com Sent: Tuesday, June 16, 2015 4:24 PM Subject: [wtr-general] Code suggestions on how to get a guid from an href to be used to append to other hrefs. The site I am automating creates a unique guid when a new client is created so I will see something like http://www.mysite.com/client/abcde012345 where 'abcde012345 is the unique identifier for that client. I want to get that value and use it to append to another link such as http://www.mysite.com/client/profile/abcde012345 I am a newbie to coding so any help or suggestions on good sites to find examples is greatly 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 --- 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. -- -- 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.
Re: [wtr-general] How can I get all the content in a div element then strip out a table element leaving only what elements I want?
Not sure if this fits your problem, but one approach would be to look at the output of b.div(:id, 'contents').text. It may be possible to use regexp matching to get the text leading up to the div and then the text after, without having to worry specifically about what element outside the table the text is stored in. For example, maybe the table has a static header row and you know that the first 2 column row names are going to be foo and bar. You could then write a regexp to get the text above the table. And then use a similar strategy to get the text below. Then you don't have to worry about dynamic table updates in between checks for the text values of elements within the div. If you see some reliable pattern marking the beginning and end of the table text then this should work. Alternative idea is to get the enclosing div HTML, use a regexp to strip out the table tags and everything between and then feed the resulting string to Nokogiri for further manipulation (either convert remainder to text or traverse the remaining elements one by one.) Seems sort of low rent but that would definitely work. From: Derek W To: watir-general Sent: Friday, December 4, 2015 1:31 PM Subject: Re: [wtr-general] How can I get all the content in a div element then strip out a table element leaving only what elements I want? What is the context? Are you first getting the div via xpath and storing it in a variable? If so, you can just do a regex using something like this right? "[0-9a-zA-Z<> \/]*<\/table>" If you're trying to do this all in 1 xpath locator, can't you do something like: //div[@id="contents"]//table//text() On Fri, Dec 4, 2015 at 1:17 PM, Super Kevy wrote: How can I get all the content in a div element then strip out a table element leaving only what elements I want? Assume a structure like 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. -- Derek Wrobel 425-243-3355-- -- 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. -- -- 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.
Re: [wtr-general] Time out issue in Watir
Haven't used watir classic in a long time but think .hover should work. You can always bump up the when_present time, it takes an integer argument. the default if you don't specify a time is 30 seconds, which is a really long time, so itmight not be as simple as that. One thing that really helps in these sorts of situations is to install pry, require it in your script and then put a binding.pry statement right before the thing that is failing. Pry will stop at that point in the script and then you can see what's going on right at the point of failure. From: Bhaskar Rai To: Watir General Sent: Tuesday, January 19, 2016 11:58 AM Subject: [wtr-general] Time out issue in Watir Hi,I am new to watir. I am trying to write a script to automate web testing at my work. I would appreciate if anyone can help me out. I am getting time out error(NOT Always) when i execute my script. The script runs successfully sometimes and it does not run successfully sometimes. The script is very simple:- @b.checkbox(:value => '-1') .click @b.link(:class => 'btnView').click#After this step the scripts gets stuck @b.button(:id => 'exitActionButton').when_present.click #@b.button(:id => 'exitActionButton').click (#i have tried this too. It will give me same issue as well) Ruby version: 1.9watir classic Following is the error message /ruby/gems/1.9.1/gems/watir-classic-4.2.0/lib/watir-classic/browser.rb:600:in `sleep': execution expired (Timeout::Error) uby/gems/1.9.1/gems/watir-classic-4.2.0/lib/watir-classic/browser.rb:600:in `block in wait'/ruby/gems/1.9.1/gems/watir-classic-4.2.0/lib/watir-classic/browser.rb:597:in `wait'/ruby/gems/1.9.1/gems/watir-classic-4.2.0/lib/watir-classic/element.rb:168:in `click' #Also, does watir has ability the hover the cursor?-- -- 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. -- -- 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.
Re: [wtr-general] Watir-webdriver throws 'not clickable' error even when element is visible, present
Yeah, that's annoying. Think I filed a Webdriver bug a one point (I wasn't the only one) but not sure if they ever did anything with it. If you don't have to use Chrome, It might be worth trying Firefox. Driver install is not required for that and it's a little less fussy, although think I saw a similar scrolling problem with a recent version. You could also try send_keys to get the browser to scroll up or down conditionally, as needed (you may have to set the focus on a non-editable element before doing the send_keys so that they don't go to some element instead of the browser.) b.send_keys :space # Down one frame. b.send_keys :shift, :space # Up one frame. From: Awesome Possum To: Watir General Sent: Monday, April 18, 2016 7:16 PM Subject: [wtr-general] Watir-webdriver throws 'not clickable' error even when element is visible, present I am trying to automate tests in Ruby using the latest Watir-Webdriver 0.9.1, Selenium-Webdriver 2.53.0 and Chrome extension 2.21. However the website that I am testing has static headers at the top or sometimes static footers at the bottom. Hence since Watir auto-scrolls an element into view before clicking, the elements get hidden under the static header or the static footer. I do not want to set desired_capabitlites (ElementScrollBehavior) to 1 or 0 as the websites I am testing can have both - static header or static footer or both.Hence the question are 1) Why does Watir throw an exception 'Element not clickable' even when the element is visible and present? See ruby code ( I have picked a random company website for an example) and the results below.2) How can I resolve this without resorting to ElementScrollBehaviour? Ruby code: require 'watir-webdriver' browser = Watir::Browser.new :chrome begin # Step 1 browser.goto "shop.coles.com.au/online/mobile/national" # Step 2 - click on 'Full Website' link at the bottom link = browser.link(text: "Full website") #check if link exists, present and visible? puts link.exists? puts link.present? puts link.visible? #click on link link.click rescue => e puts e.inspect ensure sleep 5 end puts browser.url browser.close Result: $ ruby link_not_clickable.rbtrue true trueSelenium::WebDriver::Error::UnknownError: unknown error: Element is not clickable at point (460, 1295). Other element would receive the click: div class="shoppingFooter"...div(Session info: chrome=50.0.2661.75) (Driver info: chromedriver=2.21.371459 (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4),platform=Mac OS X 10.10.5 x86_64)>http://shop.coles.com.au/online/mobile/nationalthanks! -- -- 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. -- -- 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.
Re: [wtr-general] Upload multiple files to input element?
Hi Jesse, What have you tried, what does the HTML look like and what kind of errors are you getting? It could be many things and that info might narrow down the possibilities a bit. John From: "jherzen...@shastaqa.com" To: Watir General Sent: Thursday, May 12, 2016 7:36 PM Subject: [wtr-general] Upload multiple files to input element? Hello everyone I'm having a bit of difficulty trying to automate something that is a fairly standard procedure. There is an input element on the page, that accepts multiple, and I need to upload multiple files to this. I haven't been able to find anything on any of the major forums, so I figured I'd post here and see if any of you know of a solution. Thanks! Cheers,Jesse-- -- 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. -- -- 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.
Re: [wtr-general] Upload multiple files to input element?
Maybe something like this. First thing to try, anyway. Method may take multiple file args, can't remember offhand # http://www.rubydoc.info/gems/watir-webdriver/Watir/FileField × ['path/one.txt', 'path/two.txt'].each do |path| b.file_field(:id, 'some_id').when_present.set(path)end From: "jherzen...@shastaqa.com" To: Watir General Cc: jfitis...@yahoo.com Sent: Friday, May 13, 2016 10:39 AM Subject: Re: [wtr-general] Upload multiple files to input element? It's just a standard input field `` It accepts multiple, I'm just not sure how to do that...I've tried using `input_element.set paths` with the 'paths' variable as the following:```paths = ("/path/to/file/1"; "/path/to/file/2") paths = ["/path/to/file/1", "/path/to/file/2"] paths = "'path/to/file/1', 'path/to/file/2'"``` On Friday, May 13, 2016 at 6:58:33 AM UTC-7, johnssn wrote: Hi Jesse, What have you tried, what does the HTML look like and what kind of errors are you getting? It could be many things and that info might narrow down the possibilities a bit. John From: "jherz...@shastaqa.com" To: Watir General Sent: Thursday, May 12, 2016 7:36 PM Subject: [wtr-general] Upload multiple files to input element? Hello everyone I'm having a bit of difficulty trying to automate something that is a fairly standard procedure. There is an input element on the page, that accepts multiple, and I need to upload multiple files to this. I haven't been able to find anything on any of the major forums, so I figured I'd post here and see if any of you know of a solution. Thanks! Cheers,Jesse-- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-...@googlegroups.com http://groups.google.com/ group/watir-general watir-genera...@ 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-genera...@ googlegroups.com. For more options, visit https://groups.google.com/d/ optout. -- -- 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.
Re: [wtr-general] Re: Upload multiple files to input element?
File fields have security restrictions, not sure if that'll work. Created an HTML page with a file field to poke around, didn't have much luck. Did see something about some workaround using send_keys and ChromeDriver but that didn't seem to work when I tried it (maybe I missed something) From: "jherzen...@shastaqa.com" To: Watir General Sent: Friday, May 13, 2016 7:35 PM Subject: [wtr-general] Re: Upload multiple files to input element? So I'm thinking I may have to do something with Javascript (shudders). Going to try patching together a script and passing it to the execute_script function. Maybe from that side it will be possible? Will post back if I have any luck, as maybe this will be useful to someone.-- -- 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. -- -- 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.
Re: [wtr-general] Passing value to is not working
may need to click on the input inside td From: sivam To: Watir General Sent: Wednesday, June 8, 2016 8:46 AM Subject: [wtr-general] Passing value to is not working Hi all, I am using watir 1.6.5 to interact with pages. I got into an issue and I need your help on to fix this. I want to pass values to table data elements. Manually when I click on table cell, it becomes editable and allowing me to pass value. When I was trying to click from ruby watir, click event is not happening. I tried fireevent and cell.value but nothing made me to show that editable field. Please have the html page before click and during click. Before click: After click: Can you please help me in passing value to td using watir -- -- 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. -- -- 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.
Re: [wtr-general] cannot load such file — Config/Data/data_form.yml (LoadError)
Ruby has a $LOAD_PATH constant that tells it where to look for things. I usually do something like this to add something for the 'root' directory where I have some files that I need to access: root = File.expand_path(File.dirname(__FILE__))$LOAD_PATH.unshift(root) And then you should be able to require things relative to whatever 'root' is. From: Ajay Reddy To: Watir General Sent: Monday, July 11, 2016 8:13 AM Subject: [wtr-general] cannot load such file — Config/Data/data_form.yml (LoadError) require "./TestData" require 'yaml' class CardSubmission < Application include PageObject include DataMagic include TestData def initialize(browser) @browser = browser end def submit_application(data = {}) DataMagic.load ("data_form.yml") populate_page_with data_for(:Auto_Data, data) end end I am calling DataMagic.yml_directory = 'Config/data/data_form.yml' in env.rb -- -- 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. -- -- 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.
Re: [wtr-general] cannot load such file — Config/Data/data_form.yml (LoadError)
Hard to say. If you're kicking off things with a Ruby script and that script's above the stuff that you want to load, you may want to start off with putting it there From: Ajay Reddy To: Watir General Cc: jfitis...@yahoo.com Sent: Monday, July 11, 2016 8:44 AM Subject: Re: [wtr-general] cannot load such file — Config/Data/data_form.yml (LoadError) Thanks Johnssn, But where do you want me to add "root = File.expand_path(File.dirname(__FILE__))" and this too "$LOAD_PATH.unshift(root)". On Monday, July 11, 2016 at 10:27:53 AM UTC-5, johnssn wrote: Ruby has a $LOAD_PATH constant that tells it where to look for things. I usually do something like this to add something for the 'root' directory where I have some files that I need to access: root = File.expand_path(File.dirname( __FILE__))$LOAD_PATH.unshift(root) And then you should be able to require things relative to whatever 'root' is. From: Ajay Reddy To: Watir General Sent: Monday, July 11, 2016 8:13 AM Subject: [wtr-general] cannot load such file — Config/Data/data_form.yml (LoadError) require "./TestData" require 'yaml' class CardSubmission < Application include PageObject include DataMagic include TestData def initialize(browser) @browser = browser end def submit_application(data = {}) DataMagic.load ("data_form.yml") populate_page_with data_for(:Auto_Data, data) end end I am calling DataMagic.yml_directory = 'Config/data/data_form.yml' in env.rb -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-...@googlegroups.com http://groups.google.com/ group/watir-general watir-genera...@ 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-genera...@ googlegroups.com. For more options, visit https://groups.google.com/d/ optout. -- -- 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.
Re: [wtr-general] How to identify the index of an element by text
probably nicer ways are doing it but think this'll work index = nilb.divs(:class, 'grid').each_with_index do |div, idx| index = idx if div.text =~ /text6/ break if indexend From: Soori To: Watir General Sent: Monday, July 18, 2016 2:05 PM Subject: [wtr-general] How to identify the index of an element by text I have a scenario where there is a grid of elements with same class name. I need to identify the element position using index. For example: text1text3 text4 text23 text6 text88 text3 in the above example, I need to find the index of the div for "text6". Can you please help me how I can do this using watir? /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 --- 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. -- -- 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.
Re: [wtr-general] Re: "watir webdriver cannot select checkbox input element"
It's most likely exactly what Titus suggested. One other thing you can do, in addition to providing the HTML he asked for, is to see how many elements there are that match. Stuff like this: b.checkboxes(:id => 'sv').length # More than 1? If so, the one you want may be one of the others b.checkboxes(:id => 'sv').find_all { |cb| cb.present? }.length # Count of how many are accessible. b.checkboxes(:id => 'sv').each { |cb| cb.set if cb.present? } # Set any that are accessible. ...and variations of that, kind of like how you were doing it below... From: Literate Aspects To: Watir General Sent: Tuesday, August 9, 2016 5:31 PM Subject: [wtr-general] Re: "watir webdriver cannot select checkbox input element" WOW, thank you! What do I need to supply back to you? Jon On Tuesday, August 9, 2016 at 5:13:48 PM UTC-7, Titus Fortner wrote: I just replied to your stackoverflow post. Please provide the applicable html. If `when_present` times out, then something is hiding the element, and that is likely at the root of your issue. Titus On Tuesday, August 9, 2016 at 7:08:25 PM UTC-5, Literate Aspects wrote: Please, any suggestions greatly appreciated. Attempting to identify the element to be able to check the checkbox. REF: "watir webdriver cannot select checkbox input element" SELECTOR: #svELEMENT: Please, any suggestions greatly appreciated. I have tried: FROM: b.span(:text, 'Svenska').clickIRB returns: Unable to locate element FROM: b.span(:text, 'sv').clickIRB returns: Unable to locate element FROM: b.execute_script("$('input: checkbox[id=\"sv\"]').attr(' checked', 'checked');")IRB returns: nil FROM: b.execute_script("document. getElementById('sv').click();" )IRB returns: nil FROM: b.checkbox(:id => 'sv').fire_event :onmousedownIRB returns: false FROM: b.checkbox(:id => 'sv').fire_event :onclickIRB returns: true FROM: b.checkbox(:id => 'sv').fire_event :clickIRB returns: true FROM: b.checkbox(:id => 'sv').when_present.setIRB returns: time out (30 seconds) FROM: b.checkbox(:id => 'sv').fire_event :setIRB returns: true FROM: b.checkbox(:id => 'sv').fire_event :hoverIRB returns: true FROM: b.input(:id, "sv").to_subtype.setIRB returns: Element is currently not visible FROM: b.select_list(:id => 'sv').option(:text => 'sv').selectIRB returns: Unable to locate element FROM: b.input(:id, "sv").setIRB returns: located=false -- -- 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. -- -- 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.
Re: [wtr-general] Re: latest watir giving error with firefox
I can't remember for sure if this is the same thing but you may want to try this, grabbed it from our framework: # Absolutely, positively have to have this to create browser instances via webdriver.# Something in the Ruby stack is modifying how Kernel#exec works. This setting# allows Kernel#exec to be bypassed when starting up a browser instance. I think# the only thing that uses childprocess is watir-webdriver, so this change should# be safe.ChildProcess.posix_spawn = true From: naveen kumar To: Watir General Sent: Thursday, December 15, 2016 11:09 AM Subject: [wtr-general] Re: latest watir giving error with firefox This is the begining trace C:\Users\nnalam\workspace\Arachni>ruby Login_script_2.rbException `ChildProcess::Error' at C:/Ruby200/lib/ruby/gems/2.0.0/gems/childprocess-0.5.9/lib/childprocess/windows/lib.rb:385 - The parameter is incorrect. (87)Exception `ChildProcess::Error' at C:/Ruby200/lib/ruby/gems/2.0.0/gems/childprocess-0.5.9/lib/childprocess/windows/lib.rb:385 - The parameter is incorrect. (87)Exception `ChildProcess::Error' at C:/Ruby200/lib/ruby/gems/2.0.0/gems/childprocess-0.5.9/lib/childprocess/windows/lib.rb:385 - The parameter is incorrect. (87)Exception `Errno::EINPROGRESS' at C:/Ruby200/lib/ruby/gems/2.0.0/gems/selenium-webdriver-3.0.1/lib/selenium/webdriver/common/socket_poller.rb:81 - A blocking operation is currently executing. - connect(2) would block1481828950413 geckodriver INFO Listening on 127.0.0.1:Exception `Errno::ECONNREFUSED' at C:/Ruby200/lib/ruby/gems/2.0.0/gems/selenium-webdriver-3.0.1/lib/selenium/webdriver/common/socket_poller.rb:84 - No connection could be made because the target machine actively refused it.["127.0.0.1", ]Exception `Errno::EINPROGRESS' at C:/Ruby200/lib/ruby/gems/2.0.0/gems/selenium-webdriver-3.0.1/lib/selenium/webdriver/common/socket_poller.rb:81 - A blocking operation is currently executing. - connect(2) would blockException `Errno::EISCONN' at C:/Ruby200/lib/ruby/gems/2.0.0/gems/selenium-webdriver-3.0.1/lib/selenium/webdriver/common/socket_poller.rb:81 - A connect request was made on an already connected socket. - connect(2)Exception `ArgumentError' at C:/Ruby200/lib/ruby/gems/2.0.0/gems/selenium-webdriver-3.0.1/lib/selenium/webdriver/remote/w3c_bridge.rb:80 - unknown option: {:profile=>#}#>, @stderr=#>>, @cwd=nil, @detach=false, @duplex=false, @leader=false, @environment={}, @pid=12448, @handle=#, @closed=false>> : [{:exited?=>false, :code=>259}]Exception `Errno::EWOULDBLOCK' at C:/Ruby200/lib/ruby/2.0.0/net/protocol.rb:153 - A non-blocking socket operation could not be completed immediately. - read would block On Thursday, 15 December 2016 13:54:33 UTC-5, Titus Fortner wrote: I'm looking for the beginning part of the stdout, not just the stack trace. Thanks,Titus On Thursday, December 15, 2016 at 12:33:00 PM UTC-6, naveen kumar wrote: Additional stack trace #>, @stderr=#>>, @cwd=nil, @detach=false, @duplex=false, @leader=false, @environment={}, @12820, @handle=#, @closed=false>> : [{:exited?=>true, :code=>12820}]C:/Ruby200/lib/ruby/2.0.0/net/ http/generic_request.rb:27:in `initialize': HTTP request path is empty (ArgumentError) from C:/Ruby200/lib/ruby/2.0.0/net/ http/request.rb:14:in `initialize' from C:/Ruby200/lib/ruby/gems/2.0. 0/gems/selenium-webdriver-3.0. 1/lib/selenium/webdriver/ remote/http/default.rb:91:in `new' from C:/Ruby200/lib/ruby/gems/2.0. 0/gems/selenium-webdriver-3.0. 1/lib/selenium/webdriver/ remote/http/default.rb:91:in `new_request_for' from C:/Ruby200/lib/ruby/gems/2.0. 0/gems/selenium-webdriver-3.0. 1/lib/selenium/webdriver/ remote/http/default.rb:56:in `request' from C:/Ruby200/lib/ruby/gems/2.0. 0/gems/selenium-webdriver-3.0. 1/lib/selenium/webdriver/ remote/http/default.rb:84:in `request' from C:/Ruby200/lib/ruby/gems/2.0. 0/gems/selenium-webdriver-3.0. 1/lib/selenium/webdriver/ remote/http/common.rb:59:in `call' from C:/Ruby200/lib/ruby/gems/2.0. 0/gems/selenium-webdriver-3.0. 1/lib/selenium/webdriver/ remote/w3c_bridge.rb:659:in `raw_execute' from C:/Ruby200/lib/ruby/gems/2.0. 0/gems/selenium-webdriver-3.0. 1/lib/selenium/webdriver/ remote/w3c_bridge.rb:132:in `create_session' from C:/Ruby200/lib/ruby/gems/2.0. 0/gems/selenium-webdriver-3.0. 1/lib/selenium/webdriver/ remote/w3c_bridge.rb:89:in `initialize' from C:/Ruby200/lib/ruby/gems/2.0. 0/gems/selenium-webdriver-3.0. 1/lib/selenium/webdriver/ firefox/w3c_bridge.rb:34:in `initialize' from C:/Ruby200/lib/ruby/gems/2.0. 0/gems/selenium-webdriver-3.0. 1/lib/selenium/webdriver/ common/driver.rb:52:in `new' from C:/Ruby200/lib/ruby/gems/2.0. 0/gems/selenium-webdriver-3.0. 1/lib/selenium/webdriver/ common/driver.rb
Re: [wtr-general] How to click specific link in table?
May be semantics, but you mentioned clicking on a link to call a button, which could be a problem if the element truly is a link. If it's a link then you should try to access it that way: book_rows.a(value: /view/i).click. There might be more than one table with that id: @browser.tables(id: /academic/i).length Not sure if this'll help or not but you can try something like it with your table object and maybe it'll help you see what's going on: table.trs.to_a.each_with_index do |tr, idx| puts "-" puts "INDEX:\t#{idx}" puts "TEXT\t#{tr.text}" puts "BUTTONS\t#{tr.buttons.length}" puts "BVALS:\t'#{tr.buttons.map(&:value).map(&:value).join(', ')}'" puts "LINKS\t#{tr.as.length}" puts "LVALS:\t'#{tr.as.map(&:text).map(&:value).join(', ')}'"end From: 江南 To: Watir General Sent: Sunday, December 25, 2016 8:36 AM Subject: [wtr-general] How to click specific link in table? Hi, I want to click on a specific link in a table: boo_title = 'Learn driving' table = @browser.table(:id => 'Academic') book_row = table.td(:text => book_title).parent book_row.button(:value => 'View').click but currently Im getting this error:Watir::Exception::UnknownObjectException: unable to locate element, using {:text=>"Learn driving", :tag_name=>"td"} Please help!-- -- 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. -- -- 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.
Re: [wtr-general] iterating LI through elements
Watir models everything in the DOM. So think something like this should work b.uls.each do |ul| ul.lis.each { |li| p li.text }end From: "artie.z...@gmail.com" To: Watir General Sent: Tuesday, January 3, 2017 2:59 PM Subject: [wtr-general] iterating LI through elements Hello Folks, I am trying to find syntax for express the following. I want to iterate across LI elements in a UL (unordered list) I thought something like this would do it: all_li_elements = browser.div(:id => 'topLevelMenu0').li Maybe that's close? Then I was hoping to iterate though them search for one: all_li_elements.each { |e| puts e.text } Or perhaps I would use the list of LI elements in an RSpec expect statement with an include matcher that specifies one in the list. I have used the following to see the text in an LI element: menu_li_element = browser.div(:id => 'topLevelMenu0').li(:text => "Open New Document") which returns a single LI element. And, I find the text itself here: puts menu_li_element.text"Open New Document" If you know of some useful references to this kind of stuff on the Net, then please share the link or even a few keywords that might help me find it. Perhaps there are methods better suited? -az -- -- 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. -- -- 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.
Re: [wtr-general] Re: Clicking out of view elements chrome/chromedriver
Yeah, I've seen it. It's been a while since I've used ChromeDriver on a regular basis but my recollection was that it seemed a little fussier about that sort of thing. From: Brian Rieck To: Watir General Sent: Wednesday, February 1, 2017 4:58 PM Subject: [wtr-general] Re: Clicking out of view elements chrome/chromedriver Thank you for the reply, this will be a great workaround and actually provides some needed functionality. I updated my Watir/Selenium/Chrome/Chromedriver and the problem persists. Is this a known issue for certain situations, or do I need to dig deeper into my code? On Wednesday, February 1, 2017 at 5:00:26 PM UTC-5, Titus Fortner wrote: Out of curiosity, what isn't compatible with updating selenium? For scrolling elements, check out p0deje's 'watir-scroll' gem. It's great when what selenium does by default isn't quite good enough. Titus On Wednesday, February 1, 2017 at 8:36:06 AM UTC-6, Brian Rieck wrote: Watir-webdriver: 0.6.11Selenium-webdriver: 2.35.1Chromdriver: 2.27.440174Chrome: 56.0.2924.76 I am forced to use an older watir-webdriver version as there are other dependencies that conflict with updating selenium. I have run into an issue with elements that are out of view. The tests believe they have interacted with the element and even bring it into view. However, the resulting action does not in fact click a button that was out of view, only bring it into view. Does anyone know a workaround for this other than "update your stuff". Thank you. -- -- 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. -- -- 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.
Re: [wtr-general] angular login
i think watir-ng just gives you the ability to use non-standard attributes not sure if this'll work with the new watir codebase without adjustments but we're using something like this to access a custom "role" attribute Watir::HTMLElement.attributes << :role module Watir class Element attribute(String, :role, 'role') endend To the person that asked, it should be like any other html page so stuff like id should be fine From: Titus Fortner To: watir-general Sent: Friday, February 3, 2017 10:51 AM Subject: Re: [wtr-general] angular login A couple things have changed from Cucumber & Cheese (Cheezy is in the process of creating an updated version) watir-webdriver is now deprecated in favor of Watir 6.0. You'll want to require 'watir', but that could give you a problem with `watir-ng`. I've written code for multiple Angular sites using watir without watir-ng, but I do not know what all it provides. With the latest version of watir you won't need sleeps. This code will work: require 'watir' @browser = Watir::Browser.new :chr...@browser.goto "https://apps.vizlly.com/dms- angular/#/login"@browser.text_field(id: 'email').set('em...@email.com') On Fri, Feb 3, 2017 at 12:43 PM, Titus Fortner wrote: You need to use: @browser = Watir::Browser.new On Fri, Feb 3, 2017 at 12:19 PM, c w wrote: Hi all! Please can one tell me how do i fill in the email and password when te application is angular based I try to use this #this is from cucumber and cheeserequire 'rubygems'require 'watir-ng' @browser = Selenium::WebDriver.for :chr...@browser.navigate.to "https://apps.vizlly.com/dms- angular/#/login"sleep 3@browser.text_field(:id => 'email').flash @browser.text_field(:id => 'email').set('em...@email.com' ) But I can load the page but I can't write into the text fields.Can we access elements using model or the way protractor does? This is the application link https://apps.vizlly.com/dms-an gular/#/login I do appreciate.I try to see if I can move to watir vs protractor. Kind regards and I appreciate a lot your time!Cristina-- -- 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+unsubscribe@goog legroups.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+unsubscribe@goog legroups.com. For more options, visit https://groups.google.com/d/op tout. -- -- 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. -- -- 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.
Re: [wtr-general] Is Watir the right tool?
it's a browser automation tool that requires ruby, so basically if it's html and you can use ruby then the answer is yes From: "achirotou...@gmail.com" To: Watir General Sent: Wednesday, February 15, 2017 11:00 AM Subject: [wtr-general] Is Watir the right tool? Hello, Our Company uses desktop application the legacy part of which is based on VB6 and the newer modules are in C#/.Net. Could someone possibly let me know, if Watir is the right tool for us?Thank you-- -- 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. -- -- 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.
Re: [wtr-general] Exist method is needed while I use visible method, Can it be avoided?
try .present? instead From: Raja gopalan To: watir-general@googlegroups.com Sent: Thursday, March 23, 2017 9:52 AM Subject: [wtr-general] Exist method is needed while I use visible method, Can it be avoided? I find I couldn't use visible method without exists method because visible method throws the error if element is not present. Though it seems to be logically correct, it doesn't give the practical easiness, for an example, I can't write If element.visible? instead I need to write If element.exists? and element.visible? I always need to include the exists method call while I use visible method call, So can this method be changed to return true or false according to whether it is visible or not visible? -- Rajagopalan-- -- 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. -- -- 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.
Re: [wtr-general] Exist method is needed while I use visible method, Can it be avoided?
i'm not sure if it slows things down a lot. think you need to do some level of checking anyway. one way of implementing this sort of thing would be to try to write or whatever and only do polling when the op is going to fail. i suspect it's probably done like that. you'd be better off using just watir once you get more used to all of the dom methods it provides. it wraps a much more sophisticated api around the webdriver stuff. From: Raja gopalan To: Watir General Sent: Thursday, March 23, 2017 10:16 AM Subject: Re: [wtr-general] Exist method is needed while I use visible method, Can it be avoided? Titus, I stongly believe checking enabled? present? writable? methods are unnecessary calls by WATIR because we know what kind of field we are going to interact so these calls to every element slows down the process So what I did was, I have CALLED the driver out of WATIR and started writing selenium code and wherever I want the help of WATIR help like b.table.rows.each, I will write watir code and also If I know there are certain element starts to appear after the click then I write watir code, So I am mixing the selenium code and WATIR code as shown below, For an example, look at the code below and see how I have mixed the selenium code and WATIR CODE require 'watir' class Cable def initialize caps = Selenium::WebDriver::Remote::Capabilities.firefox(marionette: false) @b=Watir::Browser.new :firefox, desired_capabilities: caps @b.goto 'smcnet.in/' @driver=@b.driver end def call @driver.find_element(:id, 'username').send_keys 'raja' @driver.find_element(:id, 'password').send_keys '' @driver.find_element(:xpath, "//*[@value='Log In']").click @driver.find_element(link: 'My Plan').click @b.element(xpath: "//span[normalize-space(.)='usage details']").click# WATIR CODE puts @b.div(:text, 'MB Used').following_sibling.span.text# WATIR CODE puts @b.div(:text, 'Days Remaining').following_sibling.span.text # WATIR CODE @driver.find_element(link: 'Hi, RAJAGOPALAN M').click @driver.find_element(:xpath, '//li[3]/a').click # @driver.quit end end On Thursday, March 23, 2017 at 10:06:26 AM UTC-7, Titus Fortner wrote: Yes, #present? is a combination of #exists? and #visible?Also, with Watir 6, you are less likely to need to make this call explicitly in the code. Taking actions on an element will automatically wait for element to be present if necessary. -- -- 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. -- -- 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.
Re: [wtr-general] How to select a csv file from hard disc using watir ruby on MAC OS
#!/usr/bin/env ruby# Encoding: utf-8 # Paste everything into script, including the shebang and encoding# lines above.# Don't forget to make script executable.# Usage: ./some_script.rb /path/to/csv require 'csv'obj = CSV.read(ARGV[0]) # ARGV is an array that will have the cmd line args. From: satya nagendrababu To: Watir General Sent: Friday, September 1, 2017 8:29 AM Subject: [wtr-general] How to select a csv file from hard disc using watir ruby on MAC OS How to select a csv file from hard disc using watir ruby on MAC OS Hi, I am new to watir automation testing, Can any one help by sending the sample code to select .csv file from hard disc using watir ruby on MAC OS Thanks in advance -- -- 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. -- -- 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.
Fw: [wtr-general] Re: Uploading file to a readonly field
maybe jdenen/watir-ng | | | | || | | | || jdenen/watir-ng watir-ng - Identify watir-webdriver elements with ng directives | | | | × - Forwarded Message - From: Raymond Raymundo To: Watir General Sent: Tuesday, 10 October 2017, 21:14 Subject: [wtr-general] Re: Uploading file to a readonly field We just removed the readonly attribute from the html, but file_field doesn't since the file upload field has an attribute type='text'. FYI we are using angularjs ng-file-upload, so is there anyway to upload a file without using file_field? On Wednesday, October 11, 2017 at 1:10:09 AM UTC+8, Raymond Raymundo wrote: So i'm trying to upload a file to a field that is set to readonly $browser.text_field(id: 'inputResume').set($cv_path.to _s) And I get error Watir::Exception::ObjectReadO nlyException (Watir::Exception::ObjectReadO nlyException) Is there a way around 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/d/optout. -- -- 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.
Re: [wtr-general] How do i copy employee dataset into a textbox accurately?
If Titus's suggestion doesn't sort it it's worth checking to see if line breaks are getting handled properly and that the encoding is handled properly. Found a random link: https://forums.asp.net/t/1456447.aspx?how+to+convert+line+breaks+r+n+to+excel+alt+enter+after+exporting+from+mssql+to+excel+csv When you're cutting and pasting between excel and the browser there's some level of converting that can happen automatically. That may be why it only works when you do it manually. And encoding's always important. Ideally, the string that you're pasting should be read in using the correct encoding and pasted as a UTF-8 string, which is the default for Ruby. Probably not the issue here but it's worth checking if you haven't already. At one point a long time ago I ran into a driver-specific bug related to setting a text field with a multiline string. That bug's long gone. But if the more obvious things to try aren't helping then it might be worth trying a quick test with another browser/driver. On Sunday, October 14, 2018, 5:56:48 PM PDT, Sharat Oommen wrote: Hi all, I have been facing this issue with watir where i havent been able to copy a particular dataset into a text box effectively. Usually most websites support excel sheet upload but in this particular case i have to copy paste the data set into a textbox directly. It works fine when i manually do it however while trying to automate it with watir i am finding eratic behaviour/ i tried to use a combination of /t and /n in the string set passed to the textox but it still doesnt help. Any help wrt this regard would be much appreciated. Thanks -- -- Before posting, please read https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group. 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. -- -- Before posting, please read https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group. 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.
Re: [wtr-general] WATIR can be used for AngularJS?
I wrote something with Angular in mind. Some sample tests for Google's angular components are here: https://github.com/jfitisoff/insite/blob/master/spec/material_angular_io_spec.rb And Google's showcase for those components are here (the tests utilize this site): https://material.angular.io I didn't incorporate Titus's gem because the library isn't limited to Angular -- it's more about supporting web components and recurring features -- but maybe I should add a pointer to that gem for folks testing Angular apps. On Thursday, January 31, 2019, 10:08:10 AM PST, rajagopalan madasami wrote: Hi, thank you very much . On Tue, 29 Jan, 2019, 8:45 PM Joe Fleck https://github.com/titusfortner/watir_angular Joe On Tue, Jan 29, 2019, 10:10 AM https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group. 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. -- -- Before posting, please read https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group. 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. -- -- Before posting, please read https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group. 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. -- -- Before posting, please read https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group. 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.
Re: [wtr-general] Re: List of items that refresh every second
I may be misunderstanding, but you probably want something that'll loop until a condition is met, then poll all of the (divs, spans whatever) checking for one with text matching job name + status. Watir has some wait functionality and there are gems that do this also. rspec-wait's pretty good but I haven't used in in a while. You'd end up with *something* like this: wait_for { browser.divs.any? { |div| div.text =~ /#{job_name}\s+#{status}/ } } Something like that. It's early and haven't had coffee yet so YMMV. On Wednesday, February 6, 2019, 3:26:51 PM PST, Joe Fl wrote: As a user I want to confirm the job I requested has completed with results. The list contains many jobs in many different statuses. status is as follows: pending, running, result On Tuesday, January 29, 2019 at 3:13:05 AM UTC-5, Lakshya Kapoor wrote: What exactly are you trying to test with the jobs? We'll need a proper test case to be able to help you. On Monday, January 28, 2019 at 11:23:25 AM UTC-8, Joe Fl wrote: Hi all, I have a list of jobs being executed that show the progress of the job. This list refreshes every second and I am wondering if anyone automated this before. I will create then execute the job and continue look at the list of jobs until its results return. The other challenge is my original job could move from the #1 spot to lower in the list. Any thoughts on how to approach this would be greatly appreciated. Thank you,Joe -- -- Before posting, please read https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group. 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. -- -- Before posting, please read https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group. 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] Privacy Policy
Hey all together, at the moment I am doing some research for a test automatisation tool. Watir seems very interessting for my project. Does anyone of you know something about the privacy policy of Watir or a link where I can find something out about that? Thank you in advance! Martin -- -- Before posting, please read https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group. 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. To view this discussion on the web visit https://groups.google.com/d/msgid/watir-general/16b11280-f50c-407e-8d2b-61bb6fad3f8d%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [wtr-general] not able to click on button that is visible.
Just a guess but the page HTML may have multiple buttons that match value: "OK" (and you're getting the very first one, which isn't the one that you actually want.) It's been a while but think you could add visible: true if that's the case, then it should find the one that you're looking for. On Friday, February 5, 2021, 08:35:17 PM PST, Suresh Murthy wrote: as you can see from the code, the button exists with text "OK". But i cannot click on it. how do fix this ?irb(main):189:0> ie.button(value:"OK").html=> ""irb(main):190:0> ie.button(value:"OK").exists?=> trueirb(main):191:0> ie.button(value:"OK").click 2021-02-05 18:07:41 WARN Selenium [DEPRECATION] Selenium::WebDriver::Error::ElementNotVisibleError is deprecated. Use Selenium::WebDriver::Error::ElementNotInteractableError (ensure the driver supports W3C WebDriver specification) instead.Traceback (most recent call last): 8: from C:/Ruby26-x64/bin/irb.cmd:31:in `' 7: from C:/Ruby26-x64/bin/irb.cmd:31:in `load' 6: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/irb-1.0.0/exe/irb:11:in `' 5: from (irb):191 4: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/watir-6.16.5/lib/watir/elements/element.rb:145:in `click' 3: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/watir-6.16.5/lib/watir/elements/element.rb:790:in `element_call' 2: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/watir-6.16.5/lib/watir/elements/element.rb:803:in `rescue in element_call' 1: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/watir-6.16.5/lib/watir/elements/element.rb:752:in `raise_present'Watir::Exception::UnknownObjectException (element located, but timed out after 30 seconds, waiting for #"OK", :tag_name=>"button"}> to be present) -- -- Before posting, please read https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group. 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. To view this discussion on the web visit https://groups.google.com/d/msgid/watir-general/21a8b6e5-3dbe-48cb-9741-4155c096795dn%40googlegroups.com. -- -- Before posting, please read https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group. 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. To view this discussion on the web visit https://groups.google.com/d/msgid/watir-general/1383891300.395390.1612588015901%40mail.yahoo.com.
Re: [wtr-general] Watir - How to call browser.goto from another file
Replace all hard-coded instance of the the URLs with a variable or a constant. Store that different URLs in a hash in a file. Something like this: URLS = { dev: 'https://url1.com', prod: 'https://url2.com'} Then, in whatever you're using to run the script, add an option to specify the environment when running. one way to do it would be to use ARGV. Then run the script for the environment, let's say you want "dev": myscript.rb dev In the script, assuming that you have access to the URLS constant defined above, then you could then get the URL associated with the environment you specified at the command line by doing something like this: TARGET_URL = URLS[ARGV[0].to_sym] And then use TARGET_URL wherever you need to call goto in place of the hard-coded URL. There are better ways of doing this but it sounds like you're just looking for ideas to start organizing, HTH. John On Thursday, March 24, 2022, 08:22:34 AM PDT, perg...@gmail.com wrote: Hi, I'm using watir ruby for my testing I have quite lot f script written for a website and sometimes I have test in different environment like UAT or DEV site. At the moment my setup method below are in the same file as my test scripts. @browser = Waitr::Browser.new. @browser.goto "https" I want to be able to change the goto website just one time instead going to each file to change it everytime. I have tried move the above code to a different file and use the require ''" method in the test script file but it doesn't work. Any advice on how can to call the @browser.goto from another file? Thanks -- -- Before posting, please read https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group. 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. To view this discussion on the web visit https://groups.google.com/d/msgid/watir-general/74dc7e5e-6138-47ca-9422-9e2ee41f1e10n%40googlegroups.com. -- -- Before posting, please read https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group. 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. To view this discussion on the web visit https://groups.google.com/d/msgid/watir-general/1941191164.154348.1648180045768%40mail.yahoo.com.