Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Configure docker to realize python+selenium Automation

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

Installation environment: win10

1) pre-installation check (using securable.exe or LeoMoon CPU-V.exe):

Does the system hardware support virtualization technology?

Is it enabled in BIOS?

2) install the virtual machine CentOS7:

Download vmware workstation pro: https://www.vmware.com/cn/products/workstation-pro/workstation-pro-evaluation.html

Install vmware workstation pro

Using vmware workstation pro to install virtual machine CentOS7

Mount the host shared directory: https://blog.csdn.net/jasonhector/article/details/78679135

3) install docker:

Install in the virtual machine: https://blog.51cto.com/taoismli/2171045

Configure the image repository in the virtual machine: https://blog.51cto.com/taoismli/2171108

Download the docker centos image in the virtual machine: docker pull centos

List the host local images: # docker image ls

Run the mirror instantiation container and mount the host directory as a data volume: docker run-it-- mount type=bind,source=/opt/sharefolder,target=/opt/sharefolder imageID bash / / the container will share the host's / opt/sharefolder directory to facilitate data sharing

IV) docker configuration (operate in docker container)

Install python: https://blog.csdn.net/elija940818/article/details/79238813

Install selenium:pip3 install selenium

Install firefox: download the firefox linux installation package to a shared directory, then copy it to the docker root directory and extract it

Firefox webdriver download: https://github.com/mozilla/geckodriver/releases, and put the downloaded driver into python's interactive startup directory / usr/bin/

To install HTMLTestRunner.html, please download the version that supports python 3.x

Download address: https://download.csdn.net/download/a136332462/9873996

Place the downloaded html in the $Python\ site-packages/ directory

Python3

Import sys

Sys.path

Quit ()

Cp HTMLTestRunner.py

Virtual Desktop installation: https://blog.51cto.com/taoismli/2173856

Install third-party libraries:

Bs4

Schedule

Xlrd

Xlwt

Xlutils

Chardet

Pymssql (

Https://docs.microsoft.com/en-us/sql/connect/python/pymssql/step-1-configure-development-environment-for-pymssql-python-development?view=sql-server-2017)

PyMySQL

5) Container and image operation:

Https://blog.51cto.com/taoismli/2171108

Docker container commit

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report