Trouble find elements with fireWatir on a JQuery created page
質問
I am having a problem identifying a label on a jQuery generated page.
This is the code of the page (as seen in firebug).
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.
解決
Try to use wait_until and see if that makes any difference.
Watir::Waiter.wait_until {browser.label(:id, "acms-ws-select-label").exists?}
他のヒント
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