0

I have just started working on Selenium Webdriver and wanted to try out a command that will identify any element based on the text it shows in the UI. The HTML Structure of the attribute is shown below.

<div class="cuesLoginProductName">Select One</div>

i want to identify the div name on the Text "Select One". Can this be done in Selenium Webdriver. I have done it before in Ruby using the command @browser.div(:text=>'Select One').present?

Please let me know how i can identify the element.

Thanks and Regards Sushanth.G

1 Answer 1

2

Try using xpath //div[text()='Select One']

Driver.findElements(By.xpath("//div[text()='Select One']"));
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.