Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

1 like 0 dislike
641 views
in Selenium by
Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: Element is not clickable at point (413, 63). Other element would receive the click: <div id="wait" width="100%" height="100%" class="wait" style="position: absolute; top: 0px; left: 0px; height: 666px; width: 1366px; display: block; cursor: wait;">...</div>
  (Session info: chrome=53.0.2785.143)
  (Driver info: chromedriver=2.24.417431 (9aea000394714d2fbb20850021f6204f2256b9cf),platform=Windows NT 6.3.9600 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 94 milliseconds
Build info: version: 'unknown', revision: 'c7b525d', time: '2016-09-01 14:52:30 -0700'
System info: host: 'ICDVM', ip: '10.0.0.11', os.name: 'Windows Server 2012 R2', os.arch: 'amd64', os.version: '6.3', java.version: '1.8.0_102'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, networkConnectionEnabled=false, chrome={chromedriverVersion=2.24.417431 (9aea000394714d2fbb20850021f6204f2256b9cf), userDataDir=C:\Users\ADMINI~1\AppData\Local\Temp\scoped_dir16420_7494}, takesHeapSnapshot=true, pageLoadStrategy=normal, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=false, version=53.0.2785.143, platform=WIN8_1, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true}]
Session ID: e24f7435d75ad5ddbecb362090ddb0a3
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:631)
at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:284)
at org.openqa.selenium.remote.RemoteWebElement.click(RemoteWebElement.java:84)
at script.Script.main(Script.java:78)
 
by The go-to Tester (181 points)
It looks like you are trying to work with an element which is either has layered on top of it or it is moving e.g. Menu item layering own during mouse over.

Can you post an example of an element you are trying to click on?
by
package script;

import java.util.concurrent.TimeUnit;
//import org.junit.*;
//import static org.junit.Assert.*;
//import static org.hamcrest.CoreMatchers.*;
import org.openqa.selenium.*;
import org.openqa.selenium.chrome.ChromeDriver;
//import org.openqa.selenium.firefox.FirefoxDriver;
//import org.openqa.selenium.support.ui.Select;
//Completed Jobs for backward reporting

public class Script {
    public static void main(String[] args)throws Exception {
         
         WebDriver driver;
            //String baseUrl;
            //driver = new FirefoxDriver();
            String exePath = "C:\\Users\\shipra\\Download\\chromedriver.exe";
            System.setProperty("webdriver.chrome.driver", exePath);
            driver=new ChromeDriver();
           // baseUrl = "http://maximo76:9080/";
            driver.manage().timeouts().implicitlyWait(300, TimeUnit.SECONDS);
            driver.manage().window().maximize();
    driver.get("http://10.0.0.14:9080/maximo/webclient/login/login.jsp");
    // Enter UserName and Password
     driver.findElement(By.id("username")).clear();
        driver.findElement(By.id("username")).sendKeys("KTQCPLANA");
        driver.findElement(By.id("password")).clear();
        driver.findElement(By.id("password")).sendKeys("password");
        // Click on 'Sign In' button
        driver.findElement(By.id("loginbutton")).click();
        
        // Goto WOTRACK application
        driver.findElement(By.id("FavoriteApp_WOTRACK")).click();
        // Click new workorder,Supervisor,Worktype
        
        driver.findElement(By.id("toolactions_INSERT-tbb_image")).click();
        System.out.println("after 1");
        Thread.sleep(1000);
        driver.findElement(By.id("mad3161b5-tb2")).click();
        Thread.sleep(1000);
        driver.findElement(By.id("m7b0033b9-img")).click();
        Thread.sleep(1000);
        System.out.println("after 2");  
        driver.findElement(By.id("LOCATIONS_locations0_a_tnode")).click();
        Thread.sleep(1000);
        System.out.println("after 2.1");
        driver.findElement(By.id("lookup_page1_tdrow_[C:0]_ttxt-lb[R:1]")).click();
        Thread.sleep(1000);
        System.out.println("after 2.2");
        driver.findElement(By.id("mb2eb834-img")).click();
        Thread.sleep(1000);
        System.out.println("after 3");
        driver.findElement(By.id("NORMAL_normal0_a_tnode")).click();
        Thread.sleep(2000);
        System.out.println("after 3.1");
        driver.findElement(By.id("lookup_page1_tdrow_[C:0]_ttxt-lb[R:7]")).click();
        Thread.sleep(2000);
        System.out.println("after 3.2");
        driver.findElement(By.id("me2096203-img")).click();
        Thread.sleep(2000);
        System.out.println("after 4.1");
        driver.findElement(By.id("lookup_page1_tdrow_[C:0]_ttxt-lb[R:2]")).click();
        Thread.sleep(1000);
        System.out.println("after 4.2");
        driver.findElement(By.id("ROUTEWF__-tbb_image")).click();
        System.out.println("after 5");
        Thread.sleep(1000);
        driver.findElement(By.id("m4280cc7e-img")).click();
        System.out.println("after 5.1");
        driver.findElement(By.id("menu0_WOWF1PRG_OPTION_a_tnode")).click();
        System.out.println("after 5.2");
        Thread.sleep(1000);
        driver.findElement(By.id("m7ca62696-pb")).click();
        System.out.println("after 5.3");
        Thread.sleep(1000);
        driver.findElement(By.id("ROUTEWF__-tbb_image")).click();
        System.out.println("after 7");
        Thread.sleep(1000);
        driver.findElement(By.id("mc3331876-pb")).click();
        System.out.println("after 8");
        driver.findElement(By.id("mc1493e00-rb")).click();
        System.out.println("after 9");
        Thread.sleep(1000);
        driver.findElement(By.id("m37917b04-pb")).click();
      //for close the browser
        //driver.quit();
       System.out.println("successful");
    }
}
by The go-to Tester (181 points)
Try avoiding Thread.sleep and use

WebDriverWait wait = new WebDriverWait(driver, 15);
wait.until(ExpectedConditions.elementToBeClickable(signInMenuButton));
by
if i use WebDriverWait wait = new WebDriverWait(driver, 15);
wait.until(ExpectedConditions.elementToBeClickable(signInMenuButton));
is showing error.
 Actully i am new is selenium
by The go-to Tester (181 points)
Can you post what error you're getting?
by
if i write WebDriverWait wait = new WebDriverWait(driver, 15);
wait.until(ExpectedConditions.elementToBeClickable(signInMenuButton)); then i import the WebDriverWait and ExpectedConditions. after that signInMenuButton give the error: signInMenuButton cannot be resolved to a variable
by The go-to Tester (181 points)
Okay, you need to replace signInMenuButton with your element.

First debug your code and figure out where the problem is. Use WebDriverWait there.
by
if i click signInMenuButton then i have four option 1. create localvariable 2. create field 3. create parameter 4. create constant which one ?
by The go-to Tester (181 points)
I gave you a sample code. Kindly construct your own code following the sample one.
by
give me the code sir
by The go-to Tester (181 points)
If you are using an element which is moving, such as dropdown, try using explicit wait for clickable.

 

WebDriverWait wait = new WebDriverWait(driver, 15);
wait.until(ExpectedConditions.elementToBeClickable(signInMenuButton));
 

Also try to use JavaScript to click on an element if normal click does not work.

  JavascriptExecutor exe = (JavascriptExecutor)driver;
  exe.executeScript("arguments[0].click();", signInMenuButton);
by The go-to Tester (181 points)
The goal of this forum is to help you with the error. Not to write the code for any user. That is something you have to learn and try by yourself.
by New User (10 points)
Thankyou i will try

1 Answer

0 like 0 dislike
by The go-to Tester (181 points)

If you are using an element which is moving, such as dropdown, try using explicit wait for clickable.

 

WebDriverWait wait = new WebDriverWait(driver, 15);
wait.until(ExpectedConditions.elementToBeClickable(signInMenuButton)); 
 

Also try to use JavaScript to click on an element if normal click does not work.

  JavascriptExecutor exe = (JavascriptExecutor)driver;
  exe.executeScript("arguments[0].click();", signInMenuButton);

 

Hope that helps.


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

1.4k questions

1.6k answers

866 comments

1.9k users

...