WebUI Automated Testing Framework---"Pyswat" introduction

Source: Internet
Author: User
Tags manual writing python script

WebUI Automated Test Framework ---"Pyswat" Introduction

Hello, I am. Lamecho spicy ugly, today to introduce you a Web Automated Test Framework Pyswat . "Pyswat" is a framework for automating Web page testing (python-selenium-web-auto-test abbreviation). Based on Python, using hook technology and the selenium package, to complete the recording case (operation steps) do not need handwriting script, very convenient to have wood! : lol

Give me a chestnut, do a website login operation in Python you're going to write a bunch of scripts like this.


And after recording through Pyswat, you get a case of an Excel table, like this


After the case, the execution of the program replay case, Super simple. The framework also implements much more than that. The configuration file allows you to set the number of playback times for a case, and the use of intelligent algorithms to find elements during playback does not require you to write scripts in a bitter force.
The case can also be enhanced to specify random randomly generated input content on the input, such as random: Test +int (3), at which time the input randomly generates the text "Test 549" ("test" + random three-digit number) in parentheses. Of course, you can also write random: Test +int+str (5) will take on randomly generated letters.
In addition to randomly generating input, as well as specifying sequence: test, the number of times the replay with case is generated in sequence will generate textual content for input, such as "Test 0001", the second generation of "Test 0002" and so on. Also, if you specify a parameter name for the generated content, the subsequent case can get the contents of the parameter back and forth.
Also, encapsulated the drag element drag-and-drop method, there is no sense of selenium drag Drag_and_drop Super Waste, Pyswat Framework package Drag to achieve the ultra-strong semi-physical drag, you just pass the dragged two elements to achieve the physical drag of these two elements.
On the page check, the check () method is encapsulated, and the incoming check can reflect the search results in the replay log, like this to modify the case


The results are recorded in the log:
2017-05-03 13:16:42:----STEP7 Start
2017-05-03 13:16:45:------Find Results total: 0 Records
2017-05-03 13:16:45:------Find Results page no this element.
2017-05-03 13:16:46: End of----STEP7

What else, in the page element positioning if the found element is a collection what to do, in the past in the Python script you have to write loops to make a match. In the Pyswat framework, you simply specify that the "at: Fill in matches" program automatically recognizes the match.
Give me a chestnut, on a snowball web page like this.

You have to click on a "Focus" button, and you find a collection through Find_elements_by_class (' Followstock '), you have to write a lot of judgments in the script.

And by Pyswat you only need to write this, add at in the Red frame position: The text content is OK.


If this is not strong enough, then you can write a Python script directly in the case, like this

It's strong enough to change it!

In addition to the implementation of screen scrolling, attachment upload all have the method of encapsulation implementation. Like meeting Select,frame and so on is a piece of cake, pyswat all done.

After the final execution, a histogram is automatically generated, like this:

The result was a glance of wood.
I am currently writing Pyswat manual, interested in the package, follow my Sina Weibo "lamecho spicy ugly" or "fire-bug", complete the manual writing I will be the first time to notify and release the beta version.

WebUI Automated Testing Framework---"Pyswat" introduction

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.