I am new to Selenium grid. My hub and the node is running. I tried a test to automate in the node. But I am getting the error "Could not initialize class org.openqa.selenium.os.Kernel32". I could not find the solution anywhere. Please help
My code is :
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
import org.openqa.selenium.Platform;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
import java.net.URL;
import java.net.MalformedURLException;
public class TestGrid {
WebDriver driver;
String baseURL, nodeURL;
@BeforeTest
public void setup() throws MalformedURLException{
baseURL = "http://newtours.demoaut.com/";
nodeURL = "http://192.168.0.6:5566/wd/hub";
DesiredCapabilities capability = DesiredCapabilities.firefox();
capability.setBrowserName("firefox");
capability.setPlatform(Platform.WIN8);
driver = new RemoteWebDriver(new URL(nodeURL), capability);
}
@Test
public void verifyTitle() {
String actualTitle = driver.getTitle();
String expectedTitle = "Welcome: Mercury Tours";
Assert.assertEquals(actualTitle, expectedTitle);
}
@AfterTest
public void closeSetup(){
driver.quit();
}
}