I have a few elements inside this kind of tag as below:
How do I locate these kinds of elements
I tried to locate the foresaid element, which the Selenium C# is not working
CodePudding user response:
give the p tag you are looking for an id. Then lookup the element using
var driver = //whatever your driver is;
driver.FindElement(By.Id("element-id-goes-here"));
CodePudding user response:
You can use xpath to locate the p element:
//div[@data-testid='patientLink']/p
Later you can call the getText() of the element located by the above selector.