Just entered the testing industry, the first is to do functional testing, I think many partners and I, feel that automated testing is very high-end, very mysterious. Eager to learn to do automated testing.
Used to compare commonly used database +python do automation, the later found that Excel personally feel more suitable, just began to do automatic test, very eager to build the whole frame immediately, but impatient to eat hot tofu,
or from the basics, here is a python combination of Excel data to implement a single interface to automate testing steps, understand this, you can use the entire framework, encapsulated into a common module, bulk read data, execute data.
Now with our company's login interface as a column, the input parameters are "Doc_info", "user_pwd", "source" three items, only if "Doc_info =" 15899860330 ",", "user_pwd" = 123456a, Time, To return the correct JSON format, the returned code is "000000" returned:
If the parameters are incorrect, different code will be returned, and the reason
Here, the beginning of the idea, for this interface, we like functional testing, write down what columns, and then design a table, fill in the Excel table,
Next we're going to check to see if the returned code value is equal to the value we expect (that is, the contents of cell expected_code), such as consistent, which means that the column is passed. How it is implemented, see the code below
If the end is pass, then the use case executes successfully
Automated testing of an interface and Excel data is done, and in practice we sometimes want to write the results of the final printout of our judgment into a field in an Excel table, such as Final_reslut, so that we can open the Excel table more clearly, Equivalent to a test report.
Python can reference the XLWT3 module, you can write data to Excel, but found that this feeling is more troublesome, could not reference xlwt3, directly in the original list written? The answer is yes. I will continue to update for this later.
More information or software downloads can follow my blog or join the following groups, qq:511213522
We exchange software tests together and progress together.
Python interface automation test with Excel data easily (i)