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

How to use robotframework to realize Interface Automation Test in python

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

Share

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

This article introduces how to use robotframework in python to achieve interface automation testing, the content is very detailed, interested friends can refer to, hope to be helpful to you.

one。 The jsxcompressor.min.js file is required in the C:\ Python27\ lib\ site-packages\ robot\ htmldata\ lib\ jsxcompressor.min.js directory to avoid executing test cases

Report this error:

[ERROR] Writing report file'c:\ users\ 190146\ appdata\ local\ temp\ RIDEcbrrku.d\ report.html' failed: No such file or directory: C:\ Python27\ lib\ site-packages\ robot\ htmldata\ lib\ jsxcompressor.min.js

II. Rebot reports on the way to Chinese:

1. Need to have a [rebot report Chinese .zip] installation package

2. 001. After decompressing rebot, put the view.js and report.html file under X:\ Python27\ Lib\ site-packages\ robot\ htmldata\ rebot

002. Three lines of code need to be added at the beginning of the following file:

1.C:\ Python27\ Lib\ site-packages\ robot\ htmldata\ htmlfilewriter

2.The logreportwriters,outputwriter,resultwriter under the file C:\ Python27\ Lib\ site-packages\ robot\ reporting

The added code is:

Import sys

Reload (sys)

Sys.setdefaultencoding ('utf-8')

3. Considerations when adding code:

001.C:\ Python27\ Lib\ site-packages\ robot\ reporting file logreportwriters.py file and C:\ Python27\ Lib\ site-packages\ robot\ htmldata\ htmlfilewriter.py file, to the following figure:

The import information in the red box must be placed on the first line, otherwise an error will be reported and the log will not be printed when the test case is executed

three。 Click: Library in testSuit and enter the value of name in the pop-up box as: Logistics

Logistics has been customized in the directory: C:\ Python27\ Lib\ site-packages, as shown in the screenshot:

There are .py files to be run in the Logistics directory, as shown in the screenshot:

1. The custom directory name is consistent with the class class name in the _ _ init__.py file

two。 When there are multiple .py files in the custom directory, pay attention to the editing of _ _ init__.py, as shown below:

3. The "class SensitiveWords (Add,Check,delete,Filter,getCount,searchWord):" in the _ _ init__.py file indicates that the class inherits the class entered by import, and the class name in parentheses is the class name entered by import.

On how to use robotframework in python to achieve interface automation testing is shared here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

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