[wtr-general] Re: Differences in behavior between IE and FF3/3.5
I don't think you can use :alt in FireWatir to identify the control - use xpath instead and it should work in both IE and FF with no changes: browser.element_by_xpath(//i...@alt = 'Members Login Here']).click Regards, John --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: Data driven test using .CSV file
Hi Chris, Your idea of implemnting a CSV based framework is very nice. It used a lot in my current framework. - Thanks Regards Siva On Jul 27, 10:56 am, takanobu watanabe rreedd...@gmail.com wrote: Sorry spread it. This is that CSV sample. -- ID,mnemonic,var-name,value 1,companycode,company_code,51236 2,companyname,company_name,Watir corp 3,company-zip-code,zip_code,111011 4,company-prefecture,select_prefecture,MA 5,company-prefecture for update,select_prefecture2,TT 6,company address,address_district,Gossam city -- Just last var is used. On Mon, Jul 27, 2009 at 2:47 PM, takanobu watanaberreedd...@gmail.com wrote: miscode mhc = Array::new | V company = Array::new On Mon, Jul 27, 2009 at 2:46 PM, takanobu watanaberreedd...@gmail.com wrote: I use CSV like that below -import.rb-(csv import)- #! ruby -Ku #!/usr/bin/env ruby require 'csv' $KCODE = 'UTF8' #import company-data settings mhc = Array::new CSV.foreach(data/company_var.csv) do |row| company Kconv.kconv(row.join(','),Kconv::UTF8) end $company_code = company[1].split(',').last.to_s $company_name = company[2].split(',').last.to_s $zip_code = company[3].split(',').last.to_s $select_prefecture = company[4].split(',').last.to_s $select_prefecture2 = company[5].split(',').last.to_s $address_district = company[6].split(',').last.to_s something like that. then you can use that values -Test case file- require 'import' some test code... $company_name... But,Maybe someone knows more simple and smart way. Hope it help you. It is work,I use it for job too. tknv/ On Mon, Jul 27, 2009 at 1:39 AM, Chris McMahonchristopher.mcma...@gmail.com wrote: On Jul 25, 9:03 am, RAM rahulbhai...@gmail.com wrote: Hi allI am very new to Watiranybody here knows how to import value from .CSV files and Export Results into an .CSV file in Watir. Please reply and provide links if similar subject is already posted. I wrote a toy framework that does exactly this: http://chrismcmahonsblog.blogspot.com/2009/04/ui-test-framework-desig... Please let us know if that is useful. -Chris -- tknv/ -- tknv/ -- tknv/- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] How to debug Watir code line by line.
Hi All, I wrote script for data driven testing with logger. I want to debug the same script line by line. Please tell me how to debug the script line by line. Thanks in advance. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: Java port for Watir
Manish, I've tried watij and it has a serious problem with the tables in my web application. I need a utility for java. On Mon, Jul 27, 2009 at 7:54 AM, Manish Sapariya man...@gslab.com wrote: to be technically correct, celerity itself is not headless browser, but watir api driving headless browser 'htmlunit'. -Manish Manish Sapariya wrote: Did you try watij http://watij.com/ I don't have first hand experience but its java port of watir. Another thing you can try out is celerity, which is headless browser. http://celerity.rubyforge.org/ -Manish ghidu wrote: After trying few web testing tools I've decided to stick with watir. The only problem is I've already have an application written in java and I want to incorporate watir into it. I tried using jruby, but I keep getting 'no such file to load - watir'. Watij doesn't work with the table rows in the web application, but watir does. Any advice? Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Testing Link on list of pages
I am writing a script to check links on a specific page. I am getting the list of pages(URL’s) from an excel file. The issue that I am facing is once the loop starts and an exception is encountered the execution stops, so I have put a ‘retry’ in the exception section. But the issue is it again starts the whole loop execution. Eg. In the excel file I have stored 5 URL’s to test and exception is encountered at 3 URL then the loop starts from the 1 URL again. I want it to start from 4th URL of the excel file (not from 3rd since I know there is some issue as the expectation was raised) = The script that I have written: xlFile = XLS.new(C:/LinkChecker/Data/BusinessUnits.xls) CreateBU = xlFile.getRowRecords('create_bu','create_bu') $ie = IE.new $ie.goto(url to my application) Login($username,$pwd) begin CreateBU.each do |record| i =0 $ie.goto(record['BUName']) links = Array.new $ie.links.each do |link| $ie.goto(link.href) if(i 0) $ie.goto(record['BUName']) puts i end i = i + 1 end sleep(5) end end rescue Exception = msg puts(The exception is + msg) retry ensure close_resultFile($result) xlFile.close end --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] verify table cell text.
Hi, I Srikanth, new user of watir, I am using execution tool itest2 and recording scripts with watir. I have the somefollowing issues: 1)how to get text form table cell . 2)how to verify the table cell text using include? or match methods or any other solution. 3) if there any material or user guide for the same.please send me. Please give a solution as possible as. thnx Srikanth --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: How to debug Watir code line by line.
There are a couple of routes you can take on this: * use ruby-debug - it's a lighter weight debugger that you can insert into your script, it bumps you out into irb within the context of where you called it, here's a tutorial: http://www.datanoise.com/articles/2006/7/12/tutorial-on-ruby-debug * use an ide - Aptana, Netbeans, Rubymine all have facilities for debugging, read up on the help docs for your ide if you're using one, example of Aptana's debug view: http://www.aptana.com/docs/index.php/Ruby_Debug_Views * write unit tests for your code - you expect developers to write unit tests for production code, if you're writing test code, you should do the same Generally, people writing Ruby code - myself included - don't use the 2nd approach as it's fairly heavyweight and the same if not better results can be accomplished by the first and third options. I don't use an ide, so I use a combination of 13. YMMV. HTH, Charley Baker blog: http://blog.charleybaker.org/ Lead Developer, Watir, http://wtr.rubyforge.org QA Architect, Gap Inc Direct On Mon, Jul 27, 2009 at 5:12 AM, Swap swapnal.sa...@gmail.com wrote: Hi All, I wrote script for data driven testing with logger. I want to debug the same script line by line. Please tell me how to debug the script line by line. Thanks in advance. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: Testing Link on list of pages
Put your begin and rescue inside the loop and remove the retry. Charley Baker blog: http://blog.charleybaker.org/ Lead Developer, Watir, http://wtr.rubyforge.org QA Architect, Gap Inc Direct On Mon, Jul 27, 2009 at 5:24 AM, Satya satyajit.prad...@gmail.com wrote: I am writing a script to check links on a specific page. I am getting the list of pages(URL’s) from an excel file. The issue that I am facing is once the loop starts and an exception is encountered the execution stops, so I have put a ‘retry’ in the exception section. But the issue is it again starts the whole loop execution. Eg. In the excel file I have stored 5 URL’s to test and exception is encountered at 3 URL then the loop starts from the 1 URL again. I want it to start from 4th URL of the excel file (not from 3rd since I know there is some issue as the expectation was raised) = The script that I have written: xlFile = XLS.new(C:/LinkChecker/Data/BusinessUnits.xls) CreateBU = xlFile.getRowRecords('create_bu','create_bu') $ie = IE.new $ie.goto(url to my application) Login($username,$pwd) begin CreateBU.each do |record| i =0 $ie.goto(record['BUName']) links = Array.new $ie.links.each do |link| $ie.goto(link.href) if(i 0) $ie.goto(record['BUName']) puts i end i = i + 1 end sleep(5) end end rescue Exception = msg puts(The exception is + msg) retry ensure close_resultFile($result) xlFile.close end --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Getting style attribute of HTML element
I have an element with a style attribute I need to access, like this: div id=search class=absolute hide style=display: block; ... /div Note that I am only able to see the style attribute using Firebug; it doesn't show up when I view the page source. Is it possible though to examine the style attribute through Watir? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: Java port for Watir
Celerity is a good option, otherwise I believe you should be able to use Firewatir from the latest on Github: http://github.com/bret/watir/tree/master Charley Baker blog: http://blog.charleybaker.org/ Lead Developer, Watir, http://wtr.rubyforge.org QA Architect, Gap Inc Direct On Mon, Jul 27, 2009 at 12:18 AM, Adrian Ghidu agh...@gmail.com wrote: Manish, I've tried watij and it has a serious problem with the tables in my web application. I need a utility for java. On Mon, Jul 27, 2009 at 7:54 AM, Manish Sapariya man...@gslab.com wrote: to be technically correct, celerity itself is not headless browser, but watir api driving headless browser 'htmlunit'. -Manish Manish Sapariya wrote: Did you try watij http://watij.com/ I don't have first hand experience but its java port of watir. Another thing you can try out is celerity, which is headless browser. http://celerity.rubyforge.org/ -Manish ghidu wrote: After trying few web testing tools I've decided to stick with watir. The only problem is I've already have an application written in java and I want to incorporate watir into it. I tried using jruby, but I keep getting 'no such file to load - watir'. Watij doesn't work with the table rows in the web application, but watir does. Any advice? Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: Getting style attribute of HTML element
You should be able to access it like this: ie.div(:id, 'search').document.currentStyle.invoke('display') Charley Baker blog: http://blog.charleybaker.org/ Lead Developer, Watir, http://wtr.rubyforge.org QA Architect, Gap Inc Direct On Mon, Jul 27, 2009 at 8:44 AM, Aaron MacDonald aa...@genieknows.comwrote: I have an element with a style attribute I need to access, like this: div id=search class=absolute hide style=display: block; ... /div Note that I am only able to see the style attribute using Firebug; it doesn't show up when I view the page source. Is it possible though to examine the style attribute through Watir? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: wants to access ie object in someother class or script
You should take a look at some basic ruby tutorials, google for the Pickaxe book which is free and available online. You need to pass the variable into your class or initialize it in the class, you're currently using a combination of instance variable - @ie - inside your class and ie : require 'watir' ie = Watir::IE.new #Open the application ie.goto https://google.com; class Fun def initialize browser @ie = browser end def as @ie.text_field(:name,q).set #textdata end end fun1= Fun.new ie fun1.as Charley Baker blog: http://blog.charleybaker.org/ Lead Developer, Watir, http://wtr.rubyforge.org QA Architect, Gap Inc Direct On Mon, Jul 27, 2009 at 5:48 AM, Akash S akash1...@gmail.com wrote: Hi All, I am very new to watir, i am using watir for automation i have written following code for opening browser require Watir ie = Watir::IE.new #Open the application ie.goto https://google.com; enter some text in Fun class , class Fun def as @ie.text_field(:name,q).set #textdata end end now when i call this, it throws error. so i want to know to access ie object in some other class or script fun1= Fun.new fun1.as Thanks in advance --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: verify table cell text.
For Page (http://itest2.com/demo/survey) with html, table cellpadding=1 cellspacing=1 width=100% tr td/td td id=surveyId align=rightA101/td /tr /table 1)how to get text form table cell . browser.cell(:id, surveyId).text 2)how to verify the table cell text using include? or match browser.cell(:id, surveyId).text.should == A101 3) if there any material or user guide for the same.please send me. http://wiki.openqa.org/display/WTR/Methods+supported+by+Element Cheers, Zhimin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: Does watir support i18n testing?
Watir supports i18n, I have been using it to test a web site in chinese. I couldn't paste the sample here. But had no luck with FireWatir, it seems JSSH not supporting i18n. If you want to give a try, download iTest2 (http://itest2.com), open project c:\Program Files\iTest2\samples\demo\demo.tpr Run chinese_spec.rb Zhimin On Jul 24, 3:02 pm, Krapa krapa.ph...@gmail.com wrote: Hi, How to test i18n (Chines, Japanies etc...) applications using watir? Do we have any approach for it? Does watir support it? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: wants to access ie object in someother class or script
Hi All, The other option that can be useful is pass the instance of IE as an argument to the method. So it can be something like this : LIBRARY : class Fun def as (ie,textdata) @ie.text_field(:name,q).set #textdata end end CALLING SCRIPT : require 'watir' ie=Watir::IE.new a=Fun.new a.as(ie,Rohan) This is what I have been using rather than declaring the object of IE as global.But you will have to pass this object as an argument to every method then. Thanks, Rohan Ojha Blue Star Infotech l*+91 900 4955058l * +91 22 6688 6969 l 6 +91 22 6688 6999 l * mailto:rohan.o...@bsil.com rohan.o...@bsil.com http://www.bsil.com/ www.bsil.com - Where Partnerships Are Built on Trust _ From: watir-general@googlegroups.com [mailto:watir-gene...@googlegroups.com] On Behalf Of Charley Baker Sent: Monday, July 27, 2009 8:23 PM To: watir-general@googlegroups.com Subject: [wtr-general] Re: wants to access ie object in someother class or script You should take a look at some basic ruby tutorials, google for the Pickaxe book which is free and available online. You need to pass the variable into your class or initialize it in the class, you're currently using a combination of instance variable - @ie - inside your class and ie : require 'watir' ie = Watir::IE.new #Open the application ie.goto https://google.com https://google.com/ class Fun def initialize browser @ie = browser end def as @ie.text_field(:name,q).set #textdata end end fun1= Fun.new ie fun1.as http://fun1.as/ Charley Baker blog: http://blog.charleybaker.org/ Lead Developer, Watir, http://wtr.rubyforge.org QA Architect, Gap Inc Direct On Mon, Jul 27, 2009 at 5:48 AM, Akash S akash1...@gmail.com wrote: Hi All, I am very new to watir, i am using watir for automation i have written following code for opening browser require Watir ie = Watir::IE.new #Open the application ie.goto https://google.com; enter some text in Fun class , class Fun def as @ie.text_field(:name,q).set #textdata end end now when i call this, it throws error. so i want to know to access ie object in some other class or script fun1= Fun.new fun1.as Thanks in advance --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Attach failing with NoMethodError
I am setting up a new Watir env on a Win 2008 server box. The tests I have that use attach or attach_init are failing on the new box with undefined method errors (the tests pass on my existing Vista env). There must be an env issue with the new box. Does anyone have any suggestions on what I need to update, set or install to resolve this issue? Thanks, Lori 1) Error: test_generate_invoice_ach(TC_GenerateInvoice): NoMethodError: undefined method `attach' for #Watir::IE:0x4a47834 C:/Projects/fast401k/trunk/src/watir/scripts/simple/ admin/../../../lib/Utility/ie_tools.rb: 25:in `url_navigator' C:/Projects/fast401k/trunk/src/watir/scripts/simple/admin/ tc_generate_invoice.rb:132:in `te st_generate_invoice_ach' *** LOCAL GEMS *** activesupport (2.3.3) builder (2.1.2) commonwatir (1.6.2) firewatir (1.6.2) fxri (0.3.7) fxruby (1.6.19) hoe (2.3.2) hpricot (0.8.1) log4r (1.0.5) mkrf (0.2.3) ptools (1.1.6) rake (0.8.7) rubigen (1.5.2) ruby-oci8 (2.0.2) ruby-opengl (0.60.0) rubyforge (1.0.4) rubygems-update (1.3.5) s4t-utils (1.0.4) sources (0.0.1) test-unit (2.0.3) user-choices (1.1.6) watir (1.6.2) win32-api (1.4.3) win32-clipboard (0.5.2) win32-dir (0.3.4) win32-eventlog (0.5.0) win32-file (0.6.1) win32-file-stat (1.3.3) win32-process (0.6.1) win32-sapi (0.1.4) win32-service (0.7.0) win32-sound (0.4.1) windows-api (0.3.0) windows-pr (1.0.6) xml-simple (1.0.12) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] can Watir run in remote webserver with linux OS??
hi there, i have a remote linux web server can i use Watir, for say crawling websites ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---