I\'ve jjust started off with Selenium Webdriver and I\'ve hit an issuee straight away involving the buttons I\'m trying to select/click all have no IDs and share the same cl
Fairly easy if you use xpath
.
if it has unique text your xpath
should look like something like this
//button[.='xyz']
So, here "." points to the parent in HTML hierarchy and just look for text
You can find the link by the visible text.
IWebElement XyzLink= _browser.FindElement(By.LinkText("xyz"));
Also you can locate the link by partial link text as follows,
IWebElement XyzPartialLink= _browser.FindElement(By.PartialLinkText("XYZ"));
For example this will locate a link element which contains 'XYZ' in its text.