- madisonli2007
- Posts : 5
Join date : 2010-08-03
selenium.isElementPresent("some_button") is not reliable
Sat Aug 14, 2010 1:10 am
Hi, I'm using java api and call selenium.isElementPresent("some_obj") constantly. However I found that half of the time the call fails with "obj not found". If this function only works 50% of time, what's the use of it?
Any thoughts?
Any thoughts?
Re: selenium.isElementPresent("some_button") is not reliable
Sun Aug 15, 2010 11:26 am
hi,
It's work every time if object will present. The reasons your element will identify are as follows:
1. your page is not fully loaded and selenium try to search element. Try to use wait or waittopageload command.
2. May be your id is generated dynamically at run time with different id every time.
3. may be you have written something wrong in you locator.
check all the possible condition and lets see will above points solve your problem.
Best of luck.
bye
It's work every time if object will present. The reasons your element will identify are as follows:
1. your page is not fully loaded and selenium try to search element. Try to use wait or waittopageload command.
2. May be your id is generated dynamically at run time with different id every time.
3. may be you have written something wrong in you locator.
check all the possible condition and lets see will above points solve your problem.
Best of luck.
bye
- madisonli2007
- Posts : 5
Join date : 2010-08-03
Re: selenium.isElementPresent("some_button") is not reliable
Mon Aug 16, 2010 10:31 pm
Hi,
Thanks for the response. you are right, my id is generated dynamically at runtime, with empty ids.
So, isElementPresent() isn't the root cause. The root cause is that selenium doesn't recognize the dynamic links on the parent page.
On the parent window I have a table that contains a column of links, which each invokes a new window. If I do getAlllLinks(), the returned link IDs are all empty.
Thanks for the response. you are right, my id is generated dynamically at runtime, with empty ids.
So, isElementPresent() isn't the root cause. The root cause is that selenium doesn't recognize the dynamic links on the parent page.
On the parent window I have a table that contains a column of links, which each invokes a new window. If I do getAlllLinks(), the returned link IDs are all empty.
- metmanAmateur
- Posts : 58
Join date : 2010-04-02
Re: selenium.isElementPresent("some_button") is not reliable
Fri Aug 20, 2010 8:02 am
I've found selenium's xpath algorithms to be painfully finnicky myself, but once you find one that works, it always works. Unless you have dynamic ids. Can you rely on the same relative position to another static element? If so, you can locate the link you want with xpath that way.
- How reliable is selenium testing tool?
- Can Selenium do image comparison tests; support mobile browsers; and other FAQs about Selenium
- Creating detail log for selenium command execution (Selenium RC Java client)?
- What is the use of Selenium Core and Selenium Test Manager ? (N-Unit Procedures in VS 2010)
- [Help] Problem of running selenium Testcase[Java Junit] with Selenium RC
Permissions in this forum:
You cannot reply to topics in this forum
|
|