learner 0 Posted October 22, 2017 Report Share Posted October 22, 2017 I'm using xPath Builder Pro to help write an xPath statement and Im trying to figure out how to add a parameter. For example there are lots of buttons all with the same class name so I believe the statement is created correctlyx://a[@class=class name] When I test this function it returns all the names of the buttons which all have the same class. This sounds like its working.But I just want to click 1 particular button with a specific name but I can't figure out how it should look... I have another similar existing xpath which does something similar so I copied the format like this but it doesn't work. x:(//a[@class=class name])[button name] Any ideas? Thanks! Quote Link to post Share on other sites
HelloInsomnia 1103 Posted October 23, 2017 Report Share Posted October 23, 2017 If you can post the code of the button or ideally just the code of the entire page and point out what you want it would be a big help. Otherwise, you have a couple of options here. You can use an offset but it would be better if you can target that element specifically by maybe first targeting a parent element and then moving down the tree. Quote Link to post Share on other sites
learner 0 Posted October 23, 2017 Author Report Share Posted October 23, 2017 thanks, someone helped me figure it out. I was missing the contains text parameters //a or div[contains(text(),'text searching for')] Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.