I'm seeing an annoying issue that I suspect has to do with objects inside 
page frames and Selenium and Watir-Webdriver.

I brought up part of it already in this post: 
https://groups.google.com/d/topic/watir-general/gIgtHbFxfbw/discussion

Here's a similar issue:

If I reference some text on a page like this:

@browser.frame(:index=>0).table(:class=>"itemSummary").td(:class=>"shorttext", 
:index=>0).text

...it will work fine.  I get the text I need, just as expected.

However, that's a nasty long bit of code and I don't want to have to use 
that string every time I need that page object. So I defined a method.

def site_id
  
@browser.frame(:index=>0).table(:class=>"itemSummary").td(:class=>"shorttext", 
:index=>0).text
end

Sadly, when I call the method in my scripts, I get...

*Selenium::WebDriver::Error::ObsoleteElementError: Element not found in the 
cache*
*
*
There's no way it's an obsolete element, because the class containing that 
method gets instantiated *immediately* before the method is called.

Is this a known issue?  Any ideas for a way around this that will allow me 
to continue to use my method instead of the explicit call to the object?

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com

Reply via email to