Join 500+ Software Testing professionals. Solve problem and get your problem solved. Register Now!

1
Exception in thread "main" org.openqa.selenium.WebDriverException::

Solved 1 Answers 869 Views Selenium
1 1

When I try to click on a Button "Change" Webdriver(Java) throws the error message.

 

Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: Element is not clickable at point (238, 313). Other element would receive the click: <div class="row profile-account">...</div>
  (Session info: chrome=51.0.2704.84)
  (Driver info: chromedriver=2.21.371459 (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4),platform=Windows NT 6.2 x86) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 41 milliseconds
Build info: version: '2.53.0', revision: '35ae25b', time: '2016-03-15 16:57:40'
System info: host: 'udhai', ip: '192.168.1.4', os.name: 'Windows 8', os.arch: 'x86', os.version: '6.2', java.version: '1.8.0_91'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, chrome={chromedriverVersion=2.21.371459 (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4), userDataDir=C:\Users\admin\AppData\Local\Temp\scoped_dir4292_17462}, takesHeapSnapshot=true, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=false, version=51.0.2704.84, platform=WIN8, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true}]
Session ID: 900a99b2bb681f7e19f28211ba05bec6
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:678)
at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:327)
at org.openqa.selenium.remote.RemoteWebElement.click(RemoteWebElement.java:85)
at newpackage.MyClass.main(MyClass.java:334)
 
CODE PIECE:
===========
Thread.sleep(10000);
    driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS); 
    WebElement changebutton = driver.findElement(By.name("1002_1002_1002_1020_ProfileImage"));
    builder.moveToElement(changebutton).perform();
    Thread.sleep(100000);   
    changebutton.click();
    Thread.sleep(10000);
 
 
 
 
 

1 Answer

0
Best answer
0

Please find the answer for this question.

Never click on buttons that open dialog boxes where you input file names etc.

Instead you should use sendKeys   :

WebElement we = driver.findElement(By.name("1002_1002_1002_1020_ProfileImage"));   //The change button's name is //given in quotes.
 
we.sendKeys("C:\\users\\admin\\EminentIT\\potato_fry.png");
 
Thant would do the trick and no need to click();
 
Regards
Uday
answered by
selected by
1Comments
commented by (151 points)
Thank you Uday for answer

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.
...