Speaking of additions, how about a WebElement.getParent() method? Or
in keeping with this thread, WebElement.findElement(By.parent())?
I have a case where sometimes (~1-10%) webdriver sees an element as
invisible even though it is visible on the screen, and it has been
suggested (thanks Darrell) that something somewhere up the DOM might
have a bad attribute that causes it. So I'd like to walk back up the
DOM, dumping attributes at each step, to compare a case where the
element is 'invisible' with one where it isn't. What do you think?
Speaking of invisibility, what if ElementNotVisibleException somehow
explained what was causing the status? (0 size, etc)
Thanks,
Bill
Simon Stewart <
simon.m...@gmail.com> wrote:
> I'm trying to keep the surface area of the API exploding. A "add a method"
> here and a "we need to do this" there, and we'll end up with a bloaty
> horror. We've avoided that so far by adopting a "default no" stance to API
> additions and attempting to get some consistency. If we're focusing on what
> to do with "active element", my guiding light is that any change we make
> should lead to greater consistency of the API. Removing the method entirely
> reduces the API size (which I like) and moving to findElement(By.active())
> increases consistency. Both are good. Adding a new method to the core
> WebDriver interface is not good.
>
> It's a shame that there isn't a consistent attribute or property that we
> could look at ("hasFocus()" is a function and doesn't appear to be
> implemented in chrome). Otherwise I'd be suggesting "By.attribute(name,
> expectedValue)" with the same semantics as WebElement.getAttribute()
>
> Simon
>
> On Wed, Jan 16, 2013 at 12:10 AM, Jason Leyba <
jml...@gmail.com> wrote:
>
> > Yes, fetching the "active element" appears to be a limited use case, but
> > it's not just tab order. For instance, you might want to verify a specific
> > field is focused upon opening a dialog.
> >
> > As for doing things through JS, I'm a little surprised how often "just use
> > executeScript" is coming up lately. Feels too similar to doing everything
> > through Selenium.getEval...
> >
> >
> > On Tue, Jan 15, 2013 at 10:00 AM, Ivan De Marino <
detron...@gmail.com>wrote:
> >
> >> I like
> >>
> >> driver.findElement(By.active()**)
> >>
> >> over
> >>
> >> driver.getActiveElement()
> >>
> >> for the same reasons Simon was highlighting.
> >>
> >> I'm against getting rid of it because, despite having never used it, I
> >> can see someone interested in using it.
> >> And throwing away a call, asking developers to "use JavaScript
> >> evaluation", it's a bit harsh.
> >>
> >> Ivan
> >>
> >>
> >> On Friday, 11 January 2013 14:48:46 UTC, David Burns wrote:
> >>>
> >>> Hey All,
> >>>
> >>> I would like to propose a method name change.
> >>>
> >>> Currently to get the active element on the page we need to do
> >>>
> >>> driver.switchTo().**activeElement()
> >>>
> >>> which is not exactly what we are doing. We aren't switching to anything.
> >>> We are just doing a find element so would like to change to
> >>>
> >>> driver.findElement(By.active()**)
> >>>
> >>>
> >>> I would like to get your thoughts on this!
> >>>
> >>> David
> >>>
> >>> David Burns
> >>> URL:
http://www.theautomatedtester.**
co.uk/<
http://www.theautomatedtester.co.uk/>
> >>>
> >> --
> >>
> >>
> >>
> >
> > --
> >
> >
> >
>
> --
>
>