I am using Workspaces. A glimpse of my code is as:
@BeforeMethod:
driver= gridChrome();
WebDriver gridChrome() {
System.setProperty("webdriver.chrome.driver","/absolute/path/to/chrome/driver");
DesiredCapabilities chromeCapabilities = DesiredCapabilities.chrome();
chromeCapabilities.setPlatform(Platform.WINDOWS);
chromeCapabilities.setVersion("67.0");
return (new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), chromeCapabilities));
}
Workspace INFO:
OS: Windows Server 2008 R2
Local IP:172.xxx.xxx.xxx
Hub:
(selenium-server-jar-directory)>java -jar selenium-server-standalone-3.13.0.jar -role hub
(The IP shown is: 198.xxx.xxx.xxx)
Node: (selenium-server-jar-directory)>java -jar selenium-server-standalone-3.13.0.jar -role node -hub http://localhost:4444/grid/register
The hub and node are created effectively. The thing is, I am able to execute the same piece of code in my local system, but not in my workspaces. Also I find two different IP's. I tried creating hub and node with them too, but to no fruition.
The Exception thrown is: org.openqa.selenium.WebDriverException: Error forwarding the new session cannot find : Capabilities {browserName: chrome, platform: WINDOWS, version: 67.0}.
Another question: The function call DesiredCapabilities.setVersion(), for which parameter it sets version to, i.e Selenium Driver or Browser or Platform?
Any help would be appreciated. Thanks.