Testing with Android Studio and XCode - TestlumFramework/Testlum GitHub Wiki

Testing with Android Studio and XCode

Android Studio

The first step is to download AndroidStudio from the official website.

Install and launch the application.

Click More Actions.

Click on Virtual Device Manager.

To create a new device click Create Virtual Device.

Choose the appropriate one from the list of all available devices and finish the process of setting up.

Launch the emulator.

After Android installation emulator is ready to be used.

⚠️ Note: Additional steps for native apps:

Launch the emulator and download the application from the Play Market or download it from third-party resources.

Run the downloaded application and open Logсat.

Clear logs on the left.

Enter the command in the search engine .android.intent.action.MAIN.

Find in the logs the value cmp=com We need this value in the config file.

⚠️ About Mobile Browser Configuration

  • deviceName – field that represent the name of the emulator. It is setted up automatically by default as the name of the device and API version.
  • platformVersion – version of the Android that is installed on the device.
  • udid – Unique Device Identifier. Emulator-5554 is default UDID for an Android device.
  • appPackage – app package name.
  • appActivity – app activity that found in previous screenshot or if it does not work, then you can download the "apk info" application to the device and find an activity with the name MainActivity or HomeActivity.
<deviceName>Pixel 5 API 31</deviceName>
<platformVersion>15.0</platformVersion>
<udid>emulator-5554</udid>
<appPackage>com.todoist</appPackage>
<appActivity>com.todoist/.alias.HomeActivityDefault</appActivity>
Launching iOS simulator

Download xcode.

Click on Xcode on toolbar.

Click on Open developer tool and there choose simulator.

Click on File and choose Open simulator. Choose iOS version and proper device. Click on that device.

After loading of the iOS simulator is ready to be used.

To get UDID of the iOS simulator you need to go back to Xcode. On the tool bar choose Window and choose there devices and simulators.

Click on the simulators, choose needed simulator and get its UDID.

Simulator connection to Appium

To connect Testlum to the simulator you need to download additional software – appium server.

Set up connecting in the config file in Testlum:

<connection>
   <appiumServer>
       <serverUrl>http://127.0.0.1:4723/</serverUrl>
   </appiumServer>
</connection>

Click on “Edit configurations”.

Provide path to Java and Android SDK (this folder can be found after installing Android Studio) if they are not declared as global home variables.

Click Save and Restart.

Run simulator and start Appium server - Android testing ready to use.

⚠️ How to deal with set up errors

If there is a driver error when launching the emulator for a mobile browser, the following will help you:

Now save your changes Save As Preset and your saved config will show up in Preset.

Run the simulator and start the Appium server - Android testing ready to use.

⚠️ For iOS testing, it is needed to download appium web driver agent.

  • Choose the latest release download it and unzip it.
  • Go to the Appium server. Right-click on it, choose “Show package content”.
  • Open “Contents”.
  • Open “Resources”.
  • Open “App”.
  • Open “Node modules”.
  • Open “Appium”.
  • Open “Node modules”.
  • Here delete all old files in appium-webdriveragent and paste new ones from that folder which was downloaded in the first step.

To finish setting up just relaunch Appium server. Start Appium server, fill in the config and the iOS simulator is ready for the test. Type to search, ESC to discardType to search, ESC to discardType to search, ESC to discard.

⚠️ **GitHub.com Fallback** ⚠️