Thursday, 14 January 2016

Selenium Grid documentation

Steps:
1. Installation of Grid 2.0
Here we are using 2 machines. The first machine will be the system that will run the hub, while the other machine will run a node. Machine where the hub runs is "Machine A" while the machine where the node runs will be "Machine B".
2. Download the selenium-server-standalone-2.41.0.jar and Save it on C:/ location of Machine A and Machine B.

3. Using the command prompt, navigate to the root of Machine A's - C drive , because that is the directory where we placed the Selenium Server. On the command prompt of Machine A, type  java -jar selenium-server-standalone-2.41.0.jar -role hub

4. The hub should successfully be launched. Your command prompt should look similar to the image below:

 
5. Another way to verify whether the hub is running is by using a browser. Selenium Grid, by default,  uses Machine A's port 4444 for its web interface. Simply open up a browser and go to http://localhost:4444/grid/console
6. Also, you can check if Machine B can access the hub's web interface by launching a browser there and going to http://iporhostnameofmachineA:4444/grid/console where "iporhostnameofmachineA" should be the IP address or the hostname of the machine where the hub is running.

7. Now,we are going to launch a node. Go to Machine B and launch a command prompt there.Navigate to the root of Drive C and type the code below
java -jar selenium-server-standalone-2.41.0.jar -role rc -hub http:// iporhostnameofmachineA:4444/grid/register -port 5556 (RC)
 
8. , you can check if Machine B can access the hub's web interface by launching a browser there and going to http://iporhostnameofmachineA:4444/grid/console where "iporhostnameofmachineA" should be the IP address or the hostname of the machine where the hub is running.
 
8. Now Place our Legacy Framework on Machine A.
9. Remove or comment “WScript.Sleep 20000” from first 6 commands  of “Shopping_Run_LIVE.vbs” file .
10. Run the “Shopping_Run_LIVE.vbs”. And Observe that multiple instances of selenium are running on Machine B.

Swamy:

java -jar selenium-server-standalone-2.29.0.jar -role
 java -jar selenium-server-standalone-2.41.0.jar -role node -hub http://192.168.30.111:4444/grid/register -port 5558 -browser browserName=firefox,maxInstances=1 -maxSession 2
++++++++++++++++
java -jar selenium-server-standalone-2.32.0.jar -role hub 

java -Dwebdriver.ie.driver=D:/Kepler_workspace/GmailGridTest/iedriver/IEDriverServer.exe -Dwebdriver.chrome.driver=D:/Kepler_workspace/GmailGridTest/chromedriver/chromedriver.exe -jar selenium-server-standalone-2.32.0.jar -role node -hub http://localhost:4444/grid/register -port 5558 -browser browserName=firefox,maxInstances=1 -browser browserName=chrome,maxInstances=1 -browser browserName=iexplore,maxInstances=1 –maxSession 2

java -jar selenium-server-standalone-2.35.0.jar -role hub 

java -Dwebdriver.ie.driver=D:/Kepler_workspace/GmailGridTest/iedriver/IEDriverServer.exe -Dwebdriver.chrome.driver=D:/Kepler_workspace/GmailGridTest/chromedriver/chromedriver.exe -jar selenium-server-standalone-2.35.0.jar -role node -hub http://localhost:4444/grid/register -port 5558 -browser browserName=firefox,maxInstances=1 -browser browserName=chrome,maxInstances=1 -browser browserName=iexplore,maxInstances=1 –maxSession 2
+++
java -jar selenium-server-standalone-2.29.0.jar -role node -hub http://localhost:4444/grid/register -port 5558 -browser browserName=firefox,maxInstances=1 -maxSession 2, -browser browserName=chrome,maxInstances=2 -maxSession 2,- Dwebdriver.chrome.driver= D:/Pravanjan/ppr_lib_jars/IEDriver /chromedriver.exe
net----------
java -jar selenium-server-standalone-2.41.0.jar -role node -hub http://192.168.30.111:4444/grid/register -port 5558 -browser browserName=firefox,maxInstances=5,platform=WINDOWS -browser browserName=chrome,maxInstances=5,platform=WINDOWS - D:/Pravanjan/ppr_lib_jars/IEDriver /chromedriver.exe
+++

Java java -Dwebdriver.chrome.driver=/path/to/chromedriver  -jar selenium-server-standalone-2.7.0.jar

Ff and chrome:
java –Dwebdriver.chrome.driver=D:/Pravanjan/ppr_lib_jars/IEDriver /chromedriver.exe  -jar selenium-server-standalone-2.41.0.jar -role node -hub http://192.168.30.111:4444/grid/register -port  5558 -browser browserName=firefox,maxInstances=1 -browser browserName=chrome,maxInstances=1, platform=WINDOWS
only chrome:
java -jar selenium-server-standalone-2.41.0.jar -role node -hub http://192.168.30.111:4444/grid/register -port  5558 –browser  browserName=chrome ,maxInstances=1 -maxSession 2, platform=WINDOWS -Dwebdriver.chrome.driver=C:/grid/chrome/chromedriver.exe

Only IE
java -jar selenium-server-standalone-2.41.0.jar -role node -hub http://192.168.30.111:4444/grid/register -port  5557 –browser  browserName=iexplore,maxInstances=1 -maxSession 2, platform=WINDOWS -Dwebdriver.ie.driver=C:/grid/chrome/IEDriverServer.exe

All Browsers:
java -jar selenium-server-standalone-2.29.0.jar -role node -hub http://localhost:4444/grid/register -port 5558 -browser browserName=firefox,maxInstances=1 -maxSession 2
++++++++++
java -Dwebdriver.ie.driver= C:/grid/chrome/IEDriverServer.exe -Dwebdriver.chrome.driver= C:/grid/chrome/chromedriver.exe  -jar selenium-server-standalone-2.41.0.jar -role node -hub http://192.168.30.111:4444/grid/register -port  5557 -browser browserName=firefox,maxInstances=1 -browser browserName=chrome,maxInstances=1 -browser browserName=iexplore,maxInstances=1 
++++++++++
Ff=chrome
java -Dwebdriver.chrome.driver= C:/grid/chrome/chromedriver.exe  -jar selenium-server-standalone-2.41.0.jar -role node -hub http://192.168.30.111:4444/grid/register -port  5557 -browser browserName=firefox,maxInstances=1 -browser browserName=chrome,maxInstances=1 
ff=chrome=IE==runnable
java -Dwebdriver.ie.driver=C:/grid/chrome/IEDriverServer.exe -Dwebdriver.chrome.driver=C:/grid/chrome/chromedriver.exe -jar selenium-server-standalone-2.41.0.jar -role node -hub http://localhost:4444/grid/register -port 5557 -browser browserName=firefox,maxInstances=1 -browser browserName=chrome,maxInstances=1 -browser browserName=iexplore,maxInstances=1
dummy for all browsers:
java -Dwebdriver.ie.driver=C:/grid/chrome/IEDriverServer.exe -Dwebdriver.chrome.driver=C:/grid/chrome/chromedriver.exe -jar selenium-server-standalone-2.41.0.jar -role node -hub http://localhost:4444/grid/register -port 5557 -browser browserName=firefox,maxInstances=5 -browser browserName=chrome,maxInstances=5 -browser browserName=iexplorer,maxInstances=5

cd\’cd

No comments:

Post a Comment