selenium + python + firefox test environment set up and configuration

        UI Automation for doing, if it is pure write a automated test procedures, then the follow-up maintenance costs will be higher. In this case, this means selenium automation system testing tools, assisted in writing the script himself, would be a good choice. selenium itself supports multiple languages, because the test object is written in python, so I decided to adopt a combination of selenium + python. selenium supports multiple browsers, start with firefox, together to discuss building a test environment under windows system.

        1. Install python

            Official website: after www.python.org, download and install, and then set the path environment variable, and finally execute the command >> python in cmd, returns the version information, the installation was successful

                  

        2. Install selenium

            Use pip install selenium (if not pip, then install pip), cmd in the Run >> pip install selenium

            After installation is complete, execute the command >> pip show selenium, returns the version and other information, the installation was successful.

            

        3. Install firefox

            When download the latest version, then log in directly to the official website firefox https://www.firefox.com.cn, you can download. The first time I downloaded the latest version of the 69, found a lot of problems as well as the rest of the plug-compatibility issues, for ease of use, and finally uninstalled the latest version, version 56 is installed and the browser options, the "update" a set to "check for updates, but you decide whether to install" or "do not check for updates", so as not to automatically upgrade to the latest version, and met or plug-compatibility and other issues affecting use. Version history Download: firxhttp: //ftp.mozilla.org/pub/firefox/releases/

         Here, we will complete the installation of the test environment, but this does not start right away our automated testing, firefox short of a drive geckodriver.

         geckodriver Download: https://github.com/mozilla/geckodriver/releases

         windows 64-bit systems based on where I choose to download is geckodriver-v0.20.0-win64 (initially downloaded the version 25, due to compatibility issues with firxfox browser version 56, replace version 20).

         Note: During the installation process, refer to the https://www.cnblogs.com/sandysun/p/7838113.html and other articles, thank you again.

Guess you like

Origin www.cnblogs.com/jjstrip/p/11670747.html