Below is the tag I have in my html :
<span class="login-link">Log in</span>
And below is the code :
driver.findElement(By.cssSelector("#login > span")).click();
but I tried xPath, cssSelector and id, but it is not working.
Try using class selector also.
hash is used for referring id in css js. You must use dot(.) for directly referencing the element.
I am trying to locate an element ...READ MORE
To wait until the entire data has ...READ MORE
The element should be located with any ...READ MORE
The better way to handle this element ...READ MORE
enable trusted connection in internet explorer by ...READ MORE
To Allow or Block the notification, access using Selenium and you have to ...READ MORE
xpath are two types.
1) Absolute XPath:
/html/b ...READ MORE
You are using wrong xpath expression. This ...READ MORE
To pass customized dates e.g. 2017/07/14. You have ...READ MORE
Already have an account? Sign in.