0

Could anyone suggest how I can locate the element "ToBeSelected" that has the below html code:

<div id="Locate-17-tab-info" class="tab active" data-tab-name="tobeselected"> ToBeSelected </div>

The XPath driver.findElement(By.xpath("input[contains(@id, '-tab-info')]")).click();

I did not have success with finding by XPath - starts-with and ends-with.

1 Answer 1

0

You May try

driver.findElement(By.xpath(//input[contains(@id,'Locate') and text()='ToBeSelected'])).click();
Sign up to request clarification or add additional context in comments.

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.