In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
As a framework for companies to quickly implement UI automated testing, RobotFramework is also very suitable for beginners of automated testing to learn automation quickly. The author plans to describe its use as a whole through the process from building to completing automated testing.
Steps to build Robot Framework environment
Robot Framework is a framework developed based on the Python language. The steps are as follows:
For veterans familiar with Robot Framework or friends familiar with python, please see the following simple installation steps (detailed screenshot description is suitable for beginners)
Easy installation steps:
1. Install python3.7
two。 Type pip install robotframework in the dos command to install robotframework online
3. Type pip install Pypubsub==3.3.0 in the dos command to install Pypubsub online
4. Type pip install wxPython==4.0.3 in the dos command to install wxPython online
5. Type pip install robotframework-ride in the dos command to install robotframework-ride online
6. Enter pip list in the dos command to check whether the installation is successful
7. Enter ride.py in the dos command to check whether the RIDE main interface appears. If not, you can go to the python installation path\ scripts\ ride.py to manually double-click to start.
Detailed installation steps:
1. Install python3.7
two。 To install robotframework online, enter pip install robotframework in the dos command
3. To install Pypubsub online, enter pip install Pypubsub==3.3.0 in the dos command
4. Install wxPython online and enter pip install wxPython==4.0.3 in the dos command (screenshot, similar to the above screenshot)
5. To install robotframework-ride online, enter pip install robotframework-ride in the dos command. Installation dependencies are required during installation, which is slow (screenshot, similar to the above screenshot)
6. Enter pip list in the dos command to check whether the above software is installed successfully
7. Enter the ride.py command in the dos command to open the RIDE main interface
common problem
1. Dependency related problems
The Pypubsub version used in robotframework-ride 1.7.3.1 installation requires a compatible version of 3.3.0. If it is too new, a warning message will appear during the installation. However, after the experiment, the author found that the warning can also be used, but it is recommended that you use the required compatible version.
two。 An occasional error.
Since the author is a lecturer related to soft test training, students have made occasional errors in the following screenshots during the teaching process:
Error message under the dos command:
C:\ WINDOWS\ system32 > ride.py
1.Traceback (most recent call last):
File "d:\ python\ lib\ site-packages\ robotide\ application\ application.py", line 59, in OnInit
Self._plugin_loader.enable_plugins ()
File "d:\ python\ lib\ site-packages\ robotide\ application\ pluginloader.py", line 43, in enable_plugins
P.enable_on_startup ()
File "d:\ python\ lib\ site-packages\ robotide\ application\ pluginconnector.py", line 52, in enable_on_startup
Self.enable ()
File "d:\ python\ lib\ site-packages\ robotide\ application\ pluginconnector.py", line 57, in enable
Self._plugin.enable ()
File "d:\ python\ lib\ site-packages\ robotide\ contrib\ testrunner\ testrunnerplugin.py", line 162, in enable
Self._build_ui ()
File "d:\ python\ lib\ site-packages\ robotide\ contrib\ testrunner\ testrunnerplugin.py", line 558, in _ build_ui
Self._build_notebook_tab ()
File "d:\ python\ lib\ site-packages\ robotide\ contrib\ testrunner\ testrunnerplugin.py", line 734, in _ build_notebook_tab
Self.out = self._create_output_textctrl ()
File "d:\ python\ lib\ site-packages\ robotide\ contrib\ testrunner\ testrunnerplugin.py", line 769, in _ create_output_textctrl
Font = self._create_font ()
File "d:\ python\ lib\ site-packages\ robotide\ contrib\ testrunner\ testrunnerplugin.py", line 789, in _ create_font
Font=wx.SystemSettings.GetFont (wx.SYS_ANSI_VAR_FONT)
Wx._core.wxAssertionError: C++ assertion "wxFontEnumerator::IsValidFacename (font.GetFaceName ())" failed at.\ src\ msw\ settings.cpp () in wxSystemSettingsNative::GetFont ():
OnInit returned false, exiting...
Error in atexit._run_exitfuncs:
Wx._core.wxAssertionError: C++ assertion "GetEventHandler () = = this" failed at....\ src\ common\ wincmn.cpp () in wxWindowBase::~wxWindowBase (): any pushed event handlers must have been removed
Solution:
According to the above prompt, find the path to the testrunnerplugin.py file, as shown above
D:\ python\ lib\ site-packages\ robotide\ contrib\ testrunner\ testrunnerplugin.py
Open the py file with python code editing tools such as pycharm, and edit line 789:
Change font=wx.SystemSettings.GetFont (wx.SYS_ANSI_VAR_FONT) to font=wx.SystemSettings.GetFont (wx.ANSI_FIXED_FONT)
3. No permission to report an error
When the code is written using the Text Edit area, the following figure will report an error when saving the code:
Error message:
Error in serializing'C:\ robotframeworkcode\ newdream':
[Errno 13] Permission denied:'C:\ robotframeworkcode\ newdream.'
Solution:
The main cause of the problem is that the RIDE of Robot Framework does not have the relevant permissions.
After forcibly closing the RIDE interface of Robot Framework, find the path where the ride.py files are stored (python installation path\ Scripts\ ride.py)
Windows 7 operating system, right-click the ride.py file-select administrator to take ownership.
For the Windows10 operating system, right-click the ride.py file-- Select sharing-- specific users-- and select your own account share that logs in to Windows10.
4. Off-line installation
Offline installation will not automatically install dependent class libraries, you need to manually download the relevant dependent class libraries to install, the author does not recommend this installation method.
If you use an offline installation environment without a network, you need to download the corresponding class library installation file in advance and download the installation in the following order:
Robotframework-3.1.1 、 PyPubSub-3.3.0 、 six-1.12.0 、 Pygments-2.3.1 、 robotframeworklexer-1.1 、 robotframework-ride-1.7.3.1
Download website: https://pypi.org/
To install the python class library offline:
1) decompress the downloaded class library software
2) enter the unzipped directory in the dos command and enter python setup.py install to install
5. Robotframework-excellibrary library is not supported for the time being
The library is not supported for the time being, there is no solution, friends who have related solutions can give feedback.
Postscript
Until 2019, the version of robotframework-ride has been 1.5.2.1, which is the version of January 2016, in which wxPython2.8-win64-unicode-2.8.12.1-py27.exe,wxPython2.8 can only be installed on python2.7 environments. As a result, partners who want to use robotframework for testing at the same time and need python3 environment to write python code need to install two python environments on the operating system.
In 2019, robotframework-ride ushered in this update to solve this problem, from now on only need to install the python environment above python3.6. Reference robotframework official document: https://pypi.org/project/robotframework/#installation
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.