This page will describe more advanced MagicPod problem investigation methods, primarily for use by developers.
Table of Contents
- Browser side
- MagicPodDesktop side
- Appium-related investigations
1. Browser side
Click on the UI element on the screen capture of the Edit Test screen to display a pop-up window that will allow you to edit the element information. And you will see the locator information corresponding to the UI element, as shown in Figure 1 ((If the image was scanned by dragging and dropping a screen capture directly into the browser, the locator information will not be visible. )) . It is also possible to change the locator used to other candidates on this page.
Figure 1 Checking the locator
・Checking the UI tree on error
If the test fails, a link stating "Show failure UI tree" will appear on the test results screen, and if you click this, you can see the UI tree at the time of test failure. (Figure 2)
Figure 2 UI tree on error
・Detailed log output
If you set "Detail" > "Log level" in the Test Target Specification panel to "Expert," the log output will become more detailed. (Figure 3)
Figure 3 Specifying the log level
If you set this to “MagicPod bug Investigation,” more detailed information will be provided; however, operation may slow and an extremely large log file may be output. This should not be used unless requested by the MagicPod Support Team, so you should return your level to "Beginner" or "Expert" as soon as log acquisition has been completed.
・Developer tool console
In case an unexpected error occurs on the MagicPod page (the test is not saved, etc.), open the Developer tools from “More Tools” > “Developer Tools” on the Chrome menu page, select the “Console” tab, and check the content of the log. A MagicPod error, like the one shown in Figure 4, may appear. (Figure 4)
Figure 4 MagicPod web page errors
2. MagicPodDesktop side
・Checking console errors
You can check information on the various types of errors from the MagicPodDesktop “Console” tab (Figure 5). You can also check Appium Server and Selenium log information from “Appium Console” and “Selenium Console”.
Figure 5 MagicPodDesktop console
The MagicPodDesktop screen uses a setup file called “magic_pod_desktop.json”. Refer to this article for the location of the file.
・Work directory files
MagicPodDesktop creates the following files in the "magicPod" directory directly under the Desktop.
- test directory: The Node.js Appium/Selenium script is created when running the test.
- png and capture_temp.xml: This is the screen capture UI and tree XML taken when uploading the previous screen capture.
- log: The content of the MagicPodDesktop Appium Console or Selenium Console display is saved.
- log: Information equivalent to the contents of the Appium Console or Selenium Consoleare stored when MagicPod tests are run from the command line.
・Authentication information files
The MagicPod authentication information is saved to a file called “/Users/<username>/.magic_pod_token”. If this file is deleted, it will be necessary to log into MagicPodDesktop again. (For displaying on mac: "command"+"shift"+".")
・Developer tool console
If you choose “Tool” > “Toggle Developer Tools” on the menu to the top left of MagicPodDesktop, the same developer tools as Chrome screen will be displayed, where you can confirm the error information on the “Console” tab (Figure 6). If you feel that MagicPodDesktop is behaving strangely, but nothing is being displayed on the console, you can also check the contents of this log.
Figure 6 MagicPodDesktop developer tools
3. Appium-related investigations
Checking the UI tree using uiautomatorviewer
If the Android screen UI tree obtained by MagicPod is incorrect, you can isolate whether the problem is with Appium or UIAutomator by viewing the UI tree of the same screen with uiautomatorviewer.
- Use a USB cable to connect the Android device to the PC. Then, open the screen of the application that is causing the problem on the device.
- On the Mac terminal, open the uiautomatorviewer window by running the “JAVA_HOME=$(/usr/libexec/java_home -v 1.8) ~/Library/Android/sdk/tools/bin/uiautomatorviewer” command.
- The window shown in Figure 7 will open, so click the ① button to display the current UI tree content shown in ②.
Figure 7 uiautomatorviewer
Note that if Java 8 is not installed on the PC, an error will occur when launching uiautomatorviewer. If an error occurs, from the Mac terminal, try running “/usr/libexec/java_home -v 1.8”, and if an error appears stating that JVM version 1.8 is not installed, install Java 8.