I am testing a login page through selenium web-driver after providing all details it is not performing Click operation over the sigin button

0 votes

Exception I am getting

org.openqa.selenium.ElementClickInterceptedException: element click intercepted: Element <button class="btn  btn-primary btn-default" id="_com_liferay_login_web_portlet_LoginPortlet_INSTANCE_0_rumu" type="submit">...</button> is not clickable at point (852, 586). Other element would receive the click: <div class="bottom_foot">...</div>

I am using this code

public class CrmTest {

WebDriver driver;

@BeforeMethod

public void setUp() {

System.setProperty("webdriver.chrome.driver","C:\\Users\\Giks\\chromedriver_win32\\chromedriver.exe");

        driver = new ChromeDriver();

        driver.get("http://crm.giksindia.com/web/guest/login");

        driver.manage().window().maximize();

        driver.manage().deleteAllCookies();

        driver.manage().timeouts().pageLoadTimeout(30, TimeUnit.SECONDS);

        driver.manage().timeouts().implicitlyWait(40, TimeUnit.SECONDS);

}

    

      @Test

      public void LoginTest() {

      driver.findElement(By.xpath("//input[@placeholder='Screen Name']")).clear();

      driver.findElement(By.xpath("//input[@placeholder='Screen Name']")).sendKeys("x@sdfgzm.in");

      driver.findElement(By.xpath("//input[@placeholder='Password']")).sendKeys("tghjmkhvc");

      driver.findElement(By.tagName("button")).click();

      }

 @AfterMethod

 public void tearDown() {

driver.quit();

 }

}
Apr 18, 2020 in Software Testing by anonymous
• 120 points
598 views

2 answers to this question.

+1 vote

Hey, the error Element is not clickable at point (x, y) can arise from different factors. 

You can address them by either of the following procedures:

1. Element not getting clicked due to JavaScript or AJAX calls present

Try to use Actions Class:

WebElement element = driver.findElement(By.id("navigationPageButton"));
Actions actions = new Actions(driver);
actions.moveToElement(element).click().build().perform();

2. Element not getting clicked as it is not within Viewport

Try to use JavascriptExecutor to bring the element within the Viewport:

WebElement myelement = driver.findElement(By.id("navigationPageButton"));
JavascriptExecutor jse2 = (JavascriptExecutor)driver;
jse2.executeScript("arguments[0].scrollIntoView()", myelement); 

3. The page is getting refreshed before the element gets clickable.

In this case induce ExplicitWait i.e WebDriverWait as mentioned in point 4.

4. Element is present in the DOM but not clickable.

In this case induce ExplicitWait with ExpectedConditions set to elementToBeClickable for the element to be clickable:

WebDriverWait wait2 = new WebDriverWait(driver, 10);
wait2.until(ExpectedConditions.elementToBeClickable(By.id("navigationPageButton")));

5. Element is present but having temporary Overlay.

In this case, induce ExplicitWait with ExpectedConditions set to invisibilityOfElementLocated for the Overlay to be invisible.

WebDriverWait wait3 = new WebDriverWait(driver, 10);
wait3.until(ExpectedConditions.invisibilityOfElementLocated(By.xpath("ele_to_inv")));

6. Element is present but having permanent Overlay.

Use JavascriptExecutor to send the click directly on the element.

WebElement ele = driver.findElement(By.xpath("element_xpath"));
JavascriptExecutor executor = (JavascriptExecutor)driver;
executor.executeScript("arguments[0].click();", ele);

Hope this helps!

answered Apr 19, 2020 by Sirajul
• 59,050 points
+1 vote

Hi ,

Try to find is that button is inside any frames ....?

if it is yes then use like below code.

driver.switchto().frame() -

2 way : using 

JavascriptExecutor 
WebElement ele = driver.findElement(By.id("id"));
JavascriptExecutor executor = (JavascriptExecutor)driver;
executor.executeScript("arguments[0].click();", ele);

answered Aug 30, 2020 by Sri
• 3,010 points

Related Questions In Software Testing

+1 vote
1 answer
0 votes
0 answers

Selenium Driver.Pageload() is not working in safari browser

Am trying to wait tll page loads ...READ MORE

Jun 20, 2020 in Software Testing by Kumar
• 120 points
264 views
0 votes
2 answers

Click Element, Button (any click keyword) is not working on IE, though same is working on Chrome, safari, edge

Have you tried capabilities for ignore zoom ...READ MORE

answered Jul 28, 2020 in Software Testing by Pavan Andi
255 views
+1 vote
0 answers

Hello. Iam testing a php script and i get a notice error how do i fix it?

A PHP Error was encountered Severity: Notice Message: Undefined ...READ MORE

Aug 28, 2020 in Software Testing by Titus
• 150 points

edited Aug 28, 2020 by Niroj 253 views
0 votes
1 answer

Data driven test through Ms Excel is not entering the values properly in to the app only 1 is entering

Hi, @Faha, Chromedriver version should be shown in ...READ MORE

answered Oct 28, 2020 in Software Testing by Gitika
• 65,870 points
185 views
0 votes
1 answer
0 votes
1 answer

Select a row in AG-grid through selenium c# ..?

For every angular grid, angular generates the ...READ MORE

answered Jul 7, 2020 in Software Testing by Sirajul
• 59,050 points
1,062 views
0 votes
2 answers

What is the best way to learn automation testing?

Step 1: learn any programming language like ...READ MORE

answered Sep 1, 2020 in Software Testing by Sri
• 3,010 points
159 views