Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» FlexMonkium Download Not available under Gorillalogic site
Thu Dec 08, 2016 5:40 pm by bhanu.praveen

» Selenium Script issue
Tue Dec 06, 2016 9:48 pm by njain213

» Difference between QTP, Selenium and Silk test
Tue Dec 06, 2016 7:58 pm by jessicacyrus1

» Where does selenium script pick browser from
Tue Dec 06, 2016 1:52 pm by janbaskt

» Safari throws an HTTP ERROR: 404
Tue Dec 06, 2016 1:51 pm by janbaskt

» Access Denied Error in Selenium RC
Tue Dec 06, 2016 1:51 pm by janbaskt

» Automating Flex application through selenium webdriver
Fri Dec 02, 2016 2:06 pm by abhinay.krs

» Starting with Selenium, what is Selenium?
Mon Nov 28, 2016 4:00 pm by Foma

» Getting started with Selenium
Mon Nov 28, 2016 3:23 pm by Rebbelx

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Automation fails, continuous update on page (Java).

View previous topic View next topic Go down

Automation fails, continuous update on page (Java).

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

Zizzy

Posts : 5
Join date : 2010-11-24

Back to top Go down

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

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

Adviser
------------------------
------------------------

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

http://seleniumforum.forumotion.net

Back to top Go down

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

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

Zizzy

Posts : 5
Join date : 2010-11-24

Back to top Go down

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

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

Zizzy

Posts : 5
Join date : 2010-11-24

Back to top Go down

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

Post by yoursjcp on Mon Nov 29, 2010 7:11 pm

use firebug to find the xpath easily...

yoursjcp
Active particpant
Active particpant

Posts : 10
Join date : 2010-07-22

Back to top Go down

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

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

Zizzy

Posts : 5
Join date : 2010-11-24

Back to top Go down

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

Post by Zizzy on Tue Nov 30, 2010 5:41 pm

The XPaths keeps changing as well. FML.

Zizzy

Posts : 5
Join date : 2010-11-24

Back to top Go down

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

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

yoursjcp
Active particpant
Active particpant

Posts : 10
Join date : 2010-07-22

Back to top Go down

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

Post by Sponsored content Today at 3:53 pm


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