I'm testing a website written in php language. I'm automating the test contents of number of clicks in the page, so using Selenium web driver (Java one), using cssSelector to identify the elements, but it is not working when executing the script:
WebElement element =
driver.findElement(
By.cssSelector(
".view-dom-id-d21931301746656c32fcf49fd08a0005 > div:nth-child(1) > div:nth-child(1) > a:nth-child(4)"
)
);
element.click();
I have tried using an xpath too. My question here is, whether cssSelector or xpath can be used to find the element in php?