Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» 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

» Selenium IDE Verify different Maps (Hybridview, Mapview etc.)
Fri Nov 25, 2016 9:56 pm by DJ87

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

2 Button exist with same name. How to make the script instead of using positions..

View previous topic View next topic Go down

2 Button exist with same name. How to make the script instead of using positions..

Post by a71688 on Mon Oct 27, 2014 7:00 pm

Hi,

I have following problem i.e. on my application I have 2 'Add' buttons in different position and xpath viewer says:


id('expanded')/x:li[1]/x:div/x:div/x:div/x:table/x:tbody/x:tr[1]/x:td[4]/x:a/x:img

One match found

1 +

id('expanded')/x:li[2]/x:div/x:div/x:div/x:table/x:tbody/x:tr[2]/x:td[4]/x:a/x:img

One match found

1 +



Code is:


open
${baseurl}/produkter/nemid_medarbejdersignatur/nemid_selvbetjening/Add_services/



waitForPageToLoad
60000



click
link=Add services



click
xpath=(//img[@alt='Add'])[9]



waitForElementPresent
name=_eventId_continue



clickAndWait
name=_eventId_continue




The position changes when more functionality is added.So I want that Selenium to click on 'Add' button next to where title is like 'Car A'and where I am not depended on position.

Above scenario work as i know the position, but I want it to be independent of position.

How shall i Write it..

a71688
Regular Participant
Regular Participant

Posts : 27
Join date : 2014-07-23

Back to top Go down

Re: 2 Button exist with same name. How to make the script instead of using positions..

Post by ccox on Sat Nov 01, 2014 2:09 am

Tell your developers to use unique IDs. Otherwise you are going to have to use XPath.

ccox
Master
Master

Posts : 205
Join date : 2012-01-06
Age : 31
Location : Denver, CO

Back to top Go down

Query solved

Post by a71688 on Fri Nov 14, 2014 11:13 pm

Solved

a71688
Regular Participant
Regular Participant

Posts : 27
Join date : 2014-07-23

Back to top Go down

Re: 2 Button exist with same name. How to make the script instead of using positions..

Post by Sponsored content Today at 1:18 am


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