i am new for Automation testing on Mobile.So i do not know how to retrieve the Pass/Fail Report For Appium While Running Android Mobile Application Test Scripts.
Use TestNG to Generate Execute Scripts and TestNG Report to Generate Reports.
-Ajit
Thanks AjitJ For Replayed my Question.
- i Got it Ajit Thanks . But what my intention is how to get From Appium (is Appium Will give any Result Report) .
- Ajit How to get Log Report From Appium
Hi, I am using appium with android studio. Is there any way to generate test report?
Hi Suresh_k,
you can use the following command to store your log report from appium:
public static void startAppium() throws ExecuteException, IOException, InterruptedException
{
String appiumPath=“give the path of your appium folder”
CommandLine command = new CommandLine("cmd");
command.addArgument("/c");
command.addArgument(appiumPath+"//Appium//node.exe");
command.addArgument(appiumPath+"//Appium//node_modules//appium//bin//appium.js");
command.addArgument("--address");
command.addArgument("127.0.0.1");
command.addArgument("--port");
command.addArgument("4723");
command.addArgument("--no-reset");
command.addArgument("--command-timeout");
command.addArgument("120");
//command.addArgument("--log"); if you want to store the appium log use this and next one
//command.addArgument("C://Users//...//log//appiumLogs.txt");
DefaultExecuteResultHandler resultHandler = new DefaultExecuteResultHandler();
DefaultExecutor executor = new DefaultExecutor();
executor.setExitValue(1);
executor.execute(command, resultHandler);
Thread.sleep(5000);
//return true;
}
If you want to see fail and pass results then you need to use testng framework, now assume you want to run some test case like login, so you need to add @Test (testng tag ) on top of your method.So when you run the test using testng you will get results and you will find that in index.html. This is the best way to get your execution results.
Appium is not a tool , so it wont provide any reports directly.
Hi,
There is a report library created by Anshoo Arora which can be used to generate good HTML reports:
http://relevantcodes.com/extentreports-for-selenium/
Worth a try! Currently I have integrated this for Appium tests.
Regards,
Sujata
You can use Junit or TestNg Frameworks in order to get report of passed/and failed tests
TestNg is good Framework to use
Hi Friends,
Yes TestNG is very good Framework to use.
@bhaskar123 Can you please provide example for TestNG with appium ?
@Jimit24365
Go through this below URL, with the help of the code which was provided, I have made changes in my script and tried it.
I hope you can try this, It will work…
Hello Friends,
There is one more Awesome Option to Customize your Selenium Test Reports.
Try This:
Thanks,
Ajit.
@AjitJ I started using the TestNG framework for my tests. I also wanted to know how I can see the test case pass/fail report. I see it generated in a folder where my Project exists. However how can I see the same report in my Eclipse IDE…under the Project? Please advise thanks.
@sujata_kalluri I have integreated extent report but report html file not generated into log folder can you please help me out for the same, and system not showing any compliation error f
Use below line of code for device log
Set logtypes = driver.manage().logs().getAvailableLogTypes();
System.out.println(“suported log types: " + logtypes.toString());
LogEntries logEntries = driver.manage().logs().get(“logcat”);
System.out.println(”======== Device LOGS ========");
for (LogEntry entry : logEntries) {
System.out.println(new Date(entry.getTimestamp()) + " " + entry.getMessage());
}
System.out.println("================");