2

I have been struggling with this issue for some time and maybe someone from here has come across it and might provide me with any suggestions or solutions.

I have a fully working Test Framework with a Test Suite written in C#. All test are executed correctly on any local machine. When I log into VM where our Jenkins is set up, I am also able to run my Test Suite from the command line using nunit3-console.exe ... Now my hard time has started when I created a working Job in Jenkins which triggers my automation tests each time one of the development builds is done.

Each time when my Automation Jenkins Job is run, it finished as a failed run on the same test case over and over which is executed correctly either on the local machine or by command line.

The error message is always the same which is "unknown error: Element ... is not clickable at point (735, 91) . Another element would receive the click:..." I have tried to use explicit and implicit waits because I thought that maybe this is connected with some sort of a driver timeouts. Nothing really helped. I do not quite understand why this test case passed each time on local or run via command line on VM where Jenkins is but not when the Jenkins job is actually run.

Thank you for your time and answers,

3 Answers 3

3

When Selenium returns "Element is not clickable at the point" it usually means that the element is present on UI (in DOM) but it is covered with some other UI element that catches the click and handles it.

This could be a layout issue that might be caused by different screen sizes of the browsers when they run on your run and on Jenkin's run. So smaller size makes the elements overlap each other and thus the element that is on top intercept the action.

To troubleshoot I would recommend to introduce screen-shot saving on fail so that you can analyse how the user view looked like when failure happened.

3
  • Thank you for your reply Alexey R. I have thought about the same idea of implementing screen-shot saving in order to see how Jenkins triggers the execution, because as I said. When I run all test locally, they work fine, when I run all test on Jenkins machine via nunit3, they work fine as well. However, when Jenkins does the execution of them fails with the error message which I gave at the beginning. Mar 21, 2018 at 12:08
  • @Automation_Padawan Then do it! And let us know if that helped you get to the bottom of your issue.
    – Adam White
    Oct 29, 2020 at 3:56
  • Adam White, adding screenshot capture helped me debug what was causing the issue :) Oct 30, 2020 at 8:22
1

I think element is covered with some other element so not clickable hence execute the click via JavaScript.

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

Question : Is Jenkins installed as a service or standalone ?

Possible reason :

  1. If your element is visible but not clickable that could be the possible reason ,

Solution : condition wait is one solution wait.until(ExpectedConditions.invisibilityOfElementLocated("element")

  1. Some time it might be possible that one element is overlapping with other, so it is not clickable, in short the element is not visible to click.

Solution:
Action class

WebElement element = driver.findElement(By("element_path"));

Actions actions = new Actions(driver);

actions.moveToElement(element).click().perform()

JavaScript

JavascriptExecutor jse = (JavascriptExecutor)driver; jse.executeScript("scroll(250, 0)"); (if the element is on top.) jse.executeScript("scroll(0, 250)"); (if the element is on bottom.)

then try to click on element.

  1. Another possible reason is due to screen size. Due to difference in screen size the elements overlap each other and hide the element or make it inactive. So once we will full screen the window, the overlapped element will then be available for click.

Solution : driver.manage().window().fullscreen();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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