0

I am using given below xpath but my script is not clicking on these element
Login_Btn = "(//a[contains(text(),'Login')])[2]";

OR

"//div[@id='bd_login']/a" ;

driver.findElement(By.xpath(Login_Btn)).click();

FED code :

<div class="row emailExist">
<div class="rowL">
<div class="rowR">
<div class="cover">
<i id="bd_email_err" class="erLbl"/>
<div id="bd_login" class="dspN" style="margin-top:5px">
An account already exists for this email. Please use a different email or 
<a ").click();"="" #login_layer="" onclick="$(" href="javascript:;">Login</a>
</div>
</div>
</div>
  • please share html so we can help – sameer joshi Mar 2 '16 at 10:41
2

Try this

WebElement element = driver.findElement(By.xpath(Login_Btn));
JavascriptExecutor executor = (JavascriptExecutor)driver;
executor.executeScript("arguments[0].click();", element);
  • 2
    you should add description for your answer, so that user can understand the meaning of code. – Jeevan Bhushetty Mar 2 '16 at 12:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.