当前位置:网站首页>Selenium distributed testing

Selenium distributed testing

2022-06-10 10:23:00 Wang Dashan 0928

selenium Distributed testing

Selenium Grid

Selenium Grid yes Selenium One of the three components of , Its function is to execute tests in a distributed way .

UI The advantages and value of automation are mainly reflected in : Repeat the test and multi browser compatibility test ; What is the concept of distribution ? Simply put, the boss received the task , Give it to your hands to work ;Selenium Grid It can control multiple machines and multiple browsers to execute test cases , The distributed execution environment is Selenium Grid called node node .

Selenium Grid principle

Selenium Grid Actually it is based on Selenium RC Of , The so-called distributed structure is composed of a hub Nodes and a number of node The composition of agent nodes . Hub It is used to manage the registration information and status information of each agent node , And accept the request call from the remote client code , Then forward the requested command to the agent node to execute .

Selenium Grid What's the usage? ?

  1. In different browsers 、 Run tests on the operating system and the machine - Distributed testing
  2. For compatibility testing to the greatest extent
  3. Improve the efficiency of automated execution , Reduce running time

Selenium Grid The deployment environment

start-up Selenium Grid In three ways :

  1. Start... From the command line --bat start-up
  2. use JSON Profile startup
  3. use docker start-up

start-up Selenium Grid The preparatory work

Will use 2 Taiwan machine , One runs hub The other one is running node, For ease of description , Will run hub Our machine is named “Machine H”(IP:192.168.1.114), function node Our machine is named “Machine N”(IP:192.168.1.87);2 The machines must be in the same LAN .

Environmental requirements

  1. selenium Grid rely on java Environmental Science , So whether it's hub And is node machine , There must be JDK Environment
  2. download selenium server,selenium server Namely selenium Grid The core , It is also the key to start , take selenium-server- standalone-X.XX.jar We separate “Machine H” and “Machine N” On ( Custom path )

Command line start -Selenium Grid

In the machine “Machine H” Open the command line on the , Switch to selenium server Path , function :java -jar selenium-server- standalone-3.141.59.jar -role hub -port 5566.

verification Hub Startup successful :

In the machine “Machine H” Enter... In the browser on the :http://localhost:5566/grid/console , You will see the following figure :
 Insert picture description here
In the machine “Machine N” Check out Hub, The address in the browser localhost To be changed to “Machine H” Of IP Address
 Insert picture description here

原网站

版权声明
本文为[Wang Dashan 0928]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/161/202206100953196780.html