Selenium Forum: Functional And Regression Testing Tool.
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
Display results as :
Advanced Search
Latest topics
AEM Training | Free Online DemoWed Apr 21, 2021 5:45 pmazharuddin
c# PageFactory - issue initializing elementsFri Nov 01, 2019 8:40 pmthegoatboy
Selenium making automatic connection to random urlsMon Jul 08, 2019 12:58 pmrepairtechsolutions1
How can we design the custom framework in Selenium RCMon Jun 24, 2019 2:26 pmrandybonnettes
What are the new features in Selenium 3.0Tue Jun 18, 2019 5:37 pmpappyvicky
What are you using Selenium for? Fri Apr 12, 2019 3:52 amzhl
LIMITATIONS OF SELENIUMWed Apr 10, 2019 11:23 amswara
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Go down
avatar
madisonli2007
Posts : 5
Join date : 2010-08-03

selenium.isElementPresent("some_button") is not reliable Empty 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? Smile
Any thoughts?
Advisor
Advisor
------------------------
------------------------
Posts : 387
Join date : 2009-07-30
Location : India
https://seleniumforum.forumotion.net

selenium.isElementPresent("some_button") is not reliable Empty 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
avatar
madisonli2007
Posts : 5
Join date : 2010-08-03

selenium.isElementPresent("some_button") is not reliable Empty 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.
avatar
metman
Amateur
Amateur
Posts : 58
Join date : 2010-04-02

selenium.isElementPresent("some_button") is not reliable Empty 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. Smile 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.
Sponsored content

selenium.isElementPresent("some_button") is not reliable Empty Re: selenium.isElementPresent("some_button") is not reliable

Back to top
Permissions in this forum:
You cannot reply to topics in this forum