Automation fails, continuous update on page (Java).
Page 1 of 1 • Share •
Automation fails, continuous update on page (Java).
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
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
Zizzy- Posts: 5
Join date: 2010-11-24
Re: Automation fails, continuous update on page (Java).
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
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
Re: Automation fails, continuous update on page (Java).
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
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
Zizzy- Posts: 5
Join date: 2010-11-24
Re: Automation fails, continuous update on page (Java).
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".
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".
Zizzy- Posts: 5
Join date: 2010-11-24
Re: Automation fails, continuous update on page (Java).
use firebug to find the xpath easily...

yoursjcp- Active particpant

- Posts: 10
Join date: 2010-07-22
Re: Automation fails, continuous update on page (Java).
Thanks for the reply yoursjcp I will have a look and report back. Currently looking at the java source to identify the dropdown xpaths.
Zizzy- Posts: 5
Join date: 2010-11-24
Re: Automation fails, continuous update on page (Java).
The XPaths keeps changing as well. FML.
Zizzy- Posts: 5
Join date: 2010-11-24
Re: Automation fails, continuous update on page (Java).
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.
if u cant send here send me as a PM.

yoursjcp- Active particpant

- Posts: 10
Join date: 2010-07-22
Similar topics» Off-page optimization Tips
» السلام عليكم ورحمة الله الان برنامج charles3.6.5.java.carack بين ايديكم وعلى اكثر من سيرفر
» Samsung all hardware solution in one page.. daily updated.. get..set.. go..
» Update News
» How to update The sims 3 (1.0.615 to 1.2.7)
» السلام عليكم ورحمة الله الان برنامج charles3.6.5.java.carack بين ايديكم وعلى اكثر من سيرفر
» Samsung all hardware solution in one page.. daily updated.. get..set.. go..
» Update News
» How to update The sims 3 (1.0.615 to 1.2.7)
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum

» sample webdriver code for php users
» which standalone server to use
» Dynamic Drop Down Selection
» It is possible to find list of all URL's exist in any web page in selenium ide
» It is possible to compare 2 same images in selenium IDE.
» how to compare 2 ULR's which is exist in same web page (View page source).
» Web Driver: Unable to click a link present inside the frame of a frameset
» Help me to get dynamicaly loaded options of dropdown in Selenium RC -Junit test case