How to report bugs in Appium UI Testing?
On This Page Extent Reporting in Appium UI testing
How to report glitch in Appium UI Testing?
Appium, like, depends on test coverage tools, like TestNG and JUnit, that yield built-in reports. However, instrument like Extent Report are preferred as they provide more detailed reporting for testing.
Overview
Purpose of reporting in Appium UI testing
- Document exam results like mistake logs and pass/fail position
- Track test execution history and results
- Generate insightful visual reports
- Find areas of improvement
Tools for Reporting in Appium UI Testing
- App Automate
- Test Management
- JIRA
- Extent Report
- Nunit
This guide teaches you how to report bugs effectively in Appium UI essay using tools like App Automate, Test Management, Extent Report, and more.
Extent Reporting in Appium UI prove
Though you can generate in-built study by, NUnit, and for Appium, the Extent report is more useful as it focuses on delivering test reports that are more elaborate.
Learn More:
Advantages of Extent Report
- Step-by-step test execution information with pie charts and screenshots representation.
- Show the time occupy for every trial case execution.
- It can track multiple test example within a single cortege.
- Provide responsive UI.
Extent reports are written in HTML. Mainly the announcements contain two classes- ExtentReports stratum and ExtentTest class.
Read More:
ExtentReports class:It generates HTML report. This report will be created within your own folder means the path is user-specified. It can overwrite an existing HTML report. The default value becomes TRUE when a report is overwritten.
Syntax:
ExtentReports reports = new ExtentReports (`` Path of the directory to store the resultant HTML file '', true/false);
ExtentTest class:This stratum log tests the antecedently return HTML story.
Syntax:
ExtentTest test = reports.startTest (`` TestName '');
Both these class have some built-in methods. They are:
- startTest: Executes presumption of a tryout cause.
- endTest: Executes postconditions of a test case.
- Log: It ’ s a method. It logs each trial step & # 8217; s status onto the generated HTML report. It produces four value types- passing, fail, skip, and information, which we are elaborating on below.
- Flush: Creates an out-and-out new copy of the report and efface old datum from the targeted study.
These values designate the test status in the extent report-
- PASS
- FAIL
- SKIP
- INFO
Syntax
reports.endTest (); test.log (LogStatus.PASS, '' Test Passed ''); test.log (LogStatus.FAIL, '' Test Failed ''); test.log (LogStatus.SKIP, '' Test Skipped ''); test.log (LogStatus.INFO, '' Test Info '');
Generate extent report with NUnit
1. First you need to make an issuetrackerUTIL.java class. Thus we need to import the below packages. Then you will get an auto-generated Java document.
package & lt; packagename & gt;; import io.restassured.RestAssured; import io.restassured.builder.RequestSpecBuilder; importation io.restassured.http.ContentType; importee io.restassured.response.Response; import io.restassured.specification.RequestSpecification; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.testng.IInvokedMethod; import org.testng.ITestResult; import org.testng.SkipException; importee org.testng.annotations.Test; import java.util.ArrayList; significance java.util.HashMap; import static io.restassured.RestAssured. *; import static io.restassured.path.json.JsonPath.from; meaning org.apache.commons.lang3.StringUtils;
2. Create a listener to check the issue status.
packet & lt; packagenamehere & gt; import org.testng.IInvokedMethod; import org.testng.IInvokedMethodListener; import org.testng.ITestResult; import org.testng.SkipException; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; public class MethodIssueStatusListener implements IInvokedMethodListener {@ Override populace void afterInvocation (IInvokedMethod invokedMethod, ITestResult event) {Issue subject = invokedMethod.getTestMethod () .getConstructorOrMethod () .getMethod () .getAnnotation (Issue.class); if (null! = issue) {IssueTrackerUtil.IssueStatus currentJiraStatus = IssueTrackerUtil.getStatus (issue.value ()); if (IssueTrackerUtil.IssueStatus.OPEN==currentJiraStatus || IssueTrackerUtil.IssueStatus.IN_PROGRESS==currentJiraStatus || IssueTrackerUtil.IssueStatus.BLOCKED==currentJiraStatus || IssueTrackerUtil.IssueStatus.REOPENED==currentJiraStatus) {switch (result.getStatus ()) {lawsuit ITestResult.FAILURE: // no need to fail as we might get look this already. result.setStatus (ITestResult.SKIP); if (issue.value ()! = null) {result.setAttribute (`` issue '', issue.value ());} break; case ITestResult.SUCCESS:}}}} @ Override populace void beforeInvocation (IInvokedMethod invokedMethod, ITestResult result) {// nil to do}}3. Create a @ Issue interface to do the examination with Jira
import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @ Retention (RetentionPolicy.RUNTIME) @ Target (ElementType.METHOD) public @ interface Issue {String value () default `` '';}4. After that, use the Listener
@ Listeners ({MethodIssueStatusListener.class})Read More:
Screenshot capture in the Extent report
Since Appium supports mobile app testing, the camera is an obvious feature to be tested. Almost every mobile covering uses a camera, including taking painting, screenshots, and former images oriented job.
Pro tip: Tools like SUSA can handle this autonomously — upload your app and get results without writing a single test script.
Built-in reports in Selenium Appium don ’ t support images, screenshots, pie charts, graph implementation, etc. Instead, the extent report does these things. Hence, screenshot capture becomes a significant piece of extent reporting.
Here is a part of codification for conduct screenshots.
Also, some basic methods used in this codification are described-
test.log (LogStatus.FAIL, test.addScreenCapture (capture (driver)) + `` Test Failed ''); public electrostatic String capture (WebDriver driver) throws IOException {File scrFile = ((TakesScreenshot) driver) .getScreenshotAs (OutputType.FILE); File Dest = new File (`` src/ .. /BStackImages/ '' + System.currentTimeMillis () + `` .png ''); String errflpath = Dest.getAbsolutePath (); FileUtils.copyFile (scrFile, Dest); return errflpath;}Read More:
Methods:
addScreenCapture ()
This method is a member of the Extent Test family. It helps to get and add screenshots to the extent report. Thus, the log method uses this method to get a screenshot.
test.log (LogStatus.FAIL, test.addScreenCapture (capture (driver)) + `` Test Failed '');
getScreenShotAs ()
This method captures screenshots of WebDriver instances. You must have to use this method when you ’ re taking screenshots of web drivers. It storage the screenshot in different output forms.
Here, the output type is a FILE.
File scrFile = ((TakesScreenshot) driver) .getScreenshotAs (OutputType.FILE);
Then the output file will be store in the ’ BStackImages & # 8217; brochure in the ‘ src ’ folder. The below statement make the pamphlet path-
File Dest = new File (`` src/ .. /BStackImages/ '' + System.currentTimeMillis () + `` .png '');
getAbsolutePath ()
Use this method to range all erroneousness images in the destination folder.
Here is the accomplished statement for this-
String errflpath = Dest.getAbsolutePath (); FileUtils.copyFile (scrFile, Dest); return errflpath;
Now you have your extent study. Finally, you can get this report plan from the splashboard
- Total number of and associated trial measure become visible.
- You can see the first clip, end time, and performance clip of a examination case. You can check it by clicking on a test example name.
- It provides the number of exam cases passed, fail, and jump.
- Display the percentage of the total number of test instance passed.
- The number of stairs in each test case (both the surpass and failed test cases).
Appium Bug report with JIRA
Respective automation tool support JIRA integration to report a bug similar to a.
Here is a sample extent report by JIRA integration with the test Automation framework.
The framework contains the below components-
- Appium
- Selenium
- Java 8 + TestNG
- Rest Assured
Updating the bug reports in JIRA becomes easy when your bug is already fixed.
Sample report by JIRA
compile radical: 'com.aventstack ', gens: 'extentreports ', version: ' 4.1.3' use below extent-config.xml file: & lt;? xml version= '' 1.0 '' encoding= '' UTF-8 ''? & gt; & lt; extentreports & gt; & lt; configuration & gt; & lt;! -- report subject -- & gt; & lt;! -- standard, dark -- & gt; & lt; subject & gt; standard & lt; /theme & gt; & lt;! -- document encoding -- & gt; & lt;! -- defaults to UTF-8 -- & gt; & lt; encode & gt; UTF-8 & lt; /encoding & gt; & lt;! -- protocol for handwriting and stylesheets -- & gt; & lt;! -- defaults to https -- & gt; & lt; protocol & gt; https & lt; /protocol & gt; & lt;! -- title of the papers -- & gt; & lt; documentTitle & gt; ExtentReports 2.0 & lt; /documentTitle & gt; & lt;! -- study name - expose at top-nav -- & gt; & lt; reportName & gt; & lt; /reportName & gt; & lt;! -- report headline - displayed at top-nav, after reportHeadline -- & gt; & lt; reportHeadline & gt; Automation Report & lt; /reportHeadline & gt; & lt;! -- global appointment formatting override -- & gt; & lt;! -- defaults to yyyy-MM-dd -- & gt; & lt; dateFormat & gt; yyyy-MM-dd & lt; /dateFormat & gt; & lt;! -- global time format override -- & gt; & lt;! -- defaults to HH: mm: ss -- & gt; & lt; timeFormat & gt; HH: mm: ss & lt; /timeFormat & gt; & lt; enableCategoryView & gt; true & lt; /enableCategoryView & gt; & lt; enableAuthorView & gt; true & lt; /enableAuthorView & gt; & lt; enableExceptionView & gt; true & lt; /enableExceptionView & gt; & lt; enableTestRunnerLogsView & gt; true & lt; /enableTestRunnerLogsView & gt; & lt;! -- custom javascript -- & gt; & lt; scripts & gt; & lt;! [CDATA [$ (papers) .ready (office () {});]] & gt; & lt; /scripts & gt; & lt;! -- custom styles -- & gt; & lt; styles & gt; & lt;! [CDATA []] & gt; & lt; /styles & gt; & lt; /configuration & gt; & lt; /extentreports & gt;Read More:
BrowserStack App Automate for Bug reporting in Appium
You can opt for to report a bug for Appium testing. App Automate supports four types of integration: JIRA, Trello, GitHub, and Slack.
Here is how the deeds with App Automate-
Integration with Jira
- First, go to Report Bug & gt; Integrate with Jira & gt; Connect to my Jira Account to start the integration process.
- For this intent, you must provide your Jira report certification, like hostname, email address, and Atlassian watchword.
Bug account with Jira
- Now, the JIRA integration with BrowserStack is discharge. When you find a bug in your, click on the ‘ Report Bug ’ button in the toolbox. This clip you are filing a bug in Jira with this push.
- Then add annotation with the ‘ Annotation Toolbar ’ to the screenshot.
- After that, fill in all the point about the bug. Specify the project name, type of issue, and summary. Also, you add some description about the matter if you wish so.
- You can fill in extra fields with the ‘ More Fields ’ button. This is optional.
- Finally, click the ‘ Create Issue ’ button to report the issue.
Apart from this, too you can use the by App Automate for Appium testing. Creating a account is simple with this plug-in.
Steps are:
- Go to Post-build Actions & gt; Add post-build action.
- Next choice BrowserStack Test Report.
- Finally, click on Save.
Now, you can see the result of the Appium test
BrowserStack Test Management for Bug Reporting in Appium
You can utilize BrowserStack & # 8217; s Test Management tool to report bug in Appium. To do this, you need to create a JUnit-XML test report. Appium ply this report by nonpayment, which can be constitute in thetest-output folder.
Once you run the tests, you can upload this report into BrowserStack & # 8217; s Test Management tool utilize thewhorl dictation. This action lets you import the test results onto the platform and find reports with detailed insights on the test execution.
To view the test report on Test Management, you can postdate the measure below:
- Log in to the dashboard.
- Select the relevant undertaking that has the test story upload.
- Click Test Runs.
- Open the Test Run generated from automation tryout execution.
- You will chance all the test cases and their respective results here.
Note: For elaborated instructions and code sample on how to report bugs in Appium, you can refer to this.
Conclusion
Additionally, it is quite straightforward to use Appium with BrowserStack and access a wide range of debugging puppet, include text logs, network logs, visual logs, crash logs, and contextual log information.
BrowserStack App Automate enables you to test aboriginal and hybrid mobile applications utilize the Appium mechanization framework on K of real Android and iOS devices.
Get on board with the BrowserStack infrastructure to run and debug Appium tests on a existent device cloud.
Utile Resources for Appium
Tutorials
Best Practices, Tips, and Tricks
Getting Started with
# Ask-and-Contributeabout this topic with our Discord community.
Related Guides
Automate This With SUSA
Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts needed.
Try SUSA FreeTest Your App Autonomously
Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts.
Try SUSA Free