Qxf2 automation framework supports API testing. We used Mechanize library to make REST calls for our testing framework. As we migrated from Python 2 to Python 3 and since Mechanize is not supported on Python 3 we had to come up with an alternative module compatible with Python 2 & Python 3. We decided to use Requests library. In this […]
Implementing Python Requests library in our automation testing framework
Migrating our automation framework from Python 2 to Python 3
Qxf2’s Selenium, Appium and API test automation framework using the Page Object pattern was built with Python 2. We started receiving a lot of requests for Python 3 support. With Python 2 set to retire by the end of 2020, we migrated our existing Qxf2 automation framework code from Python 2 to Python 3. In this post, we will have a […]
Easily Maintainable API Test Automation Framework
For a long time, Qxf2’s API tests were not really object-oriented. We were relying on (at best) a facade pattern or (at worst) the God class anti-pattern. Our colleague, David Schwartz of Secure Code Warrior, helped us make our API automation framework more object-oriented and easier to maintain. Thanks, Dex, for all the guidance, examples, code, code reviews and for […]
Testing the Fitbit heart rate monitoring system: Part 2
In this post, we outline a cheap and creative way to perform repeatable and controlled tests on the Fitbit heart rate monitor. Our test has a reasonable degree of accuracy. We hope it helps the Fitbit developers rapidly test their prototypes. To be clear: thorough, accurate and precise testing is needed in the later stages of development. The test outlined […]
WebSocket Error – Connection is already closed.
While trying to send a WebSocket transaction, I hit the following error Connection is already closed. I received this error when working on an application that involved a WebSocket connection. The Websocket handshake between the client and server was successful. After that I was able to send data to server using ws.send(“request_data_1”). I had no trouble receiving the data using […]
WebSocket testing
A WebSocket is a standard protocol for two-way data transfer between a client and server. It is supported by all modern browsers. Why this post? My know-how of WebSocket connections was very limited. When I had to test an application which involved a WebSocket connection, I couldn’t find much information on how to go about testing it. It took me […]
Urllib’s urlencode: The weird case of %22 and %27
When I was doing some API testing using Python Mechanize, I struck an internal server error. I tried to find the root cause of the error and I realized that Python’s urllib is doing something weird when encoding strings. It is replacing double quotes with single quotes. I spent more than hour to debug this issue before I realized what […]
An analogy to understand web APIs
I noticed many testers with no knowledge of web APIs do not have an easy way to start learning about them. Most tutorials directly dive into the technical details of how to use APIs as part of writing automated checks. I wanted to provide an easy analogy for APIs that will set you up to explore this topic further. DISCLAIMER: […]
Run your API tests in parallel: MapReduce/Python
At a recent client engagement, I used MapReduce to run some API level checks in parallel. It was surprisingly simple and needed me to change less than a dozen lines of code in my tests. Generally MapReduce makes people think they need a farm of servers. But in this case I did it using only my local machine. I was […]
API Testing with Python Mechanize
This is the third part in our series on API testing. Rather than focus on traditional approaches to API testing, we have decided to arm you with tools that let you interact with the API at different levels of abstractions. In part I we showed you how to inspect the API calls of any web application. In part II, we […]