[wtr-general] Re: Difference between @browser.close and @browser.quit?

2011-09-17 Thread joedio
Moshen, I believe that browser.close is still supported in Watir v1.9.2 or later, while browser.quit was deprecated awhile ago. I think SafariWatir still has a quite method. Joe On Sep 15, 3:38 am, Mohsen Qureshi mohsen...@googlemail.com wrote: Hi guys, I would like to know if there is a

[wtr-general] Re: how to get value from excel

2011-09-14 Thread joedio
If I'm reading this correctly, your issue is that the line of code: ie.form(:id,'commonLoginform').text_field(:name, 'username').set'$user' is incorrectly setting the name of the variable ($user) and not the value held in that variable. When you quoted $user it was being defined as a String,

[wtr-general] Re: Does watir support svg

2011-09-14 Thread joedio
I don't think Watir does. Even watir-webdriver which supports a wider set of HTML tags doesn't list svg or rect as a supported HTML tag. http://rubydoc.info/gems/watir-webdriver/0.3.3/Watir/HTMLElement Joe On Sep 14, 9:41 am, al3kc aleks.kiev...@gmail.com wrote: Hi, I have the following svg

[wtr-general] Re: Error from Library

2011-09-03 Thread joedio
Anand, Have you suddenly changed something on your computer that may correspond to the sudden error you are now seeing? I'd start looking there. What is the HTML that you are testing against that causes this error? What is the Watir code that you are using to test it? What is the command that

[wtr-general] Re: Access denied when running execScript

2011-09-03 Thread joedio
Idan, What is the certain environment that it is failing in? What environment is it working in? What is the HTML code you are testing against? What is the Watir code you are testing with? What it the command that is failing? If you could answer these questions it would be easier to assist.

[wtr-general] Re: getAllContents equivalent in watir-webdriver?

2011-08-26 Thread joedio
Abe, In Watir look for 'options' and 'selected_options' in the class Watir::SelectList In watir-webdriver look for 'options' and 'selected_options' in the class Watir::Select Joe On Aug 25, 1:32 pm, Abe Heward abe.hew...@gmail.com wrote: In Watir you can get an array of all items in a

[wtr-general] Re: Handle assertion

2011-08-24 Thread joedio
Look into Ruby's Begin/rescue/ensure/end Just Google 'ruby begin rescue ensure' for details In a nutshell its format is... begin # Code you want to trap errors on goes here # such as your assert statement rescue # code to deal with errors goes here # such as calling your screen

[wtr-general] Re: Focusing on a window that's spawned by a select_list value

2011-08-24 Thread joedio
You didn;t mention if oyu are using Watir Firewatir or watir- webdriver. If using Watir look into Waitr:IE.attach() If using Firewatir look into FireWatir::Firefox.attach() If using watir-webdirver look into browser.window.().use Hope that helps, Joe On Aug 24, 2:35 am, GJHmf

[wtr-general] Re: watir-webdriver / chrome / ubuntu 11.01 11.10a

2011-08-24 Thread joedio
Kyle, Looks like you've followed the info at: http://code.google.com/p/selenium/wiki/ChromeDriver Including: a) Downloading the chrome driver for your OS b) Installed it in a location on the file system that is in the OS search path (e.g. /usr/bin/) See if /usr/bin is in the PATH used

[wtr-general] Re: Could not find win32-api error when running script after installing latest WATIR 2.0

2011-08-22 Thread joedio
Check the version of win32-api that is installed. The error message is indicating that: Could not find win32-api (= 1.3.0) From a Windows command window type: gem list Does the list include a version greater than 1.3.0? If it isn't listed, install the current gem gem install

[wtr-general] Re: Can't locate a text field inside a table

2011-08-19 Thread joedio
Try specifying the Frame by their index. You've already found: browser.show_frames: there are 2 frames frame index: 1 name: frame index: 2 name: So try locating them using the frame's index depending on which iFRame your element resides within: browser.frame(:index =

[wtr-general] Re: problem with acces test data using openoffice org calc

2011-08-19 Thread joedio
I strongly suggest you install the roo gem. It suppports: OpenOffice, Excel and GoogleDOcs workbooks. See: http://roo.rubyforge.org/ To install on Windows: gem install roo To install on OSX: sudo gem install roo I use it on Linux, OSX, and WInXP, Vista, Win7 and it saves a lot of work!

[wtr-general] Re: Carriage Returns

2011-08-17 Thread joedio
Hillary, See if specifying the ASCII code for the Carriage Return will work. The Carriage Return is ASCII character 10. Here an example in irb: irb(main):006:0 putsa + 10.chr + b + 10.chr + c a b c = nil So you code would be: b.text_field(:id, x).set(a + 10.chr + b + 10.chr + c) Joe On Aug

[wtr-general] Re: how to locate a table which has no attribute

2011-08-11 Thread joedio
The code is incorrectly specifying the index as a string not an integer. Thus @utable=ie.div(:id,mainContainer).table(:index,2) should be @utable=ie.div(:id,mainContainer).table(:index, 2) Joe On Aug 10, 7:44 pm, lifeng jiang jiangsqu...@gmail.com wrote: hi all: I am using

[wtr-general] Re: string to boolean?

2011-07-06 Thread joedio
Rahul, I think you'll have to deal with it using some logic. Here's an example in irb: irb(main):001:0 sString = true = true irb(main):002:0 sString.match(/(true|t|yes|y|1)$/i) != nil = true Joe On Jul 5, 7:54 am, Rahul Sharma rahulsharma@gmail.com wrote: Hi Guys, Any way to pass in a

[wtr-general] Re: How to locate the table which doesn't have id or name

2011-07-01 Thread joedio
Jasmine, Try the tables index. For example if it was the first table on the page: browser.table(:index, 0). # 0 based index, not 1 based index Joe On Jul 1, 12:17 am, Jasmine nicely...@hotmail.com wrote: Hello I need to locate the table,then locate the tr and td,but the table doesn't

[wtr-general] Re: How to make the scripts more effective at slow connection?

2011-06-26 Thread joedio
Amit, Suggest you look into the Watir methods wait wait_until You can read up on them in the RDoc http://wtr.rubyforge.org/rdoc/1.6.5/ At those points in the script where you need to acount for network timing issues, add a wait/wait_until command for some HTML element on the page to be

[wtr-general] Re: watir-webdriver firebug

2011-06-16 Thread joedio
Jari , Does this mean that when using webdriver: 1) If you start Firefox: browser = Watir::Browser.new that it runs with all addins disabled. 2) If you start Firefox: browser = Watir::Browser.new(:firefox, :profile = default) it runs with your default addin settings

[wtr-general] Re: Where to put user defined class to include it in various scripts

2011-05-21 Thread joedio
Amit, These are indeed a Ruby questions NOT a Watir questions. I appreciate your candor in noting that with your question. The answers to your questions are: 1. Where to save this class so that I will be able to include it in my scripts? A: You can save it anywhere you like in the file system

[wtr-general] Re: Verify file permission using watir script

2011-05-11 Thread joedio
Zeljko is correct that this is a Ruby question, not a Watir issue. Recommend you refer to the Ruby Rdoc: http://www.ruby-doc.org/core/ Look at the Classes Dir, File and FileTest, and you'll see methods Ruby has for files. Joe On May 11, 12:49 am, Mahesh mahesh...@gmail.com wrote: Hi, can

[wtr-general] Re: Waiting for page load using Watir

2011-05-09 Thread joedio
Ranjith, If you just want to check that the Status bar text is Done then this loop will work, since Watir can read the Status text in IE of Firefox. # Loop until the status bar text is Done while(browser.status != Done) do sleep(1) end Joe On May 5, 10:47 pm, ranjith kumar

[wtr-general] Re: Integration with HP QTP 11 or Quality center 11

2011-05-09 Thread joedio
Mayank, I believe Quality Center can launch external scripts via the command line. If so, it can be used to launch a Ruby script, and thus launch a Ruby script that uses Watir, or FireWatir. It may also be able to read the return code from that script to determine Pass/Fail stauts of the script.

[wtr-general] Re: very slow tag iterator

2011-04-23 Thread joedio
Sergey, I wouldn't say its a bug, but that its a fine example of how different coding techniques can affect performance. In your first code example Ruby has to perform the regular expression check once in each loop, on every element in the set (that's 111 loops and 111 checks). While in your

[wtr-general] Re: Moving a window

2011-04-23 Thread joedio
Chaos King, I think you've already been supplied several ways by this group to scroll the window, but as part of your initial question you asked... I need to move the windows To do that just have the browser to goto a URL, for example: require 'rubygems' require 'watir' browser =

[wtr-general] Re: Managing multiple version of Watir

2011-04-02 Thread joedio
One other way to consider is using Virtual Machines (VM's). Create VM's with different combinations of Browser, Ruby and Watir. It takes a bit of time to get the VM software and the various VM's setup initially, but saves a ton of time in switching between OS's and in trying out new Browser,

[wtr-general] Re: how to access an element from a multi level nested div/ul/li

2011-04-01 Thread joedio
When I'm working with elements within a nested element, I collect the number of that elements (e.g. table) present on the page, then loop backwards through them starting with the deepest nested element (the one with the highest index number), and start looking for the element I'm interested in

[wtr-general] Re: Can not get url of a page when using firewatir

2010-12-14 Thread joedio
I believe that this is a know issue with Firewatir. Many of us have run into it already. For the details and the fix see: http://jira.openqa.org/browse/WTR-428 Joedio On Dec 13, 6:24 pm, Ekin Han nbkhic...@gmail.com wrote: Hi friends, When i using firewatir i found that i can not using

[wtr-general] Re: Rdoc for Wait and ElementExtensions in Watir 1.6.7

2010-11-29 Thread joedio
The RDoc entries for Watir 1.6.7 wait methods (wait_until_present, wait_while_present, etc.), are found in the Commonwatir RDoc, NOT in the Watir or FIreWatir RDOcs. The Commonwatir RDoc is located in my install tree at: C:\Ruby\lib\ruby\gems\1.8\doc\commonwatir-1.6.7\rdoc\index.html Your

[wtr-general] Re: Identify IP address

2010-11-08 Thread joedio
There are indeed commands in Ruby to do what you are looking to do. Suggest you look through the Ruby Rdocs or post to a Ruby group. http://ruby-doc.org/core/ Look at the grep command and the fileutils. If you need your test to do something outside of the browser you need to spend some effort

[wtr-general] Re: AutoITx3 works on one machine but not another for opening Excel files

2010-10-19 Thread joedio
I would advise against using AutoIT for manipulation of Excel through the GUI when there are Ruby gems that let you access Excel through its API. For example I've had great success using the Excel Interface Class http://wiki.openqa.org/display/WTR/Excel%20interface%20class This ruby class

[wtr-general] Re: How can you avoid Omniture recording when using WaTiR to test production website?

2010-09-18 Thread joedio
There is no magic bullet here. Suppressing Web Analytic collection during test execution cycles is not an issue specific to Watir. Any Manual test process or Automated test tool run against a web page that implements Omniture SiteCatalyst, Google Analytics or any other web activity monitoring

[wtr-general] Re: Pointers to docs

2010-09-04 Thread joedio
When I'm working with elements within nested tables I collect the number of tables then loop backwards through them starting with the deepest nested table (the one with the highest index number), and start looking for the element I'm interested in there, if its not found continue to the next

[wtr-general] Re: Problem in Watir::Waiter.wait_until()

2010-08-23 Thread joedio
If you need info on a method be sure to check out the Watir Rdoc. http://wtr.rubyforge.org/rdoc/1.6.5/ It has syntax info on this method that may answer your questions. Joe On Aug 23, 12:18 am, Zubair zubair.rk...@gmail.com wrote: Please tell me how does      Watir::Waiter.wait_until(t){ obj

[wtr-general] Re: Running bat files in command prompt

2010-08-13 Thread joedio
Cyril, Suggest you create one bat file that calls the other bat files, then launch that bat file instead of the four individually. Use DOS to do the DOS specific tasks. Joe On Aug 12, 11:11 pm, cyril.gonsal...@mastek.com cyril.gonsal...@mastek.com wrote: Hi, I want to run four bat file

[wtr-general] Re: Vista IE8... does not wait for

2010-07-29 Thread joedio
I run VIsta on a 64 bit system, and have run into two issues tha tothers on this fourm have assisted me to resolve, 1. On Vista or WIn7 disable the Windows User Account Control (UAC) http://windows.microsoft.com/en-ZA/windows7/turn-user-account-control-on-or-off 2. Perform the

[wtr-general] Re: How to Select the data in Multiselect list box

2010-07-19 Thread joedio
Oops, One minor correction. Select list use the select method, not the set method. # Select the value browser.select_list(:how, what).select(sSelection) Sorry On Jul 18, 7:46 am, joedio joe...@comcast.net wrote:    # Set the current value    browser.select_list(:how, what).set

[wtr-general] Re: How to Select the data in Multiselect list box

2010-07-18 Thread joedio
Sorri, Presuming that the CSV file is saved to an array contains data like this: aMultiSelectValues = ['Selection A, Selection b] # Loop trough the selections aMultiSelectValues.each do | sSelection | # Set the current value browser.select_list(:how, what).set(sSelection) end Joe On Jul

[wtr-general] Re: Issue retrieving URL for a HTML file loaded from local file system

2010-07-11 Thread joedio
Good advice guys! I am running on both Visa and Windows7 (two different PC's). Both systems have the out-of-the-box Windows User Account Control settings. Thus when I ran my scripts from the ScITS/Scintilla tool it was NOT launching ruby from a Console started with Admin rights. When I

[wtr-general] Re: Click image that is buried in a span tag

2010-07-10 Thread joedio
skyski, You mentioned that: somehow I think the javascript gets invoked and a parm passed by hovering over and then clicking I see that you've tried firing an onClick event without success. ff.image(:src, /blank.gif/).fire_event(onClick) Perhaps you need to account for the hover by firing an

[wtr-general] Issue retrieving URL for a HTML file loaded from local file system

2010-07-10 Thread joedio
# # Watir fails to get url for a file on the local file system, but not for same file on server # even though both files are the same, only difference is one is hosted is on server # while the other is on local file system. Both files load OK into the browser. require 'rubygems' require 'watir'

[wtr-general] Re: Iterate through radio buttons

2010-07-05 Thread joedio
:  Watir::Radio enabled?:  true getState:  false innerText: isSet?:  false name:  radioRange_reqDetailExpiration_1 type:  radio value:  Custom visible?:  true inspect:  #Watir::Radio:0x30ed3fc located=false how=:index what=15 value=nil E Finished in 153.359 seconds. On Jul 4, 7:17 am, joedio

[wtr-general] Re: Iterate through radio buttons

2010-07-05 Thread joedio
I got your original code to work as well Joe $ie.radios.each do | oMyObject | if(oMyObject .id == ID_OTHER_OPTION_BUTTON) puts(yes) else puts(NO) end end -- Before posting, please read http://watir.com/support. In short: search before

[wtr-general] Re: Iterate through radio buttons

2010-07-04 Thread joedio
of 1. On Jul 2, 9:05 am, joedio joe...@comcast.net wrote: Schlomit, Could you post the code you created from my example so folks can look at it to try to determine why the conditional is not working? Please include the output as well. Thanks, Joe On Jul 2, 5:59 am, Željko Filipin

[wtr-general] Re: farming automation on watir[parallel testing]

2010-07-04 Thread joedio
Christina, The short answer to your questions is Yes. You can do all that with Ruby. Ruby can run multiple threads, you can write code with Ruby to open FTP, SSH or other remote file transfer methods, and you could definitely write Ruby code to do that, but its not a part of Watir per se. The

[wtr-general] Re: Save Download Box behaves differently on IE 6 and IE 7

2010-07-02 Thread joedio
oAutoIt.WinClose(about:blank, ) This would at least get the code working with IE6 without hanging. Joe On Jul 2, 4:13 am, asheesh misra asheeshmisr...@gmail.com wrote: Hi Joedio, Thanks for the reply. However, may I humbly submit that the titles have been hardcoded deliberately since

[wtr-general] Re: Iterate through radio buttons

2010-07-02 Thread joedio
Schlomit, Could you post the code you created from my example so folks can look at it to try to determine why the conditional is not working? Please include the output as well. Thanks, Joe On Jul 2, 5:59 am, Željko Filipin zeljko.fili...@wa-research.ch wrote: 2010/7/2 Shlomit Gazit

[wtr-general] Re: Dialog boxes..

2010-07-02 Thread joedio
NO you can't use Watir for automating other Windows apps, you would use Ruby itself. If you want to automate Windows apps through their GUI API try using Ruby with AutoIt. Watir makes use of some of AutoIt's capabilities, but there is much more htat AutoIt can do. Suggest downloading the full

[wtr-general] Re: Iterate through radio buttons

2010-07-01 Thread joedio
Shlomit, This may work for your situation: # Define the element ID to be acted upon myID = your_id # Loop through the radio elements browser.radios.each do | radio | # Separate the matching radios if(browser.radio(:id, myID )) # Do whatever you need to do with it (e.g. set it)

[wtr-general] Re: Mouse_click method for firefox browser

2010-07-01 Thread joedio
Kiran, You didn't mention what objects it works/fails with. Is it only working for a particular type of object, and failing on another type of object? Is it possible that the reason Watir's click() method does not work for your situation is that the java script for the objects you are trying to

[wtr-general] Re: Save Download Box behaves differently on IE 6 and IE 7

2010-07-01 Thread joedio
Asheesh, I see from the code you supplied that when running with IE6 you are passing to AutoIt one title as a variable... window_title = File Download ai.WinWaitActive(window_title,prompt_message,1) have another title hard coded as Save As ai.WinWait(Save As, Save in, 5) and

[wtr-general] Re: Clicking a div with last index

2010-06-28 Thread joedio
Ajitesh, While I'm not sure why you would click on a div, but here's one way you could click on the last one: # Get the total number of the div elements on the page iLastDivIndex = browser.divs.length # Click on the last div element browser.div(:index, iLastDivIndex).click Joe On Jun 25,

[wtr-general] Re: WatiR Recorder++

2010-06-25 Thread joedio
I'll also avoid the debate on the benefits and drawbacks of recorders but I'll mention that there is another Watir Recorder available, and it includes an IDE and test framework . Check out TestWise, available at: http://itest2.com/ I'm personally not using it, but it looks very promising. Joe

[wtr-general] Re: Cant install Watir using Gem

2010-06-18 Thread joedio
James, While you didn't tell us know what OS you're running, I can see from the the c\: in the error report that its some flavor of Windows (XP, Vista, Win7, etc.) Make sure of the following: a) You are Logged into Windows as a user with Administrative rights b) If installing via the Ruby

[wtr-general] Re: Insertion of data into oracle database through watir script

2010-06-17 Thread joedio
Naresh, Suggest you look into installing a Ruby/Oracle gem: http://rubygems.org/search?query=oracle Or one of the general Ruby/Database gems: http://rubygems.org/search?query=database Others may have suggestions on any that they've preferred. Joe On Jun 17, 12:07 am, naresh

[wtr-general] Re: How to insert a blank value from spreadsheet into a textbox on webpage.

2010-06-14 Thread joedio
Not sure if you want to skip entering a text into the text field when the value read from the spreadsheet is blank, or you want to clear the text field. To differentiate between those two cases save the string nil into those cells when no action is required and try this: Presuming that you have

[wtr-general] Re: Is there a means to specify an element in the browser as a variable?

2010-06-09 Thread joedio
Željko, Thanks! That works like a champ. You saved me a lot of time! Joe On Jun 9, 9:02 am, Željko Filipin zeljko.fili...@wa-research.ch wrote: On Tue, Jun 8, 2010 at 9:37 PM, joedio joe...@comcast.net wrote:  myID = browser.sElement(:index, 1).id Try this: myID = browser.send(sElement

[wtr-general] Is there a means to specify an element in the browser as a variable?

2010-06-08 Thread joedio
Is there a way to with Ruby/Watir to specify an element in the browser as a variable? I'm trying to parse though a set of elements on the web page to get the setting of a specific attribute for each element. This example below fails with the following: undefined method `sElement ' for

[wtr-general] Re: getFocusedElement

2010-06-04 Thread joedio
Sorry but I don't know of a means in Watir1.6.5 to tell which object has focus, Watir's Watir::Element class lacks in_focus? or focus? methods. It has focus method to set the focus, but not a method to verify if an element is in focus (e.g. browser.link(:how, what).in_focus?) Or which element

[wtr-general] Re: Problem with a listbox that populates to many data

2010-06-03 Thread joedio
Marlon, Perhaps checking the browser's status bar to see that the status is Done may work. I've run into similar situations when testing SOAP applications where a user interaction on one element on the page triggers the population of a select list. If you're app is written well, the status text

[wtr-general] Re: How to automate ?

2010-06-01 Thread joedio
Some things to try. a) Look at the HTML source for each of the variants of the page, and try to identify and common attribute that Watir can use to distinguish them. Perhaps while the button's text may change (e.g. Recherche Google or Google Search, some other attribute remains constant (e.g. it

[wtr-general] Re: how do simply activate this javascript....from watir

2010-05-26 Thread joedio
Dave, You need to determine what user interaction activates the java script. Is it when the user clicks on some HTML element,( a link, a button, etc), is it when the user enters text in a field, or whatever? Once you know that key piece of information examine the HTML code for that element to

[wtr-general] Re: Enabling button in FireWatir

2010-05-19 Thread joedio
If I'm understanding this, the root issue is NOT with the disabled button, but is with the text field that should enable the button, (once the text field is filled in). There may be a fire event attached to that text field which is NOT being met when you run with Celerity. As I understand it

[wtr-general] Re: Verify tab order (tab index) on an HTML page

2010-05-18 Thread joedio
The Watir tabindex method you used is for HTMl tags with a tabindex attribute. For example: a href=#interactive tabindex=1 Link A/a a href=#interactive tabindex=2 Link B/a As you mention, your web page is NOT using the tabindex attribute, thus the method return 0. Perhaps you could use

[wtr-general] Re: `const_get': no such file to load -- safariwatir (MissingSourceFile) with FireWatir

2010-04-30 Thread joedio
Betsy, One of the things to do is to gather info on the execution environment. Perhaps somewhere during the scripts execution of the first (working) and second (failing) attempt, something is either trying to require or include safariwatir, or the browser type (Watir.options[:browser]) is getting

[wtr-general] Re: `const_get': no such file to load -- safariwatir (MissingSourceFile) with FireWatir

2010-04-30 Thread joedio
of Variables loop On Apr 30, 9:43 am, joedio joe...@comcast.net wrote: Betsy, One of the things to do is to gather info on the execution environment. Perhaps somewhere during the scripts execution of the first (working) and second (failing) attempt, something is either trying to require

[wtr-general] Re: Possible issue with Watir method check_for_http_error and IE8

2010-04-24 Thread joedio
. -c On Thu, Apr 22, 2010 at 11:00 AM, joedio joe...@comcast.net wrote: In Watir 1.6.5 it appears that the method check_for_http_error does NOT support IE8, as there is NO check for 8.0, only for 7.0, or a default to IE6. I noticed this because some pages I've hit in my tests run in IE8

[wtr-general] Possible issue with Watir method check_for_http_error and IE8

2010-04-22 Thread joedio
In Watir 1.6.5 it appears that the method check_for_http_error does NOT support IE8, as there is NO check for 8.0, only for 7.0, or a default to IE6. I noticed this because some pages I've hit in my tests run in IE8 are NOT raising NavigationException's even when one has occurred. Here's the

[wtr-general] Re: Watir issue with AutoIt on Vista 64 bit

2010-03-29 Thread joedio
PM, joedio joe...@comcast.net wrote: Installed Watir (v1.6.5) on top of Ruby (v1.8.6) on my 32bit WinXP and 64 bit Vista systems. Ran into way too many issues trying to use Ruby 1.9.1 (64-bit) and Watir(v1.6.5), so degraded to try these older versions, as Watir site recommends