Trying to migrate our scripts to win10 and openjdk 11.0.2 from win7 and oraclejdk8
Steps to reproduce
1. Set up selenium grid successfully
Below is a log from it:
Hub
14:37:43.311 INFO [GridLauncherV3.parse] - Selenium server version: 3.141.0, revision: 2ecb7d9a
14:37:43.359 INFO [GridLauncherV3.lambda$buildLaunchers$5] - Launching Selenium Grid hub on port 4444
2019-03-04 14:37:43.772:INFO::main: Logging initialized @660ms to org.seleniumhq.jetty9.util.log.StdErrLog
14:37:44.054 INFO [Hub.start] - Selenium Grid hub is up and running
16:49:58.415 INFO [DefaultRemoteProxy.onEvent] - Marking the node
http://172.30.4.66:4628 as down: cannot reach the node for 2 tries
16:50:58.734 INFO [DefaultRemoteProxy.onEvent] - Unregistering the node
http://172.30.4.66:4628 because it's been down for 60320 milliseconds
16:50:58.734 WARN [DefaultGridRegistry.removeIfPresent] - Cleaning up stale test sessions on the unregistered node
http://172.30.4.66:4628
Node
16:54:02.976 INFO [GridLauncherV3.parse] - Selenium server version: 3.141.0, revision: 2ecb7d9a
16:54:03.049 INFO [GridLauncherV3.lambda$buildLaunchers$7] - Launching a Selenium Grid node on port 5437
2019-03-04 16:54:03.356:INFO::main: Logging initialized @608ms to org.seleniumhq.jetty9.util.log.StdErrLog
16:54:03.529 INFO [WebDriverServlet.<init>] - Initialising WebDriverServlet
16:54:03.575 INFO [SeleniumServer.boot] - Selenium Server is up and running on port 5437
16:54:03.575 INFO [GridLauncherV3.lambda$buildLaunchers$7] - Selenium Grid node is up and ready to register to the hub
16:54:03.685 INFO [SelfRegisteringRemote$1.run] - Starting auto registration thread. Will try to register every 5000 ms.
16:54:03.935 INFO [SelfRegisteringRemote.registerToHub] - The node is registered to the hub and ready to use
16:56:09.667 INFO [ActiveSessionFactory.apply] - Capabilities are: {
"browserName": "chrome",
"chrome.binary": "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe",
"goog:chromeOptions": {
"args": [
],
"extensions": [
]
},
"version": ""
}
16:56:09.667 INFO [ActiveSessionFactory.lambda$apply$11] - Matched factory org.openqa.selenium.grid.session.remote.ServicedSession$Factory (provider: org.openqa.selenium.chrome.ChromeDriverService)
16:56:14.740 INFO [ActiveSessionFactory.apply] - Capabilities are: {
"browserName": "chrome",
"chrome.binary": "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe",
"goog:chromeOptions": {
"args": [
],
"extensions": [
]
},
"version": ""
}
16:56:14.740 INFO [ActiveSessionFactory.lambda$apply$11] - Matched factory org.openqa.selenium.grid.session.remote.ServicedSession$Factory (provider: org.openqa.selenium.chrome.ChromeDriverService)
17:06:46.410 INFO [ActiveSessionFactory.apply] - Capabilities are: {
"browserName": "chrome"
}
17:06:46.411 INFO [ActiveSessionFactory.lambda$apply$11] - Matched factory org.openqa.selenium.grid.session.remote.ServicedSession$Factory (provider: org.openqa.selenium.chrome.ChromeDriverService)
17:07:09.729 INFO [ActiveSessionFactory.apply] - Capabilities are: {
"browserName": "internet explorer"
}
17:07:09.729 INFO [ActiveSessionFactory.lambda$apply$11] - Matched factory org.openqa.selenium.grid.session.remote.ServicedSession$Factory (provider: org.openqa.selenium.ie.InternetExplorerDriverService)
17:07:18.887 INFO [ActiveSessionFactory.apply] - Capabilities are: {
"browserName": "chrome"
}
17:07:18.888 INFO [ActiveSessionFactory.lambda$apply$11] - Matched factory org.openqa.selenium.grid.session.remote.ServicedSession$Factory (provider: org.openqa.selenium.chrome.ChromeDriverService)
2. Create a new testng, maven, selenium project with Sample test ng class as below:
public class GridTest {
@Test
public void test() throws MalformedURLException {
WebDriver driver;
System.setProperty("webdriver.chrome.driver", "C:\\Users\\<username>\\.m2\\repository\\webdriver\\chromedriver\\win32\\2.46\\chromedriver.exe");
DesiredCapabilities capabilities = DesiredCapabilities.chrome();
ChromeOptions options = new ChromeOptions();
capabilities.setCapability("chrome.binary", "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe");
capabilities.setCapability(ChromeOptions.CAPABILITY, options);
driver.quit();
}
}
3. Sample testng xml
<?xml version="1.0" encoding="UTF-8"?>
<suite name="sampleparallel" parallel="tests" thread-count="2">
<test name="testngTest1">
<classes>
<class name="io.github.bonigarcia.wdm.test.GridTest" />
</classes>
</test>
<test name="testngTest2">
<classes>
<class name="io.github.bonigarcia.wdm.test.GridTest" />
</classes>
</test>
</suite>
4. When i run above suite, I get below error :
[RemoteTestNG] detected TestNG version 6.14.3
java.lang.RuntimeException: java.io.IOException: Can not attach to current VM
at mockit.internal.startup.AgentLoader.attachToRunningVM(AgentLoader.java:152)
at mockit.internal.startup.AgentLoader.loadAgent(AgentLoader.java:60)
at mockit.internal.startup.Startup.initializeIfPossible(Startup.java:156)
at mockit.integration.testng.TestNGRunnerDecorator.onExecutionStart(TestNGRunnerDecorator.java:348)
at org.testng.TestNG.runExecutionListeners(TestNG.java:1061)
at org.testng.TestNG.run(TestNG.java:1012)
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:115)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)
Caused by: java.io.IOException: Can not attach to current VM
at jdk.attach/sun.tools.attach.HotSpotVirtualMachine.<init>(HotSpotVirtualMachine.java:75)
at jdk.attach/sun.tools.attach.VirtualMachineImpl.<init>(VirtualMachineImpl.java:48)
at jdk.attach/sun.tools.attach.AttachProviderImpl.attachVirtualMachine(AttachProviderImpl.java:69)
at jdk.attach/com.sun.tools.attach.VirtualMachine.attach(VirtualMachine.java:207)
at mockit.internal.startup.AgentLoader.attachToRunningVM(AgentLoader.java:146)
... 8 more
If any of you have encountered above and were able to resolve, please help!
Environment:
OS- Win 10
JDK- Openjdk 11.0.2
<selenium-java.version>3.141.59</selenium-java.version>
testng- 6.14.3
Thanks
Shailender