FF17 Issue finding elements with workaround (deleted other thread)

480 views
Skip to first unread message

James

unread,
Nov 21, 2012, 9:50:11 PM11/21/12
to webd...@googlegroups.com
There is currently an issue calling findElement from a WebElement.  If the By clause would return no values in FF17 your session will hang.

Example: webElement.findElement(By.cssSelector("a")); or webElement.findElement(By.tagName("a"));

I worked around this by using jquery to verify that there was a matching child and returning that.  I think you could check this using just javascript though.  Hopefully this helps someone


Additionally in FF17 isSelected will also hang.

Debabrata Chakraborty

unread,
Nov 21, 2012, 11:44:04 PM11/21/12
to webd...@googlegroups.com
Which version selenium you are using?
 
 
Thanks,
Debabrata

--
You received this message because you are subscribed to the Google Groups "webdriver" group.
To view this discussion on the web visit https://groups.google.com/d/msg/webdriver/-/csbJo94K6doJ.
To post to this group, send email to webd...@googlegroups.com.
To unsubscribe from this group, send email to webdriver+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/webdriver?hl=en.



--
Thanks,
Debabrata

James

unread,
Nov 22, 2012, 4:07:05 PM11/22/12
to webd...@googlegroups.com
2.26.

I investigated more last night and it looks like findElement doesn't work in a number of different circumstances.

But, using getElements().get(0) will work, as long as you check for null.  I have everything working now apart from isSelected.

darrell

unread,
Nov 23, 2012, 11:20:59 AM11/23/12
to webd...@googlegroups.com
This example would have undefined results, always. If findElement is an answer to a question, your question is ambiguous. The findElement method returns THE match. You are asking it for ANY match. If there is only one anchor on the entire page it might work. However, if the size of findElements is greater than 1, using findElement will have undefined results.

An undefined result means it is valid to work all the time, work some of the time, format your hard drive, never work, cause your automation to lock up. These and many more are all proper responses to ambiguous requests.

Darrell

Alexei Barantsev

unread,
Nov 24, 2012, 1:18:09 PM11/24/12
to webd...@googlegroups.com
This issue was fixed by r18184, the fix should be available in the next release (2.27)

Regards,
-- 
Alexei Barantsev
Software-Testing.Ru
Selenium2.Ru

James

unread,
Nov 25, 2012, 4:12:05 PM11/25/12
to webd...@googlegroups.com
Awesome, thanks Alexei.

Darrell,
I'm really not sure what your referring to.
Reply all
Reply to author
Forward
0 new messages