0

I need to configure xpath or css for selection under red border i.e a name contains "Patient List"

enter image description here

asked Jul 7, 2016 at 10:03
2
  • May be you want to provide html snippet instead of image. Commented Jul 8, 2016 at 8:41
  • Flagged the question because it is not test related. Commented Jul 14, 2016 at 18:42

2 Answers 2

1

I know that you asked for either XPath of CSS but do not forget if you are using selenium webdriver you could also use linkText and partialLinkText.

Here is a Java example of find by "linkText" then click:

driver.findElement(By.linkText("Patient List")).click();

Or you could also use "partialLinkText" then click:

driver.findElement(By.partialLinkText("Patient List")).click();
alecxe
11.4k11 gold badges52 silver badges107 bronze badges
answered Jul 14, 2016 at 17:43
1

This should be quite simple with xpath:

//li[@class='open']//a[text()='Patient List']
answered Jul 7, 2016 at 11:14

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.