0

To start with the project is working fine before and recently I got new computer in my office where I need to configure eclipse and selenium from the beginning. So I downloaded new versions and tried to execute the existing project. Then I stat getting errors. When I use the selenium standalone server 3.0.1 jar file I get following error

Starting ChromeDriver 2.21.371459 (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4) on port 19354
Only local connections are allowed.
Jan 19, 2017 1:20:08 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Attempting bi-dialect session, assuming Postel's Law holds true on the remote end
Jan 19, 2017 1:20:08 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: OSS
java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at ilms.ILMSSmoke.ILMSSmoke.main(ILMSSmoke.java:49)
Caused by: org.openqa.selenium.NoSuchSessionException: no such session
  (Driver info: chromedriver=2.21.371459 (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4),platform=Windows NT 10.0 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 8 milliseconds
Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:48:19 -0700'
System info: host: 'USARRVTANGUTUR4', ip: '172.19.113.118', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_121'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{message=unknown error: cannot create temp dir for user data dir
  (Driver info: chromedriver=2.21.371459 (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4),platform=Windows NT 10.0 x86_64), platform=ANY}]
Session ID: 5f757af2dcf474dd05d4edf93b323be5
*** Element info: {Using=link text, value=LOG OUT}
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:216)
    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:168)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:635)
    at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:368)
    at org.openqa.selenium.remote.RemoteWebDriver.findElementByLinkText(RemoteWebDriver.java:425)
    at org.openqa.selenium.By$ByLinkText.findElement(By.java:246)
    at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:360)
    at ilms.AmtrakTestDriver.AmtrakTestDriver.login(AmtrakTestDriver.java:13)
    at ilms.ILMSSmoke.ILMSSmoke.editVacBid(ILMSSmoke.java:238)
    ... 5 more
java.io.IOException: The system cannot find the path specified
    at java.io.WinNTFileSystem.createFileExclusively(Native Method)
    at java.io.File.createTempFile(File.java:2024)
    at org.apache.poi.util.TempFile$DefaultTempFileCreationStrategy.createTempFile(TempFile.java:105)
    at org.apache.poi.util.TempFile.createTempFile(TempFile.java:60)
    at org.apache.poi.openxml4j.opc.ZipPackage.closeImpl(ZipPackage.java:341)
    at org.apache.poi.openxml4j.opc.OPCPackage.close(OPCPackage.java:432)
    at org.apache.poi.POIXMLDocument.close(POIXMLDocument.java:191)
    at ilms.ILMSSmoke.ILMSSmoke.main(ILMSSmoke.java:80)

If I use Selenium server 2.53.0 then the following error is displayed

Starting ChromeDriver 2.21.371459 (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4) on port 19354
Only local connections are allowed.
java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at ilms.ILMSSmoke.ILMSSmoke.main(ILMSSmoke.java:49)
Caused by: java.lang.UnsatisfiedLinkError: Failed to create temporary file for /com/sun/jna/win32-x86-64/jnidispatch.dll library: Access is denied
    at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:776)
    at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:736)
    at com.sun.jna.Native.<clinit>(Native.java:131)
    at org.openqa.selenium.os.Kernel32.<clinit>(Kernel32.java:34)
    at org.openqa.selenium.os.ProcessUtils.killWinProcess(ProcessUtils.java:133)
    at org.openqa.selenium.os.ProcessUtils.killProcess(ProcessUtils.java:81)
    at org.openqa.selenium.os.UnixProcess$SeleniumWatchDog.destroyHarder(UnixProcess.java:247)
    at org.openqa.selenium.os.UnixProcess$SeleniumWatchDog.access$2(UnixProcess.java:246)
    at org.openqa.selenium.os.UnixProcess.destroy(UnixProcess.java:125)
    at org.openqa.selenium.os.CommandLine.destroy(CommandLine.java:155)
    at org.openqa.selenium.remote.service.DriverService.stop(DriverService.java:196)
    at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:94)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:644)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:701)
    at org.openqa.selenium.remote.RemoteWebDriver.quit(RemoteWebDriver.java:526)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:134)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:144)
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:170)
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:159)
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:116)
    at ilms.TestDriver.selectDriver(TestDriver.java:78)
    at ilms.TestDriver.<init>(TestDriver.java:27)
    at ilms.AmtrakTestDriver.AmtrakTestDriver.<init>(AmtrakTestDriver.java:9)
    at ilms.schedule.Schedule.<init>(Schedule.java:13)
    at ilms.ILMSSmoke.ILMSSmoke.editVacBid(ILMSSmoke.java:232)
    ... 5 more
java.io.IOException: The system cannot find the path specified
    at java.io.WinNTFileSystem.createFileExclusively(Native Method)
    at java.io.File.createTempFile(File.java:2024)
    at org.apache.poi.util.TempFile$DefaultTempFileCreationStrategy.createTempFile(TempFile.java:105)
    at org.apache.poi.util.TempFile.createTempFile(TempFile.java:60)
    at org.apache.poi.openxml4j.opc.ZipPackage.closeImpl(ZipPackage.java:341)
    at org.apache.poi.openxml4j.opc.OPCPackage.close(OPCPackage.java:432)
    at org.apache.poi.POIXMLDocument.close(POIXMLDocument.java:191)
    at ilms.ILMSSmoke.ILMSSmoke.main(ILMSSmoke.java:80)

Not sure whats the wrong I am doing. I tried uninstalling chrome and reinstalling it as stated in ChromeWebDriver - unknown error: Chrome failed to start: crashed. still not working. Any help would be appreciated Thanks

Community
  • 1
  • 1
Vin
  • 165
  • 2
  • 12

2 Answers2

1

Based on these error messages:

java.io.IOException: The system cannot find the path specified 

.

java.lang.UnsatisfiedLinkError: Failed to create temporary file for /com/sun/jna/win32-x86-64/jnidispatch.dll library: Access is denied

it looks like Eclipse is trying to create temporary files but can't. Try running Eclipse with elevated privileges (i.e. Run as Administrator) and see if you still get the same error messages.

akousmata
  • 1,005
  • 14
  • 34
  • Thanks for the response. After running as admin I am able to proceed further and got the browser opened but I got another error saying Chromedriver.exe stopped working. When I try as a new project the browser is working fine. The existing project is not working – Vin Jan 19 '17 at 20:04
-1

After doing some research I am able to run the code with no errors. The solution I did was created new java class and named same as the old class followed by 1. And copied the code to new class. I refereed the new class name where ever the code is using and removed the old class from the project package. For Chromedriver.exe stopped working issue I found there are more than one chromedriver instance in my task manager and ended all instances. That helped me to run smoothly.

Vin
  • 165
  • 2
  • 12