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

Construction of mac robotframework testing framework

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

Share

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

It took × × genius to install it before and after repeated loading and unloading. This article was written after a successful installation. It may be omitted. If so, please point it out. Thank you.

System version: macOS 10.12.2; Python 2.7.10 included with mac

1. Install pip

Sudo easy_install pip in the terminal. After running, you can use pip help to test whether the installation is successful. At that time, pip (9.0.1) was installed.

CX-MacBook-Pro:~ CX$ sudo easy_install pipCX-MacBook-Pro:~ CX$ pip help (ps: you need to enter a password when using sudo, which is the password of your own computer)

two。 Install robotframework

Sudo pip install robotframework in the terminal. After running, you can use pybot-- version to test whether the installation is successful.

There will be a robot folder under / Library/Python/2.7/site-packages/

CX-MacBook-Pro:~ CX$ sudo pip install robotframework

CX-MacBook-Pro:~ CX$ pybot-- versionRobot Framework 3.0.2 (Python 2.7.10 on darwin) (without sudo, you will have the permission to report an error)

3. Install robotframework-ride

Sudo pip install robotframework-ride in the terminal. You can check it with pip list after running it.

CX-MacBook-Pro:~ CX$ sudo pip install robotframework-ride

CX-MacBook-Pro:~ CX$ pip list4. Install wxPython

Http://sourceforge.net/projects/wxpython/files/wxPython/2.8.12.1/

Download wxPython2.8-osx-unicode-2.8.12.1-universal-py2.7.dmg, directly double-click .pkg error: installation failed

Because the software to be installed could not be found

The correct installation method:

4.1 after download, double-click to extract, .pkg click to install the package, right-click to select: display the contents of the package

Open Contents/Resources/ and double-click to extract the file wxPython2.8-osx-unicode-universal-py2.7.pax.gz

4.3 copy the lib file of the usr/local in the extracted file to the system usr/local (use finder to go to the folder and merge the lib file)

4.4 copy the postflight under Contents/Resources to the desktop, cd to the directory where postflight is located, and run the command

CX-MacBook-Pro:~ CX$ cd / Users/CX/DesktopCX-MacBook-Pro:Desktop CX$ sudo. / postflight

4.5 when you run ride.py, you will be prompted that the python driver is 32-bit: python should be executed in 32-bit mode with wxPython on OSX.

So it needs to be enforced as 32-bit

CX-MacBook-Pro:Desktop CX$ defaults write com.apple.versioner.python Prefer-32-Bit-bool yes

(ps: do not install wxPython with brew/pip, because the installed version is 3.0.2.0/4.0.0b2, and running ride.py will report that the version does not support-- wrong wxPython version.)

5. Install robotframework-selenium2library

Sudo pip install robotframework-selenium2library in the terminal

CX-MacBook-Pro:~ CX$ sudo pip install robotframework-selenium2library

Terminal pip list

Pip (9.0.1)

Robotframework (3.0.2)

Robotframework-ride (1.5.2.1)

Robotframework-selenium2library (1.8.0)

WxPython (2.8.12.1)

After installing the environment rfs, the terminal inputs to start the ride.py. Create a test project-> create a test suite-> create a test case and import Selenium2Library.

On the Edit tab of the Test Suite, click the "Library" button, pop up the input box, and enter Name: Selenium2Library. ), click OK to finish If the imported library is displayed in red, the imported library does not exist, and black indicates that the import was successful.

Firefox for browser (version 56.064-bit) runs the first case with an error: WebDriverException: Message: 'geckodriver' executable needs to be in PATH.

6. Put geckodriver to / usr/local/bin/

Https://github.com/mozilla/geckodriver/releases

Download the version of geckodriver-v0.19.0-macos.tar.gz, decompress it and store the geckodriver in the / usr/local/bin/ path.

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