Selenium-python environment to build individual learning use

Source: Internet
Author: User

1. Download Firefox browser https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/24.0/win32/zh-CN/

2. Download Selenium Http://selenium-release.storage.googleapis.com/2.45/selenium-server-standalone-2.45.0.jar

3. Installing the IDE Plugin website: http://docs.seleniumhq.org/download/

Firefox will pop-up window, prompt user how to operate, after successful installation, the upper right corner of the browser

4, the IDE to set up, in order to be able to export the recorded content as a script

5. After recording, the export script is SELENIUM-RC python

6. Start Selenium-server-standalone-2.45.0.jar, switch to the directory where the server is located, execute the CMD window to execute Java-jar Selenium-server-standalone-2.45.0.jar

'll see

7. Execute the recording script, open a new CMD window, execute the Python script name

'll see

You'll also see a popup of two pages

Problems encountered:

When the script is executed at the beginning of the recording, execution fails with the hint that the path to Firefox cannot be found

1, first try to solve the method: Add the path of firedox in the environment variable, and specify the path of Firefox in the script.

Execute script that prompts the browser not to arouse

2, check the browser found to be bandits fox, uninstall it, and remove the installation files, install the browser provided by this article, re-execute the script, or prompt cannot arouse the browser

3. Modify Selenium-server-standalone-2.45.0.jar (Open with compressed file) selenium-server-standalone-2.45.0.jar\ CUSTOMPROFILEDIRCUSTFF\EXTENSIONS\{538F0036-F358-4F84-A764-89FB437166B4}INSTALL.RDF file

Change Firefox version from 15.0 to 35.0 Save

4. Restart Selenium-server-standalone-2.45.0.jar, execute script, execute successfully

The following reasons are analyzed:

1, 80% reason is selenium official packaging error, no update max_version (so changed the version number)

2, 15% reason is that you installed the Bandits Fox of the kingdom

3, 5% because you caught up with 2.44 out of a bug

Https://code.google.com/p/selenium/source/diff?spec=svn8a2eeb65916fe23d589a92058fd51ac0317cd242&name= 8a2eeb65916f&r=8a2eeb65916fe23d589a92058fd51ac0317cd242&format=side&path=/java/client/src/org/ Openqa/selenium/browserlaunchers/locators/firefoxlocator.java

Selenium-python Environment to build personal learning use

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.