This is a migrated thread and some comments may be shown as answers.

Element identifier to use only xpath property

1 Answer 118 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Meher
Top achievements
Rank 1
Meher asked on 10 Mar 2014, 03:44 AM
Hi,

I have a couple of  websites to automate and they only differ in data. i.e. all the CSS is same.
Consider the 2 websites:
http://tradetrucks.com.au/
http://tradefarmmachinery.com.au/

I need to click on 1st element  on the home page of tradetrucks, which has the xpath:/html/body/div/div/div/div[3]/div/form/div/div/div/div/div/a
and the 1st element on the home page of tradefarmmachinery also has same xpath: /html/body/div/div/div/div[3]/div/form/div/div/div/div/div/a

But, when I record the test of clicking on the element in test studio on one of the website, I cannot reuse it for other website because the teststudio considers all the properties of element to identify it.

How do I make test studio use only xpath in identifying this single element. The rest of the elements in the test have to be identified with all properties.

Please help.

Thanks,
Meher

1 Answer, 1 is accepted

Sort by
0
Boyan Boev
Telerik team
answered on 13 Mar 2014, 08:35 AM
Hi Meher,

Thank you for contacting us.

You just need to edit the find expression of the element. Add the XPath find rule and remove the others.

Here is a demonstration video.

Hope this helps.

Regards,
Boyan Boev
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
Meher
Top achievements
Rank 1
Answers by
Boyan Boev
Telerik team
Share this question
or