Monday 17 May 2021

React Native Automation Feasibility using Detox and Cavy | One Pager

React Native Automation Feasibility using Detox and Cavy: 


Mobile App Testing Interview Question: Mobile Application Testing Interview |Ministry of Testing Meetup |Testing Android & iOS Apps | Testing Native & Testing React Native




  

Detox – The most difficult part of automated testing on mobile is the tip of the testing pyramid - E2E. The core problem with E2E tests is flakiness - tests are usually not deterministic. We believe the only way to tackle flakiness head on is by moving from black box testing to gray box testing. 

  

Cavy – Similarly cavy is also specifically developed for React Native mobile automation, but the automation tool is not that mature and it depends on refs to perform tests. 

  

Tool 

Detox         

Cavy 

Company 

By Wix 

By Pixielabs 

Maturity Status 

More Stable and Mature 

Bit Buggy 

What can be automated

Can be used to automate react Native, Native and Hybrid apps 

Can be used to automated React Native App.For native apps we need to native JS hooks (Appium). 

Grey,white or black box? 

Gray Box not Black Box 

White box 

Fast 

Uses Async Function i.e.no need to wait for the action to be performed till the element in not available. 

Doesn’t uses async funtion 

Under the hood 

Uses Earlgrey and Expresso in the hood, therefore we can rely on ID, label and other matchers. 

Depends on refs  

  

 

Both the Detox and Cavy are open source but the detox community is highly active and they are adding new functionality every now and then.

 

Detox rather acts as an aggregator (or even a platform) for two Whitebox frameworks that are Earlgrey and (soonEspresso. It provides higher level APIs in JavaScript that interact with the two libraries to make tests on both platforms by only writing them once.

 

 

Automation Detox supports:

 

Detox APIs are based on three:


1.   Matchers like

             await element(by.id('img')).tap();

2.   Actions

   await element(by.text('For rent')).tap();

 

3.   Expectations

    await expect(element(by.text('For rent'))).toBeVisible();

 

POC link for Detox:https://github.com/saifsms91/DetoxAutomationPoc

Wednesday 5 May 2021

How To Write BUG REPORT In Software Testing | Manual Testing | Real website demo


Writing a good and actionable bug report is one of the most important skills for the tester.

 

How it helps developers exactly:

·      tells about issues that they ain’t aware of

·      helps determine new features that they may not have thought of

·      helps get a feel as to how their customers use the software, so they can make it better.





So what should an ideal bug report look like? While there might be small variations depending on the type of application, it narrows down to a few important attributes:

 

·      BugCaseId

·      Priority

·      Description/Bug Summary

·      Pre-requisites

·      Bug Steps

·      Expected Result

·      Actual Result

·      Status

·      BugTest Executed By

·      Browser/Device


In this video I have touched all the important aspect of writing a good and concise bug report.




Tuesday 9 March 2021

How to kill Appium server if device is not connected | How to find connected Android device

Subscribe to my youtube channel for more videos here:

Problem:

If the Android device was not connected during Appium Automation, it was starting the Appium server but was not able to quit it.
So, once running the script again after connecting the device , we will get error

Could not start Appium server. It's showing [Error Starting appium server: listen EADDRINUSE 0.0.0.0:4723]

Below is the script which I created to handle the situation and check if the device is already connected.
If it is not connected just Quit the Appium Server.

Solution:

if (loadPropertyFileAndroid.startsWith("Android_")) {

try {
Process process = Runtime.getRuntime().exec("adb devices");
BufferedReader in = new BufferedReader(new InputStreamReader(process.getInputStream()));
String line = null;

Pattern pattern = Pattern.compile("^([a-zA-Z0-9\\-]+)(\\s+)(device)");
Matcher matcher;

while ((line = in.readLine()) != null) {
if (line.matches(pattern.pattern())) {
matcher = pattern.matcher(line);
if (matcher.find()) {
System.out.println("android device connected");

AppiumServer.start();
CommonUtils.loadAndriodConfProp(loadPropertyFileAndroid);
log.info(loadPropertyFileAndroid + " properties file loaded !!!");
CommonUtils.setAndroidCapabilities();
driver = CommonUtils.getAndroidDriver();
String connectedDeviceName = driver.getSessionDetail("deviceName").toString();
System.out.print("Saif "+connectedDeviceName);

log.info("Appium server started");
}else{
AppiumServer.stop();

log.info("Appium server not started");
}

}
}
} catch (IOException e) {
e.printStackTrace();
}
Read about automation coding standards here: Avoid Mobile Automation Coding Pitfalls : Automation coding standards

Interview Experience with AMAZON for the role of Quality Assurance Tester

This role was for Digital/ IoT/Mobile Application based testing :)  Amazon is a dream company and everyone wants to work for that company a...

Popular Posts