Re: [wtr-general] Parallel testing
Yup, we're using webdriver. Zeljko, are you aware of any site providing documentation to set up and/or using watir-webdriver with selenium grid? Thanks again. On Monday, November 19, 2012 2:35:31 PM UTC-8, Željko Filipin wrote: On Mon, Nov 19, 2012 at 11:29 PM, Ry cross...@gmail.com javascript: wrote: What options are available for parallel testing in watir that is similar to Selenium Grid? If you are using watir-webdriver, you can use selenium grid. If you are using watir-classic, I think you are out of luck. :) Željko -- filipin.eu -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Parallel testing
Thank you for those. I should have clarified, I was seeking documentation or source for purpose of showing my company that it CAN work. We recently presented watir-webdriver and another group presented selenium-webdriver and the final decision is being based on if watir can work in parallel like selenium grid. I shared information from your first replay and I was asked for 'proof'. I hope this explains my dilemma a little further. On Wednesday, November 21, 2012 1:01:55 PM UTC-8, Željko Filipin wrote: On Wed, Nov 21, 2012 at 9:51 PM, Ry cross...@gmail.com javascript: wrote: Zeljko, are you aware of any site providing documentation to set up and/or using watir-webdriver with selenium grid? I do not think any special setup is required. You can see how the software that runs Wikipedia (MediaWiki) is tested with watir-webdriver and hosted selenium grid (Sauce Labs): https://github.com/zeljkofilipin/browsertests I also wrote a blog post with screencast about a very similar setup: http://filipin.eu/test-automation-at-homeswap-com/ If you any questions, let me know. Željko -- https://leanpub.com/watirbook -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
[wtr-general] Parallel testing
What options are available for parallel testing in watir that is similar to Selenium Grid? I found WatirGrid, but does it require rails? Are there non-rail options? Thanks, Ryan -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
[wtr-general] Re: [Cucumber] Screenshots with Cucumber/Watir on Windows 7 with IE9
ie happens to be my browser variable ie = Watir::Browser.new On Monday, November 12, 2012 4:11:48 AM UTC-8, Jarmo Pertman wrote: Instead of just using ie, use the browser variable name which is used everywhere else in your tests. Jarmo Pertman - IT does really matter - http://itreallymatters.net On Sunday, November 11, 2012 8:04:28 PM UTC+2, Ry wrote: Thank you. 1) I removed the 'include watir line 2) updated my hooks.rb After do |scenario| if scenario.failed? Dir::mkdir('screenshots') if not File.directory?('screenshots') screenshot = ./screenshots/FAILED_#{scenario.name.gsub(' ','_').gsub(/[^0-9A-Za-z_]/, '')}.png ie.save_screenshot(screenshot) embed screenshot, 'image/png' end end error I see in the log now is undefined local variable or method `ie' for #Object:0x3361d10 (NameError) C:/Users/Darkhudson/Desktop/DEMO/watirDemo/workspace/features/support/hooks.rb:5:in `After' and it highlights this line as the syntax error *ie.save_screenshot(screenshot) * -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
[wtr-general] Re: [Cucumber] Screenshots with Cucumber/Watir on Windows 7 with IE9
Thank you. 1) I removed the 'include watir line 2) updated my hooks.rb After do |scenario| if scenario.failed? Dir::mkdir('screenshots') if not File.directory?('screenshots') screenshot = ./screenshots/FAILED_#{scenario.name.gsub(' ','_').gsub(/[^0-9A-Za-z_]/, '')}.png ie.save_screenshot(screenshot) embed screenshot, 'image/png' end end error I see in the log now is undefined local variable or method `ie' for #Object:0x3361d10 (NameError) C:/Users/Darkhudson/Desktop/DEMO/watirDemo/workspace/features/support/hooks.rb:5:in `After' and it highlights this line as the syntax error *ie.save_screenshot(screenshot) * -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
[wtr-general] [Cucumber] Screenshots with Cucumber/Watir on Windows 7 with IE9
I am trying to set up ability to take screen shots. I'm not concerned if they embed or are saved to a directory. I have googled several suggestions, but none have worked. Right now I am trying to use example from http://watirmelon.com/tag/cucumber/ I am using Ruby 1.9, Watir 4.0.2, and Cucumber 1.2.1 Windows 7 with IE 9 I have a hooks.rb file with the following After do |scenario| if scenario.failed? Dir::mkdir('screenshots') if not File.directory?('screenshots') screenshot = ./screenshots/FAILED_#{scenario.name.gsub(' ','_').gsub(/[^0-9A-Za-z_]/, '')}.png Browser::BROWSER.driver.save_screenshot(screenshot) embed screenshot, 'image/png' end end start of my ruby file is require 'watir' include Watir ie = Watir::Browser.new The script finishes and when I check my html log, I see this after the failed feature. uninitialized constant Watir::Browser::BROWSER (NameError) C:/Users/Darkhudson/Desktop/DEMO/watirDemo/workspace/features/support/hooks.rb:5:in `After' 3Dir::mkdir('screenshots') if not File.directory?('screenshots')4 screenshot = ./screenshots/FAILED_#{scenario.name.gsub(' ','_').gsub(/[^0-9A-Za-z_]/, '')}.png5 Browser::BROWSER.driver.save_screenshot(screenshot)6embed screenshot, 'image/png'7 end any suggestions to making this work? Or if better suggestion to including other gems in my script and using something I am totally open. I just would like to get screenshots to work, specifically on failed features. 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
Re: [wtr-general] [ruby watir cucumber] text assertions
Yes... There are no menus or filters or drop downs on the page. My intent is clicking a link, taken to page, and checking some text on that page to ensure the link went to where I expected to go. The page in this case is a term of condition page which only has several paragraphs of text. I took a few words from the first line. I open to suggestions of a better to assert this page. Thanks all Ryan On Thursday, October 18, 2012 3:58:00 PM UTC-7, Oscar.Rieken wrote: Yes, first You are doing an assertion in a when (in cucumber when is more for changing state) Second by ie.text I assume you are checking all of the text of the page better to locate the exact text location Can you give us more info on what you want to do Sent from my iPhone On Oct 18, 2012, at 6:27 PM, Ry cross...@gmail.com javascript: wrote: Is there a better way to write this? my goal to verifying text exists on the page and if it does to return to previous page otherwise close the window When /^I should be taken to the my text page$/ do if ie.text('Modification of awesome things').visible? = true then ie.back else ie.close end end my error when running this is syntax error, unexpected keyword_else, expecting $end else ie.close -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-...@googlegroups.com javascript: http://groups.google.com/group/watir-general watir-genera...@googlegroups.com javascript: -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
[wtr-general] [ruby watir cucumber] text assertions
Is there a better way to write this? my goal to verifying text exists on the page and if it does to return to previous page otherwise close the window When /^I should be taken to the my text page$/ do if ie.text('Modification of awesome things').visible? = true then ie.back else ie.close end end my error when running this is syntax error, unexpected keyword_else, expecting $end else ie.close -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Re: Ruby with Cucumber - Report Output
Thank you so much Željko! On Wednesday, October 10, 2012 4:44:00 AM UTC-7, Željko Filipin wrote: On Tue, Oct 9, 2012 at 7:20 PM, Ry cross...@gmail.com javascript: wrote: cucumber --format 'Timestamped::HtmlFormatter' Create config/cucumber.yml file with this contents: default: --format html --out cucumber%= ENV['VARIABLE'] %.html Set VARIABLE environment variable to the value that makes sense to you, like date and time. (Let me know if you do not know how to do it.) Run the tests with running cucumber from the command line. There should be cucumber_date_time.html file in the folder. Željko -- filipin.eu -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
[wtr-general] Ruby with Cucumber - Report Output
Is anyone familiar with time stamping the file name or having something append to file name on output each time a cucumber/ruby script is ran? Currently it overwrites what is there and I want to save all my output reports. I use Cucumber and Ruby Thanks! -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
[wtr-general] Re: Ruby with Cucumber - Report Output
Thanks Champ! I am newer to logging. I understand that what you've given me will go in the upper part of the file. my command line currently has been 'cucumber --format 'Timestamped::HtmlFormatter' --out cucumber.html' would you be able to provide me an example to using your suggestion? Thanks, Ryan On Tuesday, October 9, 2012 8:47:31 AM UTC-7, Champ wrote: filename = filename + Time.now On Tuesday, October 9, 2012 11:35:27 AM UTC-4, Ry wrote: Is anyone familiar with time stamping the file name or having something append to file name on output each time a cucumber/ruby script is ran? Currently it overwrites what is there and I want to save all my output reports. I use Cucumber and Ruby Thanks! -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
[wtr-general] Re: Ruby with Cucumber - Report Output
ok I got this to work in creating how I want the file to looks, but the html file was empty how do I get the data to out put into the file. This is what I added to the file t= Time.now File.open(c:\\filename+t.strftime(%m%d%Y_%H%M%)+.xls,w) This was my command line cucumber --format 'Timestamped::HtmlFormatter' On Tuesday, October 9, 2012 9:22:00 AM UTC-7, Ry wrote: Thanks Champ! I am newer to logging. I understand that what you've given me will go in the upper part of the file. my command line currently has been 'cucumber --format 'Timestamped::HtmlFormatter' --out cucumber.html' would you be able to provide me an example to using your suggestion? Thanks, Ryan On Tuesday, October 9, 2012 8:47:31 AM UTC-7, Champ wrote: filename = filename + Time.now On Tuesday, October 9, 2012 11:35:27 AM UTC-4, Ry wrote: Is anyone familiar with time stamping the file name or having something append to file name on output each time a cucumber/ruby script is ran? Currently it overwrites what is there and I want to save all my output reports. I use Cucumber and Ruby 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
Re: [wtr-general] Re: variable for a URL?
Oscar, You've piqued my interest now. By your suggestion, are you refering to editing the script file prior to running? or some other way? Is there a link to some documentation to show me more about your suggestion? An example would greatly ensure my understanding. Thanks! Ryan On Wednesday, October 3, 2012 5:26:17 AM UTC-7, Oscar.Rieken wrote: if its a differnt url for every build depending on the changes in the url why not just pass that in to the url string at run time On Tue, Oct 2, 2012 at 8:48 PM, Ry cross...@gmail.com javascript:wrote: Would that work if URL changes a few times a day? We cut what we call a release from development and the URL contains link to our product site in the dev enviroment with the change code. So basically its a new URL for every change we do. On Tuesday, October 2, 2012 4:02:19 PM UTC-7, Dave McNulla wrote: Of course. You can store information in a yaml file, ini file, or properties file. Where I work, we use buildr with properties files that allow us to switch the system under test as easily as using a different environment variable: buildr -e test cuke where test represents a test.properties file, and cuke runs our cucumber feature files. Hope that helps, Dave On Tuesday, October 2, 2012 2:28:25 PM UTC-7, Ry wrote: I will try my best to explain my question. Is it possible... I have several sites, they are essentially the same, (same menus, reports ect..) the GUI is identical, but data may vary. Test sites, essentially, but each site has a different URL in testing or staging environment. Because that is the case, currently, we have to edit our script and change the url each time we want to run a script to a specific site. THE QUESTION! =) could the script have a variable of some sort that looks to a field in a web page (that we're building in house) to see what site is pasted in the field and then run the script using whatever site is listed in the field? or something similar to that, but basically a universal variable for the URL that someone can run across several sites with same GUI, but without having to edit the script. Thank you for any ideas on this. -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-...@googlegroups.com javascript: http://groups.google.com/group/watir-general watir-genera...@googlegroups.com javascript: -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Re: variable for a URL?
ahhh, ok yeah. I will mark that for use in some other projects. With this one I am working I am left with unfortunate that they dont have a common www.someserver.com/ the pre-fix of the URL is different every time because it includes the dev ID and server they use and a ticket number sometimes. There is no standarization basically between each url in test enviroment. I believe you have helped realize that it would be helpful to standarize the testing urls and now I have something I can present to show why it would be helpful. Thank you again! On Wednesday, October 3, 2012 10:58:47 AM UTC-7, Oscar.Rieken wrote: lets say you set an environment variable ENV['URL'] ||= test then when you call the url you can do something like browser.goto(www.someserver.com/#{ENV['URL']}/app_path/http://www.someserver.com/#%7BENV['URL']%7D/app_path/ ) so by default if you just do something like rspec it will go to www.someserver.com/test/app_path/ but if you do URL=something_else rspec it will go to www.someserver.com/something_else/app_path/ On Wed, Oct 3, 2012 at 1:43 PM, Ry cross...@gmail.com javascript:wrote: Oscar, You've piqued my interest now. By your suggestion, are you refering to editing the script file prior to running? or some other way? Is there a link to some documentation to show me more about your suggestion? An example would greatly ensure my understanding. Thanks! Ryan On Wednesday, October 3, 2012 5:26:17 AM UTC-7, Oscar.Rieken wrote: if its a differnt url for every build depending on the changes in the url why not just pass that in to the url string at run time On Tue, Oct 2, 2012 at 8:48 PM, Ry cross...@gmail.com wrote: Would that work if URL changes a few times a day? We cut what we call a release from development and the URL contains link to our product site in the dev enviroment with the change code. So basically its a new URL for every change we do. On Tuesday, October 2, 2012 4:02:19 PM UTC-7, Dave McNulla wrote: Of course. You can store information in a yaml file, ini file, or properties file. Where I work, we use buildr with properties files that allow us to switch the system under test as easily as using a different environment variable: buildr -e test cuke where test represents a test.properties file, and cuke runs our cucumber feature files. Hope that helps, Dave On Tuesday, October 2, 2012 2:28:25 PM UTC-7, Ry wrote: I will try my best to explain my question. Is it possible... I have several sites, they are essentially the same, (same menus, reports ect..) the GUI is identical, but data may vary. Test sites, essentially, but each site has a different URL in testing or staging environment. Because that is the case, currently, we have to edit our script and change the url each time we want to run a script to a specific site. THE QUESTION! =) could the script have a variable of some sort that looks to a field in a web page (that we're building in house) to see what site is pasted in the field and then run the script using whatever site is listed in the field? or something similar to that, but basically a universal variable for the URL that someone can run across several sites with same GUI, but without having to edit the script. Thank you for any ideas on this. -- 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-generalhttp://groups.google.com/group/watir-general watir-genera...@**googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-...@googlegroups.com javascript: http://groups.google.com/group/watir-general watir-genera...@googlegroups.com javascript: -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
[wtr-general] variable for a URL?
I will try my best to explain my question. Is it possible... I have several sites, they are essentially the same, (same menus, reports ect..) the GUI is identical, but data may vary. Test sites, essentially, but each site has a different URL in testing or staging environment. Because that is the case, currently, we have to edit our script and change the url each time we want to run a script to a specific site. THE QUESTION! =) could the script have a variable of some sort that looks to a field in a web page (that we're building in house) to see what site is pasted in the field and then run the script using whatever site is listed in the field? or something similar to that, but basically a universal variable for the URL that someone can run across several sites with same GUI, but without having to edit the script. Thank you for any ideas on 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
[wtr-general] Re: variable for a URL?
Would that work if URL changes a few times a day? We cut what we call a release from development and the URL contains link to our product site in the dev enviroment with the change code. So basically its a new URL for every change we do. On Tuesday, October 2, 2012 4:02:19 PM UTC-7, Dave McNulla wrote: Of course. You can store information in a yaml file, ini file, or properties file. Where I work, we use buildr with properties files that allow us to switch the system under test as easily as using a different environment variable: buildr -e test cuke where test represents a test.properties file, and cuke runs our cucumber feature files. Hope that helps, Dave On Tuesday, October 2, 2012 2:28:25 PM UTC-7, Ry wrote: I will try my best to explain my question. Is it possible... I have several sites, they are essentially the same, (same menus, reports ect..) the GUI is identical, but data may vary. Test sites, essentially, but each site has a different URL in testing or staging environment. Because that is the case, currently, we have to edit our script and change the url each time we want to run a script to a specific site. THE QUESTION! =) could the script have a variable of some sort that looks to a field in a web page (that we're building in house) to see what site is pasted in the field and then run the script using whatever site is listed in the field? or something similar to that, but basically a universal variable for the URL that someone can run across several sites with same GUI, but without having to edit the script. Thank you for any ideas on 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
Re: [wtr-general] Assert a date format with Watir
Still stumped on this. Trying to assert or verify a date format is coming back correctly. Given /^that I enter a false date or incorrect format$/ do ie.text_field(:id, 'date_range_1').set('02292011') ie.text_field(:id, 'date_range_2').set('06122012') end When /^I click go$/ do ie.button(:name, 'go').click end Then /^I will see the date auto correct to a new format$/ do THIS IS WHERE I AM STUCK -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
[wtr-general] Assert a date format with Watir
anyone familiar with how to write an assertion for a date format. For instance, I am testing a date field to ensure it doesn't accept bad formatting or unreal dates. Our page will auto revert the date to something recent when the page refreshes so I want to write an assert to say I expect mm/dd/2012 -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Assert a date format with Watir
Given /^that I enter a false date or incorrect format$/ do ie.form(:id, 'options-for-RTK::VOD::Reports::XtnsByProvider').text_field(:id, 'date_range_1').set('02292011') ie.form(:id, 'options-for-RTK::VOD::Reports::XtnsByProvider').text_field(:id, 'date_range_2').set('06122012') end When /^I click go$/ do ie.button(:name, 'go').click end Then /^I will see the date auto correct to a new format$/ do assert (ie.form(:id, 'options-for-RTK::VOD::Reports::XtnsByProvider').text_field(:id, 'date_range_1').exists('**/**/2012') end in the first step 02 29 2011 is not a valid date, so in the second step, we have a button 'GO' that regenerates the page. What is expected to happen is that the 02 29 2011 will revert to the first day of the most recent week, so this date will change always, so I need to validate the format mainly and confirm that it is 2012 if possible. On Friday, August 10, 2012 9:38:42 AM UTC-7, Oscar.Rieken wrote: To me this sounds like more of whatever framework you are using to actually write your tests you can probably do a regex to verify the format but without some more details of what exactly you want to compare it may be difficult to help out I would ask why are you trying to test this and what your test looks like now On Fri, Aug 10, 2012 at 12:23 PM, Ry cross...@gmail.com javascript:wrote: anyone familiar with how to write an assertion for a date format. For instance, I am testing a date field to ensure it doesn't accept bad formatting or unreal dates. Our page will auto revert the date to something recent when the page refreshes so I want to write an assert to say I expect mm/dd/2012 -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-...@googlegroups.com javascript: http://groups.google.com/group/watir-general watir-genera...@googlegroups.com javascript: -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] watir/ruby in Jenkins
I just wanted to thank everyone. I did come across and used your article at some point Zeljko, very well written and informative. I was able to learn a few things from it. Bill's comment got me to my goal though, I was using window's service. I stopped that and have generated Jenkins through java and since then all my builds are working. I do need to be able to move jenkins to a linux production box and ssh into a windows box to run scripts there, but I know that project I will be on my own for. I don't the challenge from time to time. It is how we learn. =) On Wednesday, July 18, 2012 2:37:28 AM UTC-7, Željko Filipin wrote: On Tue, Jul 17, 2012 at 4:06 PM, Ry crossan...@gmail.com wrote: Just double checked and yes the script works when launching from desktop, Ruby bash, or Windows bash. I guess I was not explicit. Are you saying watir 3.0.rc was running fine from Jenkins, and watir 3.0 does not? I had some fun with Jenkins on Windows recently, maybe it could help: http://zeljkofilipin.com/jenkins-windows-and-git/ Ž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
Re: [wtr-general] XML output from Watir
I have gotten this to install and work, except the duration doens't work. (always 0s) Any ideas? On Thursday, July 5, 2012 12:22:28 PM UTC-7, Oscar.Rieken wrote: or there is --format json --out cucumber.json then you just need to add this plugin to your jenkins server https://github.com/masterthought/jenkins-cucumber-jvm-reports-plugin-java [image: Inline image 1] On Thu, Jul 5, 2012 at 12:40 PM, Željko Filipin zel...@filipin.eu wrote: On Thu, Jul 5, 2012 at 6:29 PM, Ry crossan...@gmail.com wrote: Which library would be most helpful that I should invest time learning to use for XML output from a watir script. Cucumber[1] has --format junit option that will create xml reports. ci_reporter[2] creates xml reports for cucumber, rspec, test/unit and minitest. [1] http://cukes.info/ [2] https://github.com/nicksieger/ci_reporter Željko -- filipin.eu -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] watir/ruby in Jenkins
On Tuesday, July 17, 2012 12:48:28 AM UTC-7, Željko Filipin wrote: On Tue, Jul 17, 2012 at 3:29 AM, Ry crossan...@gmail.com wrote: Yes I was previously on Watir 3.0 r3 Just double checked and yes the script works when launching from desktop, Ruby bash, or Windows bash. Does the script work fine with that Watir version? Ž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
Re: [wtr-general] watir/ruby in Jenkins
Thank you so much for that information.. I am already reading into the wiki links you attached. I wonder though if there is a better product to run automation with Watir in a windows enviroment than Jenkins? or just better to go with Linux and run headless? On Tuesday, July 17, 2012 8:18:45 AM UTC-7, bill...@gmail.com wrote: C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.7.2/lib/rautomation/window.rb:226:in `rescue in wait_until_present': Window with locator {:index=0, :hwnd=262394} doesn't exist or is not visible! (RAutomation::UnknownWindowException) Since the exception seems to be in a part of the test where you're using RAutomation to work with the GUI, it's probably an issue with the script not being able to access the interactive desktop. This is a common problem with remotely launching GUI tests on Windows. There are a few types of solutions, though. How I worked around this was to: - Leave a Windows user logged in at all times (with the desktop showing, not locked) - Make sure the Jenkins agent is running as that user, using the Java command shown here: https://wiki.jenkins-ci.org/display/JENKINS/Distributed+builds#Distributedbuilds-Launchslaveagentheadlessly Then all Jenkins jobs should run in the context of that logged-in user and your Ruby process will have full access to the desktop. GUI tests should work just as when you run them manually while logged in to Windows yourself. Other possible fixes would depend on how you are launching the Jenkins agent and what user it's running as. Note that if you're running the Jenkins agent as a Windows service, the docs they mention that it won't have GUI access by default: https://wiki.jenkins-ci.org/display/JENKINS/Distributed+builds#HavemasterlaunchslaveagentonWindows It might be possible to manually configure the service to run as a specific user and give it desktop access, though. I haven't tried that, but Windows supports certain tweaks to services' environments that might make it doable. Thanks Bill -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] watir/ruby in Jenkins
Yes I was previously on Watir 3.0 r3 I found some articles relating to .net and I had done a .net 4.0 install that day. I uninstalled all that and rebooted. I did a rebuild and new error in log relating to not seeing my content basically. Is there a trick to getting the browser to launch with Watir to Jenkins? My script runs fine outside Jenkins. My watir script #!/usr/bin/env ruby require 'watir' include Watir ie = Watir::IE.new ie.goto('https://somewebsite.com/') ie.maximize ie.bring_to_front ie.text_field(:id, 'login_id').set('providerqa_scriptrunner') ie.text_field(:id, 'password').set('froglegs') ie.button(:id, 'submit').click ie.text_field(:id, 'login_id').set('providerqa_scriptrunner') ie.text_field(:id, 'password').set('chickenfried') ie.button(:id, 'submit').click ie.text_field(:id, 'login_id').set('providerqa_scriptrunner') ie.text_field(:id, 'password').set('howdken54') ie.button(:id, 'submit').click ie.text_field(:id, 'login_id').set('providerqa_scriptrunner') ie.text_field(:id, 'password').set('5j4n3n5m5!') ie.button(:id, 'submit').click ie.text_field(:id, 'login_id').set('providerqa_scriptrunner') ie.text_field(:id, 'password').set('8djkermel') ie.button(:id, 'submit').click ie.text_field(:id, 'login_id').set('providerqa_scriptrunner') ie.text_field(:id, 'password').set('R5fo!fdRGekn5') ie.button(:id, 'submit').click jenkins log - Started by user [8mha:lh+LCABb85aBtbiIQTGjNKU4P08vOT+vOD8nVc83PyU1x6OyILUoJzMv2y+/JJUBAhiZGBgqihhk0NSjKDWzXb3RdlLBUSYGJk8GtpzUvPSSDB8G5tKinBIGIZ+sxLJE/ZzEvHT94JKizLx0a6BxUmjGOUNodHsLgAzOEgYu/dLi1CL9vNKcHACFIKlWvw== [0manonymous Building in workspace C:\jobs\Build Test\workspace [workspace] $ cmd /c call C:\Users\QASCRI~1\AppData\Local\Temp\hudson2061048420566510151.bat C:\jobs\Build Test\workspaceAPSEC_03.rb C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.7.2/lib/rautomation/window.rb:226:in `rescue in wait_until_present': Window with locator {:index=0, :hwnd=262394} doesn't exist or is not visible! (RAutomation::UnknownWindowException) from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.7.2/lib/rautomation/window.rb:224:in `wait_until_present' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.7.2/lib/rautomation/window.rb:161:in `maximize' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.0.0/lib/watir-classic/ie-class.rb:427:in `maximize' from C:/jobs/Build Test/workspace/APSEC_03.rb:8:in `main' C:\jobs\Build Test\workspaceexit 1 Build step 'Execute Windows batch command' marked build as failure Finished: FAILURE On Saturday, July 14, 2012 12:35:30 AM UTC-7, Željko Filipin wrote: On Fri, Jul 13, 2012 at 10:32 PM, Ry crossan...@gmail.com wrote: I just updated my watir to latest, but script is failing in jenkins build. Please provide the code that causes the error message. From what version of watir did you upgrade to 3.0? You can uninstall old versions of watir gem with gem cleanup (without quotes). It looks to me that error message says it could not find the IE window. Željko -- filipin.eu -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
[wtr-general] watir/ruby in Jenkins
I just updated my watir to latest, but script is failing in jenkins build. the log looks like its still trying to use classic watir and rautomation 0.7.2? is that right? do I need to do something to force my script to use the newest watir 3.0.0? *https://gist.github.com/3107219*https://gist.github.com/3107219is my log If I run simple scripts like hello world than those builds pass, but any script that involves watir and launching browsers appear to fail for me. -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] XML output from Watir
trying to install this plug in, but downloaded the 2 most recent zips and extracted, but no .hpi file? How do I obtain the hpi file needed for jenkins to install this? On Thursday, July 5, 2012 12:22:28 PM UTC-7, Oscar.Rieken wrote: or there is --format json --out cucumber.json then you just need to add this plugin to your jenkins server https://github.com/masterthought/jenkins-cucumber-jvm-reports-plugin-java [image: Inline image 1] On Thu, Jul 5, 2012 at 12:40 PM, Željko Filipin zel...@filipin.eu wrote: On Thu, Jul 5, 2012 at 6:29 PM, Ry crossan...@gmail.com wrote: Which library would be most helpful that I should invest time learning to use for XML output from a watir script. Cucumber[1] has --format junit option that will create xml reports. ci_reporter[2] creates xml reports for cucumber, rspec, test/unit and minitest. [1] http://cukes.info/ [2] https://github.com/nicksieger/ci_reporter Željko -- filipin.eu -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
[wtr-general] XML output from Watir
2 parter question. Which library would be most helpful that I should invest time learning to use for XML output from a watir script. We want to output the script details so that Jenkins can handle the data. Also, my company wants the XML format to be specific. below are my two options. ?xml version=1.0 encoding=UTF-8? testsuites disabled= errors= failures= name= tests= time= testsuite disabled= errors= failures= hostname= id= name= package= skipped= tests= time= timestamp= properties property name= value=/ property name= value=/ /properties testcase assertions= classname= name= status= time= skipped/ error message= type=/ error message= type=/ failure message= type=/ failure message= type=/ system-out/ system-out/ system-err/ system-err/ /testcase testcase assertions= classname= name= status= time= skipped/ error message= type=/ error message= type=/ failure message= type=/ failure message= type=/ system-out/ system-out/ system-err/ system-err/ /testcase system-out/ system-err/ /testsuite testsuite disabled= errors= failures= hostname= id= name= package= skipped= tests= time= timestamp= properties property name= value=/ property name= value=/ /properties testcase assertions= classname= name= status= time= skipped/ error message= type=/ error message= type=/ failure message= type=/ failure message= type=/ system-out/ system-out/ system-err/ system-err/ /testcase testcase assertions= classname= name= status= time= skipped/ error message= type=/ error message= type=/ failure message= type=/ failure message= type=/ system-out/ system-out/ system-err/ system-err/ /testcase system-out/ system-err/ /testsuite /testsuites or the short form testsuites testsuite name=MyTests testcase classname=MyTestCase0 name=Initial Setup / testcase classname=MyTestCase1 name=Trying test procedure 1 failure message=failure type=failed / /testcase /testsuite /testsuites -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] XML output from Watir
Thank you much! I do have the Cucumber book, I have not had a chance to read into it though. I will do that and look into the other option as well. On Thursday, July 5, 2012 9:40:00 AM UTC-7, Željko Filipin wrote: On Thu, Jul 5, 2012 at 6:29 PM, Ry crossan...@gmail.com wrote: Which library would be most helpful that I should invest time learning to use for XML output from a watir script. Cucumber[1] has --format junit option that will create xml reports. ci_reporter[2] creates xml reports for cucumber, rspec, test/unit and minitest. [1] http://cukes.info/ [2] https://github.com/nicksieger/ci_reporter Željko -- filipin.eu -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
[wtr-general] win32/screenshot and test/unit logging conflict?
I can run this script https://gist.github.com/2228176 with taking screen shots or removing those features and have the script log, but if I put both features in as you see in https://gist.github.com/2228176 I receive an error C:/Ruby192/lib/ruby/1.9.1/fileutils.rb:1279:in `initialize': No such file or dir ectory - C:Watir\apsec01_ode.png (Errno::ENOENT) from C:/Ruby192/lib/ruby/1.9.1/fileutils.rb:1279:in `open' from C:/Ruby192/lib/ruby/1.9.1/fileutils.rb:1279:in `block in copy_file' from C:/Ruby192/lib/ruby/1.9.1/fileutils.rb:1278:in `open' from C:/Ruby192/lib/ruby/1.9.1/fileutils.rb:1278:in `copy_file' from C:/Ruby192/lib/ruby/1.9.1/fileutils.rb:473:in `copy_file' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mini_magick-3.2.1/lib/mini_magi ck.rb:290:in `write' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/win32screenshot-1.0.7/lib/win32 /screenshot/image.rb:38:in `write' from sh.rb:13:in `main' H:\CorpIT\IT DocLib\Quality Assurance\AAA_Validation\Watir\IE\APSECruby sh.rb C:/Ruby192/lib/ruby/1.9.1/fileutils.rb:1279:in `initialize': No such file or dir ectory - C:Watir/apsec01_ode.png (Errno::ENOENT) from C:/Ruby192/lib/ruby/1.9.1/fileutils.rb:1279:in `open' from C:/Ruby192/lib/ruby/1.9.1/fileutils.rb:1279:in `block in copy_file' from C:/Ruby192/lib/ruby/1.9.1/fileutils.rb:1278:in `open' from C:/Ruby192/lib/ruby/1.9.1/fileutils.rb:1278:in `copy_file' from C:/Ruby192/lib/ruby/1.9.1/fileutils.rb:473:in `copy_file' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mini_magick-3.2.1/lib/mini_magi ck.rb:290:in `write' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/win32screenshot-1.0.7/lib/win32 /screenshot/image.rb:38:in `write' from sh.rb:13:in `main' -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
[wtr-general] Re: Watir + win32/screenshot = screen shots when script ends/fails?
Thanks for the tip Jarmo, Any reason you can think of to why I am unable to run the screenshot function with test_unit_loader.rb I have it set up like this gem 'test-unit' require 'test/unit' require 'ci/reporter/rake/test_unit_loader.rb' require 'watir' class ASPEC01_log Test::Unit::TestCase include Watir def test_me ie = Watir::IE.new Script runs fine with unit loader alone or with win32screenshot alone, but together they break. On Wednesday, March 28, 2012 1:58:35 PM UTC-7, Jarmo Pertman wrote: Use window handle instead of title if possible: Win32::Screenshot::Take.of(:window, :hwnd = browser.hwnd).write(screenshot) Or if you're using some newer Watir, then use :rautomation attribute instead: Win32::Screenshot::Take.of(:rautomation, browser.rautomation).write(screenshot) Jarmo On Mar 28, 12:12 am, enroxorz enrique.j.ma...@gmail.com wrote: No worries, any time :) On Tuesday, March 27, 2012 4:23:33 PM UTC-4, Ry wrote: that worked perfectly! Thank you ever so much! On Tuesday, March 27, 2012 9:23:21 AM UTC-7, Ry wrote: Wondering if possible to snap shot the last screen / event my script was on when it finds an error / ends. I am using logging as well, but my employer is requesting screen shots to go hand in hand with the logs to show other users where the error on sites are. I pinged irc and got response that cucumber is good for this. I have seen the article on watirmelon site, but I am not using cucumber unfortunately. I am hoping to continue using watir in it's purest form. Thanks for any examples, leads, or suggestions that might stir me to my goal. Ry -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
[wtr-general] Watir + win32/screenshot = screen shots when script ends/fails?
Wondering if possible to snap shot the last screen / event my script was on when it finds an error / ends. I am using logging as well, but my employer is requesting screen shots to go hand in hand with the logs to show other users where the error on sites are. I pinged irc and got response that cucumber is good for this. I have seen the article on watirmelon site, but I am not using cucumber unfortunately. I am hoping to continue using watir in it's purest form. Thanks for any examples, leads, or suggestions that might stir me to my goal. Ry -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
[wtr-general] Re: Watir + win32/screenshot = screen shots when script ends/fails?
that worked perfectly! Thank you ever so much! On Tuesday, March 27, 2012 9:23:21 AM UTC-7, Ry wrote: Wondering if possible to snap shot the last screen / event my script was on when it finds an error / ends. I am using logging as well, but my employer is requesting screen shots to go hand in hand with the logs to show other users where the error on sites are. I pinged irc and got response that cucumber is good for this. I have seen the article on watirmelon site, but I am not using cucumber unfortunately. I am hoping to continue using watir in it's purest form. Thanks for any examples, leads, or suggestions that might stir me to my goal. Ry -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
[wtr-general] Re: screenshots with watir (not webdriver)
hilary did you find an answer to your issue? I have the same problem. I know it is related to win32screenshot because if I remove it from script, than script is fine. I am using Watir 2, no webdriver Error: test_me(My_test) LoadError: no such file to load -- watir/ie wet.rb:12:in `test_me' 9: include Watir 10: 11: def test_me = 12: ie = Watir::IE.new 13: then my list of gems *** LOCAL GEMS *** actionmailer (3.2.1) actionpack (3.2.1) activemodel (3.2.1) activerecord (3.2.1) activeresource (3.2.1) activesupport (3.2.1) arel (3.0.0) builder (3.0.0) bundler (1.0.21) cheri (0.5.0) childprocess (0.3.0) ci_reporter (1.7.0) coffee-rails (3.2.2) coffee-script (2.2.0) coffee-script-source (1.2.0) commonwatir (2.0.4) crypt (1.1.4) cucumber (1.1.9, 1.1.4) diff-lcs (1.1.3) domain_name (0.5.2) erubis (2.7.0) execjs (1.3.0) ffi (1.0.11) firewatir (1.9.4) gem_plugin (0.2.3) gherkin (2.9.0 x86-mingw32, 2.7.6 x86-mingw32) git (1.2.5) hike (1.2.1) hoe (2.14.0) hpricot (0.8.6) i18n (0.6.0) jar_wrapper (0.1.2) jeweler (1.8.3) journey (1.0.1) jquery-rails (2.0.0) json (1.6.5) logger (1.2.8) mail (2.4.1) mechanize (2.3) mime-types (1.17.2) mini_magick (3.4, 3.2.1) minitest (2.11.1, 1.6.0) multi_json (1.0.4) net-http-digest_auth (1.2) net-http-persistent (2.5.2) nokogiri (1.5.0 x86-mingw32) ntlm-http (0.1.1) polyglot (0.3.3) rack (1.4.1) rack-cache (1.1) rack-ssl (1.3.2) rack-test (0.6.1) rails (3.2.1) railties (3.2.1) rake (0.9.2.2, 0.8.7) rautomation (0.7.2, 0.6.3) rdoc (3.12, 2.5.8) rspec (2.9.0, 2.8.0) rspec-core (2.9.0, 2.8.0) rspec-expectations (2.9.0, 2.8.0) rspec-mocks (2.9.0, 2.8.0) rubygems-update (1.8.20) rubyzip (0.9.5) s4t-utils (1.0.4) sass (3.1.14) sass-rails (3.2.4) selenium (0.2.5) selenium-webdriver (2.19.0, 2.18.0) shoes (3.0.1) sprockets (2.1.2) sqlite3 (1.3.5 x86-mingw32) subexec (0.2.1, 0.0.4) term-ansicolor (1.0.7) test-unit (2.4.8) thor (0.14.6) tilt (1.3.3) treetop (1.4.10) tzinfo (0.3.31) uglifier (1.2.3) unf (0.0.5) unf_ext (0.0.4 x86-mingw32) user-choices (1.1.6.1) watir (2.0.4) watir-webdriver (0.5.3) webrobots (0.0.13) win32-api (1.4.8 x86-mingw32) win32-process (0.6.5) win32screenshot (1.0.7) windows-api (0.4.1) windows-pr (1.2.1) wxruby-ruby19 (2.0.1 x86-mingw32) xml-simple (1.1.1) zip (2.0.2) On Wednesday, February 22, 2012 10:50:58 AM UTC-8, hillary wrote: is there a built in method for taking screenshots with watir? either 2.0 or 3.0. -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] nested selection - script passes, but selection does not change
Hi Zeljko, the class states it is a java-menu, but likely it makes sense for it to be a java script menu. I have not had luck with steps in the link, but I'm going to continue trying to see if I can produce something. I see this is the source when I inspect on the menu span title=Network providing the title or asset. div id=provider_no_tree_option_hidden_param_container style=display:none; table cellspacing=0 cellpadding=0 tbody tr td/td td class=java-menu div id=provider_no_tree_filter class=treeoption-container treeOptionContents treeoption-container-openedAll Networks/div /td I'm attaching a screenshot of the filter/menu to hopefully provide a better visual of what I am trying to select. I also purchase your book just now under a different email cause of my paypal account. I look forward to reading through that material. I got involved with Watir too late to go to this years summit, but am already approved with my company to attend next year, even if its outside the states. Thank you again for looking at my question. -- 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 attachment: menu.PNG
[wtr-general] nested selection - script passes, but selection does not change
I have been trying to access a java-menu that has a selection in the collapsed tree that I wish to select. I am not receiving an error, the script passes, but the selection is not changing. Any ideas? https://gist.github.com/2136878 also to see the html of the window I am attempting to access https://gist.github.com/2137096 -- 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