Connect your local browser using Selenium Grid
Last updated
Last updated
Using QAautoMATER, you can connect to your local browser to run test scripts.We need to setup selenium grid on local system.
There are some prerequisites for running test scripts on local browser.
Prerequisite:
JDK
JDK should be installed on the system. You can check if they are installed correctly by using the following commands: java -version
.
if it is not installed then installed from given below link
Selenium Server Grid
Download selenium server from the selenium site
Browser driver exe
Chrome
We need to install a browser driver. For Chrome, we need to install chromedriver.exe; for Firefox, we need to install geckodriver.
Please note your local browser version and for same version install correct chromedriver file.
Firefox
We can download geckdriver as per system firefox version from given below link
Microsoft Edge
Edge driver exe can be downloaded from given below link
Tunnel Setup
There are multiple publicly available tunnels. Here are the options:
1. Serveo,
2. ngrok,
3. localtunnel.
You can use any of these tunnels. For Serveo, no installation is required as it works over SSH. For the other tunnels, installation is required.
In case you're using ngrok, the command to use is:
In case you're using localtuunel, the command to use is:
Please note : Performance wise ngrok is better.
Step 1
Create any folder without any space in your system and paste your downloaded Selenium server with browser driver exe file for all browser (Note Down your path address)
Step 2
Create a toml file with name browser-config ,extension should be .toml
Step 3
Open browser-config toml file and paste the given below content content
For Each webdriver-executable section , update your chromedriver.exe, geckodriver.exe and msedgedriver.exe path , Make sure Path should be same as step 1 also use two backward slashes for putting the path. save this file.
Step 4
Create batch file with name launchSeleniumGrid with extenson .bat and paste given below content
Please make sure Servername should be same as your downloaded server name
Step 5
After saving launchSeleniumGrid.bat file , double click on bat file and see console log to make sure selenium grid is up and running , we can see log in console
You can also check Grid status using given below URL
Step 6 ( Tunnel Setup) --- Select your tunnel depending on your network and security constraints
Tunnel Setup for Serveo
Open new command prompt and run the given below command
after running the command , you will get the public URL , copy this URL
Tunnel Setup for localTunnel
Open new command prompt and run the given below command
localtunnel will expose the port 4444 and provide URL which can be access anywhere , copy this URL and open in new tab
for tunnel password , open given below URL
Copy this password and click to submit button
Tunnel Setup for ngrok
Create an account on ngrok
on dasboard page , you will get the command for authtoken , copy the code and run the command in command line
run the following command
you will get the forwarding url , paste in UI configuration page and run your test scripts
Step 7
Go to the Configuration page, click on Add Local Grid button from Cloud Server setup section
Provide your local grid name and click Save button , after saving the details , grid name will be displayed in Execution Server listbox section, Update hub Url (Provided bu localltunnel) from step 6 and Save
Step 8
Now your local grid will be available on Test script page, execution lab page , after selecting your grid test execution will happend on your local browser