0

I have the below href link with the + sign. I don't have the Id or name for this. Is there any i can locate and click this [+] link. Can anybody please share the code.

<td class="expandCollapseLink"><a href="" onclick="toggleIds(889358, this); return false;">[+]  </a></td>
1
  • User want code already done by someone Commented Apr 17, 2014 at 14:44

2 Answers 2

1

You can use an element's inner text to locate the element. Try using the following XPATH to locate the link: //td[@class='expandCollapseLink']/a[contains(text(),'[+]')]

You may find this to be a useful cross-reference for different XPATH/CSS selectors in the future. I use it very frequently: https://www.simple-talk.com/dotnet/.net-framework/xpath,-css,-dom-and-selenium-the-rosetta-stone/

Sign up to request clarification or add additional context in comments.

Comments

0

//td[@class='expandCollapseLink']/a should be all the xpath selector you need. //td[@class='expandCollapseLink']/a[contains(@onclick,"toggleIds")] should also work and be a bit more specific.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.