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
Zizzy
Posts : 5
Join date : 2010-11-24

Automation fails, continuous update on page (Java). Empty Automation fails, continuous update on page (Java).

Wed Nov 24, 2010 6:36 pm
Here are 2 examples. When recording with IDE i get this code:

selenium.type("u9", "TestH05");
selenium.select("ca", "label=2 - Submission for export");

So obviously when it wants to "type" in a field, it searches for the ID (locator) "u9" and when it looks for the dropdown box, it searches for the ID "ca". Now this page gets updated regularly (daily if you will) and so the IDs (locators) keep changing. So after the page has been updated my code obviously doesn't work anymore since the IDs ("u9" and "ca") changed. Here is an example of what error I would get for the select example: ERROR: Specified element is not a Select (has no options). Obviously, cause the ID can't be found.

Can anyone help me or tell me how to let the code update the IDs (locators) with the changes of the page updates.

Thanks

Kind Regards,
Zizzy
Advisor
Advisor
------------------------
------------------------
Posts : 387
Join date : 2009-07-30
Location : India
https://seleniumforum.forumotion.net

Automation fails, continuous update on page (Java). Empty Re: Automation fails, continuous update on page (Java).

Fri Nov 26, 2010 10:22 pm
Hi,

Try to use xpath or CSS instead of id to locate the object. If the position and option of your object is fixed then u can use those freely.

For xpath , use the xpather add on to create it. With help of xpath you are pointing to specific position not the id.

Ex:

selenium.type("xpath=//div[1]/div[2]/div[2]/form[@id='search-form']/div[@id='search-query']/select[1]", "TestH05");

Try above option, hope this will help you. best of luck.

Bye
avatar
Zizzy
Posts : 5
Join date : 2010-11-24

Automation fails, continuous update on page (Java). Empty Re: Automation fails, continuous update on page (Java).

Mon Nov 29, 2010 2:28 pm
Thanks for the reply. I am new to xpath, but I downloaded xpath checker. Now the field where I want to type "TestH05" in gives me the following when I say "View XPath":

id('nodeemcsdeclarationsearchnodeemcsdeclarationsearchOriginalLocalReferenceNumber')

So how would I write this in selenium code?

Also, this is to find a "Search" button: id('SearchBtn')/x:tbody/x:tr/x:td/x:span

Thanks
avatar
Zizzy
Posts : 5
Join date : 2010-11-24

Automation fails, continuous update on page (Java). Empty Re: Automation fails, continuous update on page (Java).

Mon Nov 29, 2010 6:42 pm
Nevermind, I got it working.

An offtopic question. Does anyone know how to get the XPath of a dropdown box? You cannot right click it to say "XPather" or "View Xpath". Sad
yoursjcp
yoursjcp
Active particpant
Active particpant
Posts : 10
Join date : 2010-07-22

Automation fails, continuous update on page (Java). Empty Re: Automation fails, continuous update on page (Java).

Mon Nov 29, 2010 7:11 pm
use firebug to find the xpath easily...
avatar
Zizzy
Posts : 5
Join date : 2010-11-24

Automation fails, continuous update on page (Java). Empty Re: Automation fails, continuous update on page (Java).

Mon Nov 29, 2010 7:40 pm
Thanks for the reply yoursjcp I will have a look and report back. Currently looking at the java source to identify the dropdown xpaths.
avatar
Zizzy
Posts : 5
Join date : 2010-11-24

Automation fails, continuous update on page (Java). Empty Re: Automation fails, continuous update on page (Java).

Tue Nov 30, 2010 5:41 pm
The XPaths keeps changing as well. FML.
yoursjcp
yoursjcp
Active particpant
Active particpant
Posts : 10
Join date : 2010-07-22

Automation fails, continuous update on page (Java). Empty Re: Automation fails, continuous update on page (Java).

Wed Dec 15, 2010 4:48 pm
If u have no restrictions can i get the link for which u r chkng??

if u cant send here send me as a PM.
Sponsored content

Automation fails, continuous update on page (Java). Empty Re: Automation fails, continuous update on page (Java).

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