On previous post we learn how to configure Selenium grid and Node.Now we will try to learn how we can access Selenium Grid from our code.
Actually we do not need to change lots of things we just need to change the driver initialize part it should be looks like that
DesiredCapabilities cap =new DesiredCapabilities();
cap.setBrowserName("firefox");
WebDriver driver = new RemoteWebDriver(new URL("http://Machine IP or localhost:PortNumber in which port hub is running/wd/hub"), cap);
this is the main thing for the Selenium Grid script code rest of the part is same as the normal script.
If firefox is installed in other than default location then we need to specify the location of the firefox binary when we configure the node,node setup command should be looks like that
java -jar "path of selenium-server-standalone-2.41.0.jar" -role node -hub "http://Machine IP or localhost:PortNumber in which port hub is running/grid/register" -browser "firefox_binary=firefox binary path, browserName=firefox"
If we need to run the script on IE then it is little bit tricky,we need to register the IE diver to the node, the command looks like that
java -jar "path of selenium-server-standalone-2.41.0.jar" -role node -hub "http://Machine IP or localhost:PortNumber in which port hub is running/grid/register" -Dwebdriver.ie.driver="path of 32 bit 64 bit IEDriverServer.exe"
and need to set this into the code
cap.setBrowserName("internet explorer");
Actually we do not need to change lots of things we just need to change the driver initialize part it should be looks like that
DesiredCapabilities cap =new DesiredCapabilities();
cap.setBrowserName("firefox");
WebDriver driver = new RemoteWebDriver(new URL("http://Machine IP or localhost:PortNumber in which port hub is running/wd/hub"), cap);
this is the main thing for the Selenium Grid script code rest of the part is same as the normal script.
If firefox is installed in other than default location then we need to specify the location of the firefox binary when we configure the node,node setup command should be looks like that
java -jar "path of selenium-server-standalone-2.41.0.jar" -role node -hub "http://Machine IP or localhost:PortNumber in which port hub is running/grid/register" -browser "firefox_binary=firefox binary path, browserName=firefox"
If we need to run the script on IE then it is little bit tricky,we need to register the IE diver to the node, the command looks like that
java -jar "path of selenium-server-standalone-2.41.0.jar" -role node -hub "http://Machine IP or localhost:PortNumber in which port hub is running/grid/register" -Dwebdriver.ie.driver="path of 32 bit 64 bit IEDriverServer.exe"
and need to set this into the code
cap.setBrowserName("internet explorer");
yurtdışı kargo
ReplyDeleteresimli magnet
instagram takipçi satın al
yurtdışı kargo
sms onay
dijital kartvizit
dijital kartvizit
https://nobetci-eczane.org/
UZ8
Hollanda yurtdışı kargo
ReplyDeleteİrlanda yurtdışı kargo
İspanya yurtdışı kargo
İtalya yurtdışı kargo
Letonya yurtdışı kargo
WDEZFJ
Portekiz yurtdışı kargo
ReplyDeleteRomanya yurtdışı kargo
Slovakya yurtdışı kargo
Slovenya yurtdışı kargo
İngiltere yurtdışı kargo
6U1540
Azerbaycan yurtdışı kargo
ReplyDeleteAruba yurtdışı kargo
Avustralya yurtdışı kargo
Azor Adaları yurtdışı kargo
Bahamalar yurtdışı kargo
OX7KK