Please note that this tool is classified as a Legacy tool. We recommend transitioning to our updated solutions to maintain optimal performance and security in your workflows. For more information on this matter, please reach out to technical support .
Appium SeeTest Extention supported only on grid tests
1. Add to Project dependencies
Gradle
repositories {
mavenCentral()
maven {
url "https://cloud.experitest.com/repo/"
}
}
dependencies {
//Appium - Junit specific
compile group: 'junit', name: 'junit', version: '4.12'
compile group: 'io.appium', name: 'java-client', version: '5.0.4'
compile group: 'org.webjars.npm', name: 'css-in-js-utils', version: '2.0.0'
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
compile group: 'com.experitest', name: 'appium-seetest-extension', version: '+'
}
2. Initialize
2.1. Standard Appium Driver Initialization
Normal Appium Driver Initialisation
AndroidDriver driver;
DesiredCapabilities dc = new DesiredCapabilities();
dc.setCapability("user", "[username]");
dc.setCapability("password", "[password]");
....
driver = new AndroidDriver(new URL("https://[hostname.grid.server]:[port]/wd/hub"), dc);
2.2. SeeTest Extension Initialization
SeeTest Extension Initialisation
SeeTestClient seeTestClient = new SeeTestClient(driver);
3. List of commands that involve file uploads and downloads
When using files in a context of a grid server, the files aren't stored directly to the device as Appium Driver would do but stored on the server for future use.
As the file is uploaded, a file identifier is returned (fileToken in our examples).
The file is session isolated and can't be used in other sessions or grid nodes.
When the session ends, the files are automatically deleted from the server.
Files operation are both supported by AndroidDriver and IOSDriver.
3.1. Upload a file
String fileToken = seeTestClient.uploadFile("C:\\dev\\img.jpg");
A file identifier is returned.
It can be then used for further Appium commands instead of using a local file path
3.2. Download file.
seeTestClient.downloadFile(fileToken, fileToUploadPath);
The file will be downloaded in the location specified by the second parameter fileToUploadPath.
3.3. File related command supported in SeeTest Extension
Command | SeeTest Extension | Link |
---|---|---|
* Report | <br/><br/>seeTestClient.report([Filepath of the image to attach to the report line.jpg]" , "my message 3", true);<br/><br/> | * SeeTestAutomation- Report |
* startMonitor * getMonitorData | <br/><br/>seeTestClient.startMonitor("DemoTest");<br/><br/>seeTestClient.getMonitorsData("[Filepath where to store the monitorData.csv]");<br/><br/> | * SeeTestAutomation- StartMonitor * SeeTestAutomation- GetMonitorsData |
* <br/><br/> collectSupportData<br/><br/> | <br/><br/>seeTestClient.collectSupportData("[Filepath where to store the SupportData.zip]", null, null, null, null, null);<br/><br/> | * SeeTestAutomation- Collect Support Data |
* capture | <br/><br/>seeTestClient.capture("[Filepath where to store the screenshot.png]", "test line");<br/><br/> | * SeeTestAutomation- Capture |
* startLoggingDevice * stopLoggingDevice | <br/><br/>seeTestClient.startLoggingDevice("[Filepath to output file.txt]");<br/><br/>seeTestClient.stopLoggingDevice();<br/><br/> | * SeeTestAutomation- StartLoggingDevice * SeeTestAutomation- StopLoggingDevice |
* startAudioRecording * stopAudioRecording | <br/><br/>seeTestClient.startAudioRecording("[Filepath where to store the audio.wav]");<br/><br/>Thread.sleep(2000);<br/><br/>seeTestClient.stopAudioRecording();<br/><br/> | * SeeTestAutomation- StartAudioRecording * SeeTestAutomation- StopAudioRecording |
* simulateCapture | <br/><br/>seeTestClient.simulateCapture("[path to image to use for capture.png");<br/><br/> | * SeeTestAutomation- SimulateCapture |
* startAudioPlay * stopAudioPlay * <br/><br/> waitForAudioPlayEnd<br/><br/> | <br/><br/>seeTestClient.startAudioPlay("[Filepath to input audio.wav]");<br/><br/>seeTestClient.waitForAudioPlayEnd(10000)<br/><br/>seeTestClient.stopAudioPlay();<br/><br/> | * SeeTestAutomation- StartAudioPlay * SeeTestAutomation- WaitForAudioPlayEnd * SeeTestAutomation- Audio Support |
* <br/><br/> startCaptureNetworkDump<br/><br/> * <br/><br/> stopCaptureNetworkDump<br/><br/> | <br/><br/>seeTestClient.startCaptureNetworkDump("[Filepath where to store networkDump.pcap]");<br/><br/>...<br/><br/>seeTestClient.stopCaptureNetworkDump();<br/><br/> | * SeeTestAutomation- CaptureNetworkDump |
* <br/><br/> startHarRecording<br/><br/> * <br/><br/> stopHarRecording<br/><br/> | <br/><br/>seeTestClient.startHarRecording("[Filepath where to store har recording.zip]", "[Filter(optional) to choose recorded content type]");<br/><br/>...<br/><br/>seeTestClient.stopHarRecording();<br/><br/> | * SeeTestAutomation - Har Recording |
3.3. Unsupported commands
- install(),
- getDeviceLog(), generateReport()
- startTransaction, endTransaction
- startVideoRecord, stopVideoRecord
- getMonitorsData() - without paramerter
- capture() / capture(String line)
4. Example
Example (Java)
public class SeeTestClientExample {
private AndroidDriver driver;
private SeeTestClient client;
@Before
public void setUp() throws Exception {
DesiredCapabilities dc = new DesiredCapabilities();
dc.setCapability("app", EAndroidApps.ERI_BANK.absolutePath);
driver = new AndroidDriver(new URL(SERVER_URL), dc);
// Init the wrapper of driver
client = new SeeTestClient(driver);
}
@After
public void tearDown() throws Exception {
if (driver != null) {
driver.quit();
}
}
@Test
public void testMethodExists() throws Exception {
// use the additional API method
System.out.println(client.getDeviceLog());
}
}