Saturday, October 7, 2017

Way too easy test automation example from AutomateIt! framework

If you have basic java programming skills, then you can automate tests for web and mobile applications using a test automation framework called AutomateIt!

The framework is easy to download and build. All you need is Ant and Java installed on your system, and you are ready to go. Nothing else is needed. All of the source code is open and free, and you can download it here:

https://github.com/SWAutoTester/automateit

To show how easy it is, I will show you an example.

The example is simple: It will open up a web browser and enter text into the Yahoo! homepage Search textfield.


1) After downloading the framework, open a terminal window command prompt and go to the directory that you downloaded the framework.

Now you can decide which browser you want to run the example on.There are examples for Chrome, Firefox, and Safari. You need to have the latest version of each browser installed to run the example.

If you want to test using a Firefox web browser:

2) and type "ant example_firefox"

or,

If you want to test using a Chrome web browser:

2) and type "ant example_chrome"

or,

If you want to test using a Safari web browser:

2) and type "ant example_safari"

You should see the browser appear and text entered into the search text field.

Now you can view the reports and see all of the great information the framework provides for you out of the box.

Open up a file browser and navigate to the "results/html/index.html" file and double-click on the icon. You should see this report appear:


From here you will see a very detailed report consisting of:


a) a sequence of framework/webdriver command list used to drive each test
b) screenshot from the web browser of the screen at the end of each test
c) screenshot from the desktop
d) Page loading performance times and graph

Here are the results that appear for the first two tests run:




Give it a try. If you have any problems, feel free to connect with me on LinkedIn and ask me a question or comment on this post. I will be happy to help you.













No comments:

Post a Comment