huges
huges

Reputation: 31

Error in selenium when running firefox

I am getting below error when I try to click on one element in Firefox browser.

Element is not clickable at point (320.2166748046875, 55). Other element would receive the click: <a class="navbar-brand" href="#"></a>

Selenium code

WebElement p = driver_new.findElement(By.xpath("html/body/div[2]/div/form/fieldset[2]/div[3]/div/div[2]/a[1]/div/div/div[2]"));
p.click();

Please help to resolve it.

Upvotes: 2

Views: 75

Answers (1)

Saurabh Gaur
Saurabh Gaur

Reputation: 23835

If you have tried all but didn't get success, you should try using javascriptExecutor to perform click as below :-

import org.openqa.selenium.JavascriptExecutor;

WebElement bp = driver_new.findElement(By.xpath("html/body/div[2]/div/form/fieldset[2]/div[3]/div/div[2]/a[1]/div/div/div[2]"));
((JavascriptExecutor)driver_new).executeScript("arguments[0].click()", bp);

Upvotes: 1

Related Questions