The following are the issues which I'm facing
1. WebDriver.Quit() method throws below error when running test case using Selenium Grid. Whereas Driver.Close() works fine but I need to use Quit since my Test case will open multiple browser window.17:25:16.620 INFO - Command failed to close cleanly. Destroying forcefully (v2).
org.openqa.selenium.os.UnixProcess$SeleniumWatchDog@4e1ca690
17:25:16.624 WARN - Process refused to die after 10 seconds, and couldn't taskki
ll it
java.lang.NullPointerException: Unable to find executable for: taskkill
at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:
250)
at org.openqa.selenium.os.UnixProcess.<init>(UnixProcess.java:62)
at org.openqa.selenium.os.CommandLine.<init>(CommandLine.java:38)
at org.openqa.selenium.os.WindowsUtils.killPID(WindowsUtils.java:172)
at org.openqa.selenium.os.ProcessUtils.killWinProcess(ProcessUtils.java:
138)
at org.openqa.selenium.os.ProcessUtils.killProcess(ProcessUtils.java:81)
at org.openqa.selenium.os.UnixProcess$SeleniumWatchDog.destroyHarder(Uni
xProcess.java:248)
at org.openqa.selenium.os.UnixProcess$SeleniumWatchDog.access$2(UnixProc
ess.java:245)
at org.openqa.selenium.os.UnixProcess.destroy(UnixProcess.java:124)
at org.openqa.selenium.os.CommandLine.destroy(CommandLine.java:153)
at org.openqa.selenium.firefox.FirefoxBinary.quit(FirefoxBinary.java:259
)
at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.qu
it(NewProfileExtensionConnection.java:202)
at org.openqa.selenium.firefox.FirefoxDriver$LazyCommandExecutor.quit(Fi
refoxDriver.java:376)
at org.openqa.selenium.firefox.FirefoxDriver.stopClient(FirefoxDriver.ja
va:322)
at org.openqa.selenium.remote.RemoteWebDriver.quit(RemoteWebDriver.java:
477)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.openqa.selenium.support.events.EventFiringWebDriver$2.invoke(Even
tFiringWebDriver.java:102)
at com.sun.proxy.$Proxy1.quit(Unknown Source)
at org.openqa.selenium.support.events.EventFiringWebDriver.quit(EventFir
ingWebDriver.java:199)
at org.openqa.selenium.remote.server.handler.DeleteSession.call(DeleteSe
ssion.java:50)
at org.openqa.selenium.remote.server.handler.DeleteSession.call(DeleteSe
ssion.java:1)
at java.util.concurrent.FutureTask.run(Unknown Source)
at org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession
.java:176)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
17:25:17.993 WARN - Exception thrown
java.lang.RuntimeException: Process refused to die after 10 seconds, and couldn'
t taskkill it: Unable to find executable for: taskkill
at org.openqa.selenium.os.ProcessUtils.killWinProcess(ProcessUtils.java:
142)
at org.openqa.selenium.os.ProcessUtils.killProcess(ProcessUtils.java:81)
at org.openqa.selenium.os.UnixProcess$SeleniumWatchDog.destroyHarder(Uni
xProcess.java:248)
at org.openqa.selenium.os.UnixProcess$SeleniumWatchDog.access$2(UnixProc
ess.java:245)
at org.openqa.selenium.os.UnixProcess.destroy(UnixProcess.java:124)
at org.openqa.selenium.os.CommandLine.destroy(CommandLine.java:153)
at org.openqa.selenium.firefox.FirefoxBinary.quit(FirefoxBinary.java:259
)
at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.qu
it(NewProfileExtensionConnection.java:202)
at org.openqa.selenium.firefox.FirefoxDriver$LazyCommandExecutor.quit(Fi
refoxDriver.java:376)
at org.openqa.selenium.firefox.FirefoxDriver.stopClient(FirefoxDriver.ja
va:322)
at org.openqa.selenium.remote.RemoteWebDriver.quit(RemoteWebDriver.java:
477)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.openqa.selenium.support.events.EventFiringWebDriver$2.invoke(Even
tFiringWebDriver.java:102)
at com.sun.proxy.$Proxy1.quit(Unknown Source)
at org.openqa.selenium.support.events.EventFiringWebDriver.quit(EventFir
ingWebDriver.java:199)
at org.openqa.selenium.remote.server.handler.DeleteSession.call(DeleteSe
ssion.java:50)
at org.openqa.selenium.remote.server.handler.DeleteSession.call(DeleteSe
ssion.java:1)
at java.util.concurrent.FutureTask.run(Unknown Source)
at org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession
.java:176)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException: Unable to find executable for: taskki
ll
at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:
250)
at org.openqa.selenium.os.UnixProcess.<init>(UnixProcess.java:62)
at org.openqa.selenium.os.CommandLine.<init>(CommandLine.java:38)
at org.openqa.selenium.os.WindowsUtils.killPID(WindowsUtils.java:172)
at org.openqa.selenium.os.ProcessUtils.killWinProcess(ProcessUtils.java:
138)
... 24 more
2. I registered the node using the below command mentioned @ http://www.seleniumhq.org/docs/07_selenium_grid.jsp#starting-selenium-grid but it throws an error Test Name: ClickUserIDLink
Test FullName: DellCSWTests.AdminTests.ClickUserIDLink
Test Source: c:\Users\k_mohammedabdul\Documents\Visual Studio 2013\Projects\SeleniumPOC\SeleniumPOC\AdminTests.cs : line 109
Test Outcome: Failed
Test Duration: 0:00:00.5480204
Result Message: Initialization method DellCSWTests.AdminTests.TestInitialize threw exception. System.InvalidOperationException: System.InvalidOperationException: Error forwarding the new session Empty pool of VM for setup Capabilities [{browserName=firefox, version=39.0, platform=WINDOWS}].
Result StackTrace:
at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse) in c:\Projects\webdriver\dotnet\src\webdriver\Remote\RemoteWebDriver.cs:line 1126
at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters) in c:\Projects\webdriver\dotnet\src\webdriver\Remote\RemoteWebDriver.cs:line 920
at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities) in c:\Projects\webdriver\dotnet\src\webdriver\Remote\RemoteWebDriver.cs:line 888
at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities) in c:\Projects\webdriver\dotnet\src\webdriver\Remote\RemoteWebDriver.cs:line 89
at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(Uri remoteAddress, ICapabilities desiredCapabilities) in c:\Projects\webdriver\dotnet\src\webdriver\Remote\RemoteWebDriver.cs:line 108
at DellCSWTests.AdminTests.RunRemotely() in c:\Users\k_mohammedabdul\Documents\Visual Studio 2013\Projects\SeleniumPOC\SeleniumPOC\AdminTests.cs:line 29
at DellCSWTests.AdminTests.TestInitialize() in c:\Users\k_mohammedabdul\Documents\Visual Studio 2013\Projects\SeleniumPOC\SeleniumPOC\AdminTests.cs:line 39
java -jar selenium-server-standalone-2.46.0.jar -role hub
java -jar selenium-server-standalone-2.46.0.jar -role node -hub http://localhost:4444/grid/register -port 9999
But when I register the node using the below command which I got from google it works fineC:\Kaleem\selenium-dotnet-2.46.0\SeleniumGrid>java -jar selenium-server-standalo
ne-2.46.0.jar -role node -port 9999 -hub http://localhost:4444/grid/register -br
owser "browserName=firefox,version=39.0,platform=WINDOWS,maxInstances=5"
Below is my C# code.
public void RunRemotely()
{
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities = DesiredCapabilities.Firefox();
capabilities.SetCapability(CapabilityType.BrowserName, "firefox");
capabilities.SetCapability(CapabilityType.Platform, new Platform(PlatformType.Windows));
capabilities.SetCapability(CapabilityType.Version, "39.0");
_WebDriver = new RemoteWebDriver(new Uri("http://localhost:4444/wd/hub"), capabilities);
}3. I cannot see the 5 instance of FireFox running on my machine when I set MaxInstance=5 but the log on Node is present. Is this expected?
java -jar selenium-server-standalo
ne-2.46.0.jar -role node -port 9999 -hub http://localhost:4444/grid/register -br
owser "browserName=firefox,version=39.0,platform=WINDOWS,maxInstances=5"