views:

81

answers:

2

I am having a problem identifying a label on a jQuery generated page. This is the code of the page (as seen in firebug). alt text

I am trying to find it using this statement,

assert(browser.label(:id, "acms-ws-select-label").exists?)

Put it fails to find the label. Any ideas on what I am doing wrong?

Update: running the same script in IE with Watir, seems to find the element.

A: 

Trying throwing a small sleep in, before the check, just to give the javascipt stuff time to render the page.

IE might be executing the jquery stuff sooner or faster, or running the watir stuff slightly slower (either would do it) so that it's 'done' at the time you do the check there.

You could also use an IRB prompt to execute the firewater steps manually, if that works then you pretty much know for sure it's a timing issue

Chuck van der Linden
+1  A: 

Try to use wait_until and see if that makes any difference.

Watir::Waiter.wait_until {browser.label(:id, "acms-ws-select-label").exists?}

Jarmo Pertman
That did the trick thanks
Alastair