The opinion on “record and playback” is diverse, and there are some in the test automation community that don’t find recorded tests to be as beneficial as coded tests. However, if utilized while incorporating best practice to enhance the automated test cases, it can have great advantages. With TestProject, you can “mix and match” both recorded features and coded features and achieve your unique test automation goals.
This article will guide you step by step through the process of creating your first recorded test with TestProject’s Smart Test Recorder – an in-browser recorder that provides a powerful set of built-in capabilities to easily create automated tests for Web, Android and iOS apps, without any required coding skills.
Prerequisites
- Sign up here to TestProject. Don’t worry, it’s free!
- Login to TestProject and install the TestProject Agent (it incorporates all of the tools and drivers you need for your test automation, in one small desktop local component). Watch this short video to see how easily you can setup your Agent.
- That’s it! Now that you have your TestProject Agent all setup and ready to go – you can start creating recorded and coded tests for Web, Android and iOS apps.
Overview
- Step 1 – Create A New Test
- Step 2 – Record Your First Test
- Step 3 – Execute Your Test, Create A New Job & Analyze Reports
- Conclusion
Step 1 – Create A New Test
Click on one of these following buttons to create a new test:
Now, a wizard will pop-up. You will need to select your test type (Mobile/Web/Code), then click “Next” (For this example, let’s choose Mobile):
Give your test a name and description. For example, we will create a login test for TestProject’s Demo app. Then, click “Next”:
Now you need to select the platform you will be testing on (Android or iOS) and select the application you want to test. In this example, let’s test the Android TestProject Demo App (Note: it’s the same for iOS, the only difference is that you’ll need to first follow this setup tutorial for your iOS device). Click “Next”:
Here you have three options:
- Click on “Record” to open the smart test recorder and start recording your test.
- Click on “Edit” to manually edit test steps, without being in record mode.
- Click on “Blank Test” to simply add to your project an empty test you will get back to later.
Then, click “Start Testing”:
Let’s choose the “Record” option.
We will then be redirected to the smart test recorder where our chosen application will launch in the in-browser mobile screen mirroring (as seen in the image below). The mobile screen mirroring provides full control over your mobile device. All you need to do is connect your device to your machine via a USB cable, and you’re all good to go!
Step 2 – Record Your First Test
Let’s create our first test step!
Click “double shift” on your keyboard to easily use the element inspector, that enables you to inspect and evaluate any element in your app. You will be able to choose from various built-in actions or addons, set validations, view locator strategies and save elements. In this case, let’s choose the “type text” action and enter our name. Note: We can also simply tap the textbox with a left-mouse-click and start typing right away!
Once we’ve chosen the “type text” action, the step editor will open various options you can perform on each step. You can set step comments, define types, create parameters for data-driven executions, save elements, select failure behavior, take screenshots, set timeouts and much more.
In this example, let’s see how we can create parameters. Simply click on this plus button as seen below:
Now, click this plus button as seen below:
We will reach this screen as seen below, where we can set the parameter’s name and default value. Then, simply click on “Add” to add this parameter to your test. Note: Creating this as a parameter will enable us to execute this test as a data-driven test, by attaching to the test a CSV data source (from the project area, as described in step 3 below):
Now let’s move on to the next textbox field and create a password parameter the same way we did for the name parameter above. However, this time, let’s create a secret parameter, that allows storing sensitive information in an encrypted state.
The only thing you will need to do differently than from the name parameter we’ve created above – is to click the “Secret” toggle as seen in the image below, and click on “Add” to add this parameter to your test:
You can see that now both textbox values are filled out, and all that’s left to do is click “login”:
Once “logged in” we can see that we’ve reached a new screen with a “Hello” title and additional textbox fields. Let’s add another step to this test that will validate that we’ve indeed managed to login and reach the new screen. To do so, we can use a built-in validation from the element inspector that will check whether the title contains the word “Hello”:
Other cool features you can use within the smart test recorder are the element locator and element explorer. You can use them to easily view and analyze the structure of your mobile application screens. Inspect element hierarchy, choose from various locator strategies, and view all available properties of UI components.
That’s it! We’ve completed our first recorded test with TestProject, and we did not need any coding skills for that!
Step 3 – Execute Your Test, Create A New Job and Analyze Reports
Let’s exit the test recorder and head back to our project area, where we can see the test we’ve just now recorded. We can click the play button to execute it, we can edit it by clicking the pencil icon or delete it:
If you click on the three dots, a menu will appear with various options, such as: changing your input parameters, generating code from your recorded test, downloading a CSV template in order to create a data-driven test, and view your test executions reports:
You can also create a job by clicking the “Add a job” button. A job is basically an aggregation of your tests that you can manage with our built-in scheduler:
- You can select when you want to execute the job (one time, on-demand or recurrently).
- You can select on which agent the job should be executed on. You can even select remote agents anywhere around the world! (as long as they are connected to your account).
- You can select your testing target: If it’s a web job – you can select multiple browsers, and if it’s a mobile job – you can select multiple devices (as long as they are connected to the selected agent).
You can drag and drop to your jobs as many tests as you’d like, and once the job is executed – The tests will run one by one.
In addition, by clicking the Envelope icon, you also have the option to send job execution summary notifications to your email or directly into your Slack, or use any service that supports webhooks. By Clicking the stackable icon, you will be able to attach your CSV data source for data-driven tests:
Oh, and nothing is complete without reports, right!? After you finish executing your tests or jobs – you will automatically have reports ready for you to analyze and troubleshoot in the reports dashboard, where you will be able to:
- Measure your product’s quality and get valuable indicators of your product’s health, by measuring successful versus failed tests.
- Identify your product’s testing trends across various platforms, browsers and devices.
- Deep dive into each test step to view error messages, screenshots, execution durations and quickly identify failed steps.
Conclusion
In this article we’ve learned how to create our first recorded test with TestProject’s Smart Test Recorder. We saw how easily we can execute tests, create jobs and analyze reports. In this example, we’ve created a simple login flow with parameters and a validation step. However, you can, of course, create more complex scenarios by incorporating nested tests (of both recorded or coded tests), incorporate addons as test steps to enhance the smart test recorder’s capabilities, and even automatically generate Java code from all of your recorded tests.
What are you waiting for? There really are no limits as to how far you can go with your test automation using TestProject, and it’s free so go ahead and try it out 😎
Let us know in the comments below how was your experience creating your first recorded test with TestProject? We would love to hear from you!