Reputation: 81
I am writing Selenium webdriver code using c#. Can we find an element using text present on a page like I wanted to assert that on button click, this text from a paragraph is present on the next page.
Thanks
Upvotes: 0
Views: 1857
Reputation: 591
Yes it is possible you can try some thing like this
driver.findElement(By.xpath("//a[contains(text(),'Text - CHOLERA UNS')]")).click()
Upvotes: 3