Nowadays Mobile Testing is so important to ensure Quality, but one of the most common problems is the speed of an automated test. There’s no point in automating a set of test cases if the execution time of a single Automated Test is more than one or more Manual Tests.
This problem is really common when automating Android Test Cases using Appium and UIAutomator or UIAutomator2, one solution is to use “Espresso Driver” but requires:
- App has to be an Android Native.
- It’s important to have the source code of the App.
But most of the time, Companies doesn’t always provide the source code (Commonly if the App was made by a third-party) or the App’s development is with a No-Native Android App using external frameworks as React-Native.
In these scenarios, there’s also another big problem, not all developers use unique and fast locators while developing an App, whether for Android or IOS like the usage of IDs. Most of the time we have to deal with XPaths, that is not only not recommended, due to the change of the DOM’s structure but also are extremely slow when are processed by Appium’s most common drivers like UIAutomator and UIAutomator2.
Here is where TestProject comes to help, even though I don’t recommend using the UI Interface of TestProject for big Projects because of the lack of maintainability and scalability. Using the UI of TestProject has a lot of dependency on the tool itself because it’s more focused on the “No Coding” Framework. Later on, if there’s a feature or functionality that TestProject doesn’t provide, we’re going to start coding, which it’s going to be more difficult to adapt the code generated by TestProject and adapt it to our necessities.
Anyhow, TestProject comes with an SDK for Java and Python, which easily (there’s almost none of the documentation) to integrate with our code to avoid using Appium and UIAutomator.
- We need to register in TestProject Web Page at https://testproject.io/ and Download the TestProject Agent.
2. To be able to run the Agent, we need to get our “Developer Token”, to get it, go to “https://app.testproject.io/#/integrations/sdk”, save this token for later.
3. In a Maven Project, let’s add these new dependencies, “io.testproject”, “org.slf4j” and “org.seleniumhq.selenium”. It’s also important to use the last version of Appium, there’re some libraries problems if the last version of Appium is not used.
4. In the class we create our old driver, in this case, it’s “Setup”, let’s remove Appium import and replace it with “io.testproject.sdk.drivers.android.AndroidDriver.
**Modify the Driver.
5. It’s important to add an environment variable called “TP_DEV_TOKEN” with the obtained token in Step 2, under Environment Variables > New System Variable.
6. Let run the TestProject Agent, by clicking on TestAgent.exe.
7. Now let’s run our test and see the performance improvement!. (Don’t forget to change the type of the new Driver in all classes.
For further information on how to use TestProject consult: “https://testproject.io“.
Links of interest:
Automating with Appium – Selenium and TestNG
The Agile Team Approach
What Scrum Master Certification to Choose?
These are some recommended books to learn more:
Any help is welcome to help us keeping this effort alive! PayPal Account BTC (Bech32): bc1qx6f8nczr5ram6d57svlnsfmk5mhu6lsr9q7mxw BTC: 1DDcWbphm1bKMvWruotNKLSM8ypVaHg5Nv ETH: 0x58D137fb142D946bCD815f0ded0fa3b3fE5AB3BF
Angélica Viridiana Rebolloza
Computing Engineer specialized in Automation, working with different tools for Mobile and Web, using languages, tools, and platforms like JAVA, VBScript, JavaScript, C#, Appium, Protractor, UFT (QTP), Selenium, WinAppDriver, Jenkins among others.
Viridiana also has been working using practices like TDD & BDD under Cascade and Agile approaches.
Some certifications include: ISTQB Foundations Certification, SeU Selenium Certified, ITIL Foundations Certification.