1. Download the image
Note: selenium/node-firefox and selenium/node-chrome are both headless. To see the real-time running interface, you need to use one of the following two images.
2. Start the Docker of the Hub node docker run -p 4444:4444 -d --name hub selenium/hub Parameter Description:
3. Start the Docker of Node
Or a Node with a Debug interface docker run -d -p 5900:5900 --link hub:hub selenium/node-chrome-debug Parameter Description: --link is a link to the container with the alias hub. 4. Install and configure VNC VNC (Virtual Network Console) is the abbreviation of virtual network console. It is an excellent remote control tool software, a free open source software based on UNIX and Linux operating systems, with powerful remote control capabilities, efficient and practical. Download address: https://www.realvnc.com/en/connect/download/viewer/ 5. Test code To use the Selenium Grid service, you need to use the webdriver.Remote method to connect to the service and pass in the desired_capbilities desired capabilities. The sample script is as follows. from time import sleep from selenium import webdriver driver = webdriver.Remote( command_executor = 'http://192.168.99.100:4444/wd/hub', desired_capabilities={'browserName': 'chrome'} ) driver.get('https://www.baidu.com') print("start run") sleep(1) print(driver.title) driver.quit() print("end...") The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: A brief discussion on Vue3 father-son value transfer
>>: 4 solutions to mysql import csv errors
1. In addition to the default port 8080, we try t...
Table of contents 1. Use plugin expressions 2. Us...
The most important logs in the MySQL log system a...
This article shares the MySQL precompilation func...
watch : listen for data changes (change events of...
1. Find a suitable version of redis for docker Yo...
Preface NFS (Network File System) means network f...
1. Problem There is a table as shown below, we ne...
Table of contents Preface 1. Preparation - Server...
Preface I encountered a situation at work: In the...
Table of contents 1. Preparation 1. Prepare the e...
Table of contents 1. Write an HTML, the first Vue...
Overview binlog2sql is an open source MySQL Binlo...
In the pages of WEB applications, tables are ofte...
First we need to install some dependencies npm i ...