Re: [Wtr-general] Wait for control to exist

2006-06-13 Thread Andy Sipe
I'm not sure of the syntax, but I'd like to see it support multiple elements being verified. -andy Original Message Follows From: Bret Pettichord [EMAIL PROTECTED] Reply-To: wtr-general@rubyforge.org To: wtr-general@rubyforge.org Subject: [Wtr-general] Wait for control to exist Date:

Re: [Wtr-general] Wait for control to exist

2006-06-13 Thread Bret Pettichord
On 6/13/06, Andy Sipe [EMAIL PROTECTED] wrote: I'm not sure of the syntax, but I'd like to see it support multiple elementsbeing verified.-andyHow about this ?ie.button(:value, OK).wait_til_existsie.button(:value, Cancel).wait_til_exists Bret ___

Re: [Wtr-general] Wait for control to exist

2006-06-13 Thread Bret Pettichord
On 6/13/06, David Schmidt [EMAIL PROTECTED] wrote: I called the function I wrote wait_for, though I like youruntil_with_timeout method that uses yield better.Then we could do something like:wait_for(10) { ie.button(:value, 'OK') }or just do it as a function like wait_for( ie.button(:value, 'OK'),

Re: [Wtr-general] Wait for control to exist

2006-06-13 Thread Adrian Rutter
Brett wrote The only thing is -- what should it be called? wait_for_object? Maybe with a default timeout in the initialize method when a parameter is not sent. wait_for_object #default wait_for_object(5000) #milliseconds Aidy

Re: [Wtr-general] Wait for control to exist

2006-06-13 Thread Andy Sipe
That woudl work. What would be nice would be something like this: @ie.wait(10) { button(:id, 'btnOne) span(:id, 'blah') } I'm not sure how that would translate into working code though. Also, is it enough to just check that the item exists? Often I have items that are being updated via

[Wtr-general] Problem finding a link URL with RegEx

2006-06-13 Thread Adrian Rutter
I have got 2 'New' links in one HTML page. The second link has a URL as this:

Re: [Wtr-general] Problem finding a link URL with RegEx

2006-06-13 Thread Zeljko Filipin
Try this:$ie.link(:url, /http:\/\/gbahevm07l15:9081\/wps\/myportal.*7_0_12P/).clickOn 6/13/06, Adrian Rutter [EMAIL PROTECTED] wrote:I have got 2 'New' links in one HTML page. The second link has a URL as this:

Re: [Wtr-general] Problem finding a link URL with RegEx

2006-06-13 Thread Adrian Rutter
Thanks for the correct RegEx; it finds an object, but not the one I want. The below are the url's of the second 'Filter' and 'New' links. They are hardly different and I am sure they will change in a different environment, so I can't hard-code them

Re: [Wtr-general] Problem finding a link URL with RegEx

2006-06-13 Thread Michael Bolton
Thanks for the correct RegEx; it finds an object, but not the one I want. Is it not possible to get the second link on a page? Something like: $ie.link(:text, 'New';:index, 2).click Possibly--but this might be a good occasion to ask the developers for testability. ---Michael B.

Re: [Wtr-general] Problem finding a link URL with RegEx

2006-06-13 Thread Adrian Rutter
MB wrote: Possibly--but this might be a good occasion to ask the developers for testability. I think Websphere Portal instantiates each object dynamically and according to the developers, there is nothing they can do. Aidy

Re: [Wtr-general] Wait for control to exist

2006-06-13 Thread David Schmidt
How about the easy way. Just alias your nice until_with_timeout to wait_until so both names work and just use that your first format with the block. That way the block can contain any code that returns a boolean, which will allow Andy's request for multiple element support to work like:

Re: [Wtr-general] Problem finding a link URL with RegEx

2006-06-13 Thread David Schmidt
Adrian Rutter wrote: Is it not possible to get the second link on a page? Something like: $ie.link(:text, 'New';:index, 2).click It is currently possible to access the second link on a page, but not with a filter. '$ie.links[2]' will give you the second link on the page, and you can open

Re: [Wtr-general] Wait for control to exist

2006-06-13 Thread Bret Pettichord
On 6/13/06, David Schmidt [EMAIL PROTECTED] wrote: How about the easy way.Just alias your nice until_with_timeout towait_until so both names work and just use that your first format withthe block.That way the block can contain any code that returns a boolean, which will allow Andy's request for

Re: [Wtr-general] Problem finding a link URL with RegEx

2006-06-13 Thread Bret Pettichord
Adrian Rutter wrote: Is it not possible to get the second link on a page? Something like: $ie.link(:text, 'New';:index, 2).clickUsing 1.5.1.1037 try this: $ie.link(:text = 'New', :index = 2).click I added multiple attribute support last night for links. Bret

[Wtr-general] Load site without images?

2006-06-13 Thread Christian Baumann
Hello! Is it possible to execute watir-scripts without loading the images in a website? I´m on a dialup and have a real bandwith-problem; and for the execution of my testcases loading of the images isn´t necessary. Thanks in advance, Christian ___

Re: [Wtr-general] Load site without images?

2006-06-13 Thread Bret Pettichord
On 6/13/06, Christian Baumann [EMAIL PROTECTED] wrote: Is it possible to execute watir-scripts without loading the images in awebsite?I´m on a dialup and have a real bandwith-problem; and for the executionof mytestcases loading of the images isn´t necessary. Just turn off this option in IE's

Re: [Wtr-general] Load site without images?

2006-06-13 Thread Mike Townley
You can tell IE to not load images. You'll need to click Internet Options from the Tools menu. In the new window that opens, click the Advanced tab on the far right. Scroll down the list until you see the Multimedia category and click the checkbox next to Show Pictures to uncheck it, then click

[Wtr-general] Trouble with links in a div

2006-06-13 Thread kwan l
Hi, I've just started using Watir and have run into a problem with links inside of divs. example page: htmlhead/headbodydiv id="div1"a href="">Googlehttp://www.google.com"Google/a/div/body/html when i try the script: require 'Watir' ie = Watir::IE.start("C:\\testwatir.html") # Test initial

Re: [Wtr-general] Wait for control to exist

2006-06-13 Thread David Schmidt
Our solution is better than that. Bret already has a method that I've been using and it's generic enough that you can wait for just about anything. He's stated that he'll just be renaming it to wait_for. On a web scraper I have there is an AJAX request that fires when one of the fields is

Re: [Wtr-general] Wait for control to exist

2006-06-13 Thread Bret Pettichord
On 6/13/06, David Schmidt [EMAIL PROTECTED] wrote: The wait_for method will just keep trying the supplied block until the blockreturns true or the timeout has passed (where it will throw an exception).We want it to be called wait_until -- correct? ___

Re: [Wtr-general] Wait for control to exist

2006-06-13 Thread David Schmidt
Yup, my bad. I just typed the wrong name out of habit. New name will be wait_until. *SLAP* Ouch! OK, I've been punished. David Bret Pettichord wrote: On 6/13/06, *David Schmidt* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: The wait_for method will just keep trying the

Re: [Wtr-general] Trouble with links in a div

2006-06-13 Thread Bret Pettichord
On 6/13/06, kwan l [EMAIL PROTECTED] wrote: ie = Watir::IE.start(C:\\testwatir.html)Try this instead:Watir::IE.start(file:///C:/testwatir.html)Bret ___ Wtr-general mailing list Wtr-general@rubyforge.org

Re: [Wtr-general] Wait for control to exist

2006-06-13 Thread Bret Pettichord
I've written this up as http://jira.openqa.org/browse/WTR-75 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] Wait for control to exist

2006-06-13 Thread Andy Sipe
That sounds great. I didn't realize that was what you were talking about. Thanks -andy Original Message Follows From: David Schmidt [EMAIL PROTECTED] Reply-To: wtr-general@rubyforge.org To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] Wait for control to exist Date: Tue, 13 Jun

Re: [Wtr-general] Trouble with links in a div

2006-06-13 Thread kwan l
Thanks Bret, but i still get the same error. Creating the "ie" instance works fine. It fails when I try to reference the link inside the div tag. I peeked in the code for "getLink" and it fails at the lines : def getLink( how, what ) links = document.all.tags("A") Apparently, the document

[Wtr-general] Drop Down Lists (li)

2006-06-13 Thread Andy Case
I am new to WATIR/RUBY and have run into difficulty with a drop down list, example HTML below. The example documentation doesn't seem to cover this. Can anyone suggest how I would use WATIR to select the drop down options? div id="nav1" a name="nav1"/a ul id="udm" class="udm" li a

Re: [Wtr-general] Trouble with links in a div

2006-06-13 Thread Bret Pettichord
On 6/13/06, kwan l [EMAIL PROTECTED] wrote: Apparently, the document object is nil. Accessing the link from the ie instance also calls getLink but in that case the document object isn't nil. It's only nil when I access the link collection of the div object. I'm not quite sure what's going on