Create my own report

Hello,
Is it possible to modify the report make by appium studio?
I would add some informations on it (like the value of few informations on my app)

Thanks

Hi

You can use

driver.executeScript("client:client.report("Custom value", <true or false>)")

https://docs.experitest.com/display/SA/Report

Ok thanks! But I am not sure I really understand how it works…
We can’t modify the source code in Appium Studio, So I have to use Eclipse? And at the end Eclipse give me an XML file which I can use in Appium Studio or something else?

Thanks for your time, I’m a begginer and I have some problems to launch my project…

Appium Studio provides a UI that allows you to develop your tests
eventually, you’ll need to export the scripts that you generate and maintain them in a code project (this will allow you to scale and create a robust automation project)

@Tom,

Tried below code, but getting “com.experitest.client.InternalException”
By the way what values should args parameter contains in executeScript?

public class customResultReport
{
public AppiumDriver driver;
public String strDeviceName=“09478d300f4133f6”;
public String strAppURL=“http://newtours.demoaut.com/”;
public String host = “localhost”;
public int port = 4723;

public String reportDirectory="D:\\Programming\\Appium\\Results";
public String reportFormat = "html";

@BeforeTest
public void setUp()
{
	DesiredCapabilities dc = new DesiredCapabilities();
	dc.setCapability(SeeTestCapabilityType.REPORT_DIRECTORY, reportDirectory);
    dc.setCapability(SeeTestCapabilityType.REPORT_FORMAT, reportFormat);
    dc.setCapability(SeeTestCapabilityType.TEST_NAME, "Appium Studio Custom Report");
   	dc.setBrowserName(MobileBrowserType.CHROME);
	
    try 
    {
  	driver = new SeeTestAndroidDriver<>(new URL("http://"+host+":"+port), dc);
  	
  } catch (MalformedURLException e) 
    {
  	e.printStackTrace();
  }
    
    driver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);
}

@Test
public void launchBrowserTest() throws Exception
{
	driver.get(strAppURL);
	driver.executeScript("client:client.report(\"This is a custom message inserted into the test report.\", false)", "");
	Thread.sleep(15000);
	System.out.println(driver.getTitle());
}

@AfterTest
public void tearDown()
{
	driver.quit();
}

}

Below is the console output:

[TestNG] Running:
C:\Users\E002841\AppData\Local\Temp\testng-eclipse-1080245597\testng-customsuite.xml

[Fri Jul 07 21:16:11 IST 2017] [driver] Starting test: ‘Appium Studio Custom Report’
[Fri Jul 07 21:16:11 IST 2017] [driver] {dontGoHomeOnQuit=false, noReset=false, dontStopAppOnReset=false, instrumentApp=false, reservationDuration=240, reportFormat=html, fullReset=false, waitForDeviceTimeout=120000, useRemoteGrid=false, reportDirectory=D:\Programming\Appium\Results, browserName=Chrome, [enableclientlog, enableclientlogger]=false, autoWebview=false, platformName=Android, testName=Appium Studio Custom Report}
[Fri Jul 07 21:16:11 IST 2017] [driver] context: WEBVIEW_1
[Fri Jul 07 21:16:11 IST 2017] [driver] application under test:
[Fri Jul 07 21:16:11 IST 2017] [driver] app path: null
[Fri Jul 07 21:16:11 IST 2017] [driver] full reset: false
[Fri Jul 07 21:16:11 IST 2017] [driver] instrument: false
[Fri Jul 07 21:16:11 IST 2017] [driver] no reset: false
[Fri Jul 07 21:16:11 IST 2017] [driver] package name: null
[Fri Jul 07 21:16:11 IST 2017] [driver] activity name: null
[Fri Jul 07 21:16:11 IST 2017] [driver] stop on reset: true
[Fri Jul 07 21:16:11 IST 2017] [driver] browser: true
[Fri Jul 07 21:16:11 IST 2017] [driver] connecting localhost:4723
[Fri Jul 07 21:16:11 IST 2017] [driver] Call of getSessionID returned: 187b
[Fri Jul 07 21:16:11 IST 2017] [driver] setting reporter directory: D:\Programming\Appium\Results
[Fri Jul 07 21:16:11 IST 2017] [driver] setting reporter format: html
[Fri Jul 07 21:16:11 IST 2017] [driver] setting test name: Appium Studio Custom Report
[Fri Jul 07 21:16:11 IST 2017] [driver] wait for device ‘@os=‘android’’ timeout-ms=‘120000’
[Fri Jul 07 21:16:18 IST 2017] [driver] Device ‘adb:Nexus 5’ ready
[Fri Jul 07 21:16:19 IST 2017] [driver] Call of launchApp returned: web
[Fri Jul 07 21:16:19 IST 2017] [187b] [driver] [start] manage()
[Fri Jul 07 21:16:19 IST 2017] [187b] [driver] [end] manage
[Fri Jul 07 21:16:19 IST 2017] [187b] [driver] [start] get(“http://newtours.demoaut.com/”)
[Fri Jul 07 21:16:28 IST 2017] [187b] [driver] [end] get
[Fri Jul 07 21:16:28 IST 2017] [187b] [driver] [start] executeScript(“client:client.report(“This is a custom message inserted into the test report.”, false)”)
[Fri Jul 07 21:16:29 IST 2017] [187b] [driver] [end] executeScript
[Fri Jul 07 21:16:29 IST 2017] [187b] [driver] [start] quit()
[Fri Jul 07 21:16:31 IST 2017] [driver] Call of close returned: D:\Programming\Appium\Results\test3
[Fri Jul 07 21:16:31 IST 2017] [187b] [driver] [end] quit
FAILED: launchBrowserTest
com.experitest.client.InternalException: Exception caught while executing hybridRunJavascript: client is not defined STACK: ReferenceError: client is not defined
at :2:8
at com.experitest.client.JavaClientInternals.executeInternally(JavaClientInternals.java:249)
at com.experitest.client.Client.execute(Client.java:247)
at com.experitest.client.Client.hybridRunJavascript(Client.java:1353)
at com.experitest.appium.STClientFacade.executeJavaScript(STClientFacade.java:497)
at com.experitest.appium.SeeTestAndroidDriver.executeScript(SeeTestAndroidDriver.java:806)
at customResultReport.launchBrowserTest(customResultReport.java:53)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:104)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:645)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:851)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1177)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112)
at org.testng.TestRunner.privateRun(TestRunner.java:756)
at org.testng.TestRunner.run(TestRunner.java:610)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:387)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:382)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:340)
at org.testng.SuiteRunner.run(SuiteRunner.java:289)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1293)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1218)
at org.testng.TestNG.runSuites(TestNG.java:1133)
at org.testng.TestNG.run(TestNG.java:1104)
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:132)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:236)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:81)

===============================================
Default test
Tests run: 1, Failures: 1, Skips: 0

===============================================
Default suite
Total tests run: 1, Failures: 1, Skips: 0

[TestNG] Time taken by org.testng.reporters.XMLReporter@1ce24091: 13 ms
[TestNG] Time taken by org.testng.reporters.jq.Main@4e50c791: 72 ms
[TestNG] Time taken by org.testng.reporters.JUnitReportReporter@71e9ddb4: 37 ms
[TestNG] Time taken by [FailedReporter passed=0 failed=0 skipped=0]: 10 ms
[TestNG] Time taken by org.testng.reporters.SuiteHTMLReporter@75db5df9: 46 ms
[TestNG] Time taken by org.testng.reporters.EmailableReporter2@f79e: 12 ms

Hi Team,

Does anybody have any inputs on the above issue?

Hi Uday,

I’ve tested it, there is a bug in the version that you are using - this bug was fixed for the 11.0 version
can you kindly help me verify it from your side as-well

please note this is not an official release in just an early release candidate

http://experitest.s3.amazonaws.com/AppiumStudio_windows_11_0_13.exe