[wtr-general] Help with Modal Dialog boxes !!!!
Hi, Has anybody come across some method with which we can work on a modal dialog window. I don't imply just closing the window but also clicking on a button within the modal dialog box and reading the content of the box as well. I am currently using 1.8.6 and Watir 1.5.2 and have read somewhere that Ruby versions prior to 1.8.6 had support for modal dialog box. Can any body please help with this ? I need to click on the Run button first and the read the content and finally click on the close. Thanks Rohan Ojha -- 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 image001.gifimage002.jpg
RE: [wtr-general] Relative path
Hi You can try this pathToTestFile = FileUtils::pwd basePath = pathToTestFile[0..(pathToTestFile.index('/Elcom'))] {Elcom is the base folder that is the outermost folder} $:.push(basePath+'Elcom/lib') {lib is the folder where I have stored my libraries} File.read(basePath+'Elcom\Elcom\test\Requistion Approval Plan\Test Data\automation.xls') {method to read the excel file which is stored } But for all this to function properly the folder structure has to be consistent throughout. Thanks Rohan Ojha -Original Message- From: Prince3105 [mailto:prince3...@gmail.com] Sent: Tuesday, December 01, 2009 10:51 AM To: Watir General Subject: [wtr-general] Relative path Hi Experts, I put my Test scripts, test data excel files and test cases file in one folder and doing testing. When i change the whole bunch to another system i am facing folder path issues. I was working QTP , where i can solve this problem by relative path. Please take a look on my below code. $excel_path = e:\\Data\\Prince\\WatIR\\iComet\\TestCases\ \StoresSpares $excel = WIN32OLE.new(excel.application) $excel['Visible'] = true; $workbook = $excel.Workbooks.Open $excel_path $worksheet = $workbook.WorkSheets(4) $worksheet.Select So after searching rdoc i found one code and it returns the current path. But am unable to open the excel file. $excel_path = Dir.getwid + \\StoresSpares it gives the current file path as below E:/Data/Prince/WatIR/iComet/TestCases\\StoresSpares So my tests are failed. I need something like below $excel_path = RelativePath+(\\StoresSpares) It may not be a watir question but i dont have more experience in ruby. So please help me to solve this issue. Thanks, Prince3105 -- You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -- 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 framework using SQL database
Hi All, I have been using this to interact with SQL Server for some time now. ( Somehow I find DBI too confusing at times :-) ) See if it can be of help to anyone of you. It uses win32ole and ADODB to work with SQL Server. Looking forward to some comments about the utility. Thanks, Rohan Ojha Associate Systems Engineer 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 Wesley Chen Sent: Friday, October 30, 2009 2:41 PM To: watir-general@googlegroups.com Subject: [wtr-general] Re: Data driven framework using SQL database Yes, it works, but I have to change Uid as User ID, Pw as password. Thanks. Wesley Chen. For life, the easier, the better. On Fri, Oct 30, 2009 at 4:53 PM, SMF SMF shaikm.fi...@gmail.com wrote: Hi Pritam, No problem. Could you please do one favor, can you post the steps/configuration you followed to connect to database that will helpful to others also. Thanks, smf On Fri, Oct 30, 2009 at 1:58 PM, Pritam pmaha...@gmail.com wrote: Hi, Thank you very much.now am able to connect to the database and retrieve the data... Thanks again. On Oct 30, 12:25 pm, SMF SMF shaikm.fi...@gmail.com wrote: you have to download the dbi files and configure them on your machine. On Fri, Oct 30, 2009 at 12:30 PM, Pritam pmaha...@gmail.com wrote: Hi, Thank you for your reply. I have executed the code that you have given, but i got the following error. C:/Ruby/lib/ruby/site_ruby/1.8/dbi.rb:368:in `load_driver': Could not load driver (no such file to load -- C:/Ruby/lib/ruby/site_ruby/1.8/ dbd/ADO) (DBI::InterfaceError) from C:/Ruby/lib/ruby/site_ruby/1.8/dbi.rb:233:in `_get_full_driver' from C:/Ruby/lib/ruby/site_ruby/1.8/dbi.rb:219:in `connect' from database.rb:5 I went to the location(C:/Ruby/lib/ruby/site_ruby/1.8/dbd/) as indicated in the error, and could find only find ODBC and Proxy folders and not ADO. Do i need to download and copy the ADO.rb file in this location in order to access the SQL database? If yes, where can i find this file... Thanks in advance On Oct 29, 4:56 pm, SMF SMF shaikm.fi...@gmail.com wrote: Hi Pritam, Answer to your *question 1.* require 'dbi' DB = Provider=SQLOLEDB.1;Server=servername;Database=DBname;Uid=userid;Pw=pas sword sql = select LoginID from Login WHERE UserName ='xyz' DBI.connect(DBI:ADO:#{DB}) do | dbh | dbh.select_all( sql ) do |row| puts row[0] # the first field #puts row[1] # the second field end end No idea, about framework or architecture Thanks On Thu, Oct 29, 2009 at 5:03 PM, Pritam pmaha...@gmail.com wrote: Hi guys, I am new to ruby programming, and I need help in developing data driven framework which uses sql database for retrieving data. I have seen a lot of examples over internet which showed how to do it using excel and open source applications. To start with I need information for the following. 1. How to connect to a sql database using ruby/watir scripts? 2. What sought of architecture am I looking for? 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 -~--~~~~--~~--~--~--- sqlServerConn.rb Description: Binary data
[wtr-general] Re: Need to print results of Mulitple scripts in one HTML file
Hi, Another alternative would be to call the HTML report class from the rake itself rather than individual scripts. (just an alternate suggestion :-)) 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 Prajakta Jadhav Sent: Friday, October 09, 2009 10:50 AM To: watir-general@googlegroups.com Subject: [wtr-general] Re: Need to print results of Mulitple scripts in one HTML file Shouldn't be a problem. Open the same html file in both the scripts for logging the results. It will log the results one after another in the same html file. -Prajakta On Fri, Oct 9, 2009 at 10:31 AM, Bindhu udayarekha2...@gmail.com wrote: Hi All, In batch file I have included 2 scripts to be executed. After a successful execution of this batch I want to print the results in one HTML file. As of now I am able to print the one HTML file for one script. But I want a single HTML file to be printed for multiple scripts which I have inculded on batch file. Please guide me. Right now I am using the code which is available in wiki.. 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: need a command to check for a feild is visible ornot
If you want to check whether a given object is visible in the UI of the page then you can try: ie.hidden (:attribute, property).visible? ==false then puts 'Object is hidden' else puts 'Object is not hidden' end Note that you have to use hidden instead of text_field or button 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 ravi pulipaka Sent: Tuesday, September 22, 2009 6:29 AM To: watir-general@googlegroups.com Subject: [wtr-general] Re: need a command to check for a feild is visible ornot I have tried visible?.should be false but it didnt work On Mon, Sep 21, 2009 at 8:19 PM, orde ohil...@gmail.com wrote: Maybe something like: browser.text_field(:id, 'id').visible? http://wtr.rubyforge.org/rdoc/classes/Watir/Element.html#M000318 Hope that helps. On Sep 21, 1:31 pm, ravi ravi8...@gmail.com wrote: I have a situation I have a text box which pops up when I select a option from a selectlist above it, otherwise is is not visible on the screen if I use the command available in watir eval(browser.field).should_not exist - it fails if i say should exist ---it passes I think it is in the dom can you suggest me any options Thanx in advance regards ravi --~--~-~--~~~---~--~~ 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: Script hangs while trying to close pop up
I have found that one important thing that people miss out on is that Ruby 1.8.6.27 doesn’t support click_no_wait. So I hope you are not using this version of Ruby. If yes then try with Ruby 1.8.6.26 Also always use sleep after click_no_wait and the pop-up handler method Thanks, Rohan Ojha -Original Message- From: watir-general@googlegroups.com [mailto:watir-gene...@googlegroups.com] On Behalf Of Namit Sent: Wednesday, August 26, 2009 11:35 AM To: Watir General Subject: [wtr-general] Re: Script hangs while trying to close pop up Thanks a lot Tiffany for your reply, I tried other things too too like dialog.button('Cancel').click , click_no_wait and I tried Auto it etc but of no use. I am working on in further, will get back to you if I find something useful. By the way do you think that the script that I have posted above is incorrect or I need to modify it. Thanks Namit On Aug 25, 8:30 pm, tcfodor tcfo...@comcast.net wrote: Hi Namit, You may have already looked here, but the bulk of the knowledge on Watir and popups can be found here: http://wiki.openqa.org/display/WTR/Pop+Ups Off the top of my head, it seems like there were cases where we needed to use click_no_wait instead of just click to avoid hanging. Hope this helps! -Tiffany On Aug 25, 7:05 am, Namit namitjai...@gmail.com wrote: Hi All, My scenario is to click a image that results in a pop up. I want to click OK button of this Pop up. This is a straight scenario without much complexity still the script is not working and the pop up remains as it is. Here is my sample script require 'watir' require 'win32ole' require 'watir/ie' require 'watir\contrib\enabled_popup' $ie = Watir::IE.new $ie.goto 'some url/' $ie.button(:src, 'http://img1.yatra.com/yatra_blue-theme/images/common/ spacer.gif').click sleep 10 if $ie.enabled_popup puts 'inside if loop' hwnd =$ie.enabled_popup(10) puts hwnd w = WinClicker.new w.makeWindowActive(hwnd) w.clickWindowsButton_hwnd(hwnd,OK) end This script after clicking the image hangs and after this there is no action performed. The pop is a simple pop up with an OK button. Guys please tell me where I am going wrong. Any help will be highly appreciated Thanks Namit --~--~-~--~~~---~--~~ 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: query regarding destination of picture save
Hi, Try using thissee if it can be of any help require 'watir' ie=Watir::IE.new ie.goto(http://twitter.com;) id=1 q=ie.images.length while id=q fname='D:\image-' + id.to_s + '.gif' ie.image(:index,id).save(fname) id=id+1 end Thanks, Rohan Ojha --~--~-~--~~~---~--~~ 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 get the Scite editor's error message in anotepad?
Hi, You can use the inbuilt logger method if you want to dump your error messages in a notepad. require 'watir' require 'logger' ie = Watir::IE.new ie.goto('www.google.com') log=Logger.new('c:/errorlog.txt') if ie.text_field(:name,'q1').exists? then ie.text_field(:name,'q1').set('Log') else log.error 'Text field with name q1 not found' end Hope this helps. Thanks, Rohan Ojha -Original Message- From: watir-general@googlegroups.com [mailto:watir-gene...@googlegroups.com] On Behalf Of Prince3105 Sent: Saturday, August 01, 2009 11:16 AM To: Watir General Subject: [wtr-general] How to get the Scite editor's error message in anotepad? Hi i am a newbie to Watir, Just i want to collect the log messages from the Scite editor and save in a notepad. If any methods are available to do that please post. Thanks, Prince3105 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Help with class,method,objects
Hi All, I am not too sure whether I should post it here or in a Ruby forum. But there is a problem that I am facing while scripting a data driven Watir suite. 1) I have a class (say the base class) wherein I am fetching data from excel and storing them in a variable. 2) Now there's a generic method in the application which is stored in another Ruby file (not in a class, not in a module) 3) I need to call this generic method with the object of the base class (since the object has the data allotted to the variables) 4) But when I do this it says undefined method `methodName' for main:Object. So can somebody help me with this? What can I do so that I can access the methods and at the same time the data is set to variables for every row of excel sheet. Thanks in advance. 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 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: Help with class,method,objects
Hi, Yaa I am using the same but I have modified it for my usage. What I do is : class Tax_CheckMapping def returnExcelData(file,range) @range=range @file=file taxChkOpr=[] excelObject=Excel.new excelData=excelObject.getRowData(@file,'SCENARIOS-TESTDATA',@range) incr_i=0 excelData.each do |oneRow| taxChkOpr[incr_i]=Tax_CheckOperation.new taxChkOpr[incr_i].setUserData(oneRow['Admin User Name'].to_s,oneRow['Admin Password'].to_s ) incr_i=incr_i+1 end return taxChkOpr end end And in the second class I do the following operations : class Tax_CheckOperation attr_reader :adunme,:adpwd def intialize @adunme= @adpwd= end def setUserData(adunme,adpwd) @adunme=adunme @adpwd=adpwd end def login(ie) login script text_field.set(adunme) text_field.set(adpwd) end end Whearas in my script : taxChkMapper=Tax_CheckMapping.new taxChkOpr=taxChkMapper.returnExcelData(path of the excel file,'TC1') TC1 is my identifier for test cases taxChkOpr.each do |eachIns| eachIns.login(ie) end So per say if my login method is not defined in the class Tax_CheckOperation I wont be able to access my variables 'adunme' and 'adpwd'. I have also used the ''send'' method as well but that's not being fruitful either, Hope now the things are clearer for you guys to help me. Since I am not calling the method with the object of the class but instance of an array object. Thanks Rohan Ojha -Original Message- From: watir-general@googlegroups.com [mailto:watir-gene...@googlegroups.com] On Behalf Of George Sent: Friday, July 31, 2009 8:39 AM To: Watir General Subject: [wtr-general] Re: Help with class,method,objects Are you using the Excel interface class from Watir's site? http://wiki.openqa.org/display/WTR/Excel+interface+class On Jul 29, 9:57 pm, Rohan Ojha rohan.o...@bsil.com wrote: Hi All, I am not too sure whether I should post it here or in a Ruby forum. But there is a problem that I am facing while scripting a data driven Watir suite. 1) I have a class (say the base class) wherein I am fetching data from excel and storing them in a variable. 2) Now there's a generic method in the application which is stored in another Ruby file (not in a class, not in a module) 3) I need to call this generic method with the object of the base class (since the object has the data allotted to the variables) 4) But when I do this it says undefined method `methodName' for main:Object. So can somebody help me with this? What can I do so that I can access the methods and at the same time the data is set to variables for every row of excel sheet. Thanks in advance. 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 --~--~-~--~~~---~--~~ 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] Re: Watir support java applets
Hi All, This is the point that even I have a few doubts about. The application that I am working on contains Java applets but those are only as a replacement for select list.There is two of them and we use it to move the content from left to right. However the code and the content of the applets are available in the HTML source of the page. Eg : td rowspan=2 valign=top width=124 APPLET NAME=AvailPlan_List archive=applets.jar PARAM NAME=columns VALUE=3 PARAM NAME=colwidths VALUE=100|100|100 PARAM NAME=headings VALUE=Plan|Type|Description PARAM NAME=sortable VALUE=true PARAM NAME=sortcolumn VALUE=0 PARAM NAME=sortdirection VALUE=ascending PARAM NAME=SingleClickHandler VALUE=none PARAM NAME=row[0] VALUE=App_Plan_RON_1|Requisitionnbsp;Approval|Newnbsp;Plannbsp;descripti on PARAM NAME=hidden[0] VALUE=231 PARAM NAME=row[1] VALUE=Badnbsp;Boynbsp;Reqnbsp;Approval|Requisitionnbsp;Approval|Badnbs p;Boynbsp;Reqnbsp;Approval PARAM NAME=row[3] VALUE=BadBoynbsp;Scriptnbsp;POnbsp;Plan|Purchasenbsp;Ordernbsp;Approva l|BadBoynbsp;Scriptnbsp;POnbsp;Plan /APPLET So does that mean I can still use Watir to drive this applet since the object seems to be available to me in the view source ? Thanks, Rohan Ojha -Original Message- From: watir-general@googlegroups.com [mailto:watir-gene...@googlegroups.com] On Behalf Of Chuck van der Linden Sent: Wednesday, July 22, 2009 10:17 PM To: Watir General Subject: [wtr-general] Re: Watir support java applets Watir drives the browser. there are little if any plans for anything outside that scope. If your stuff has a browser UI then likely Watir can be used to automate it. if it's running outside of a browser, then Watir is not the tool you seek. On Jul 22, 3:37 am, khaja shaik khaja.sh...@gmail.com wrote: Hi All, Can anybody tell me is watir supports java aaplets? Is it will support in future? any work going on Thanks Khaja shariff --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---