Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» how to connect DB in selenium webriver
Fri Oct 06, 2017 4:09 pm by anbarasi

» How find any text in browser screen and click on it?
Thu Oct 05, 2017 2:02 pm by sandeepkommineni

» Selenium Webdriver
Tue Oct 03, 2017 1:35 pm by PiyushBiswas

» GRID setup tutorial.
Wed Sep 27, 2017 4:29 pm by johnyapp

» Drag & Drop Between Windows Using Selenium Driver
Wed Sep 27, 2017 2:10 pm by 26rondel

» Check if window is closed / verify input
Sat Sep 23, 2017 10:21 pm by brainstir

» How to work on pages with AJAX in selenium?
Mon Sep 18, 2017 6:08 pm by azharuddin

» pause test until user press a key like F2
Wed Aug 09, 2017 11:10 pm by djnforce

» Selecting the input for auto populating element
Sat Jul 29, 2017 7:53 pm by kdabbara

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

selenium.isElementPresent("some_button") is not reliable

View previous topic View next topic Go down

selenium.isElementPresent("some_button") is not reliable

Post by madisonli2007 on 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?

madisonli2007

Posts : 5
Join date : 2010-08-03

Back to top Go down

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

Post by Adviser on 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
Adviser
------------------------
------------------------

Posts : 379
Join date : 2009-07-30
Location : India

http://seleniumforum.forumotion.net

Back to top Go down

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

Post by madisonli2007 on 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.

madisonli2007

Posts : 5
Join date : 2010-08-03

Back to top Go down

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

Post by metman on 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.

metman
Amateur
Amateur

Posts : 58
Join date : 2010-04-02

Back to top Go down

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

Post by Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

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