[Appium][Flutter]Calls flutter-driver via HttpRequests

I’ve written some easy articles about Flutter x Appium. [Appium][Flutter]Espresso driver x Flutter, [Flutter]Flutter app with Appium .

Recently, some topics about accessibility feature/Espresso/EarlGrey are in Flutter issues. issue1, issue2, issue3. Their main topic is how to overwrap Espresso/EarlGrey and Flutter. Their main concept is Espresso-Web according to their issues. Anyway, the topics are very exciting for test automation world.

In https://github.com/KazuCocoa/proto-flutter-driver-server , I tried to launch HttpServer inside Flutter world to handle flutter_driver via HTTP requests. If it works well, we can communicate with the flutter_driver via Appium easily.

Below is the result. Basic functionality is probably fine. As my code, I simply calls flutter_driver inside HttpServer. Clients send HTTP requests, then the http server calls flutter_driver APIs. The server returns the result to the clients.

One concern is we should call app.main() as flutter_driver does to launch Flutter View. After that, the flutter_driver connects to the main view. e.g. https://github.com/KazuCocoa/proto-flutter-driver-server/blob/master/test_driver/app_test.dart

Flutter generates apks/ipas in order to make their outputs work on Android/iOS framework. Thus, so far, it is not easy to connect to the Flutter scheme from such release apks/ipas. If Flutter team works for Espresso/EarlGrey more, I assume such issue will also alleviate more.

Conclusion

I was able to launch http server inside Flutter world. I could also communicate with Flutter elements via flutter_driver. e.g. bySemanticsLabel, tap etc. getRenderTree as well.

They are working to improve usage of Flutter View elements via Espresso/EarlGrey. In the future, we probably can handle elements via Espresso Driver / XCUITest driver in Appium terms. (But maybe using flutter_driver directly is the most stable usage tho.)

one more thing. Flutter is used by https://fuchsia.googlesource.com/fuchsia/. If the OS will be alternative of Android, Dart and today’s research will help in the case, too.

Advertisements

[Appium][Azure]Build Appium Test Running environment on Azure Pipeline

Azure provide macOS instance for Android CI environment. On the instance, we can create x86 architecture Android emulator. The emulator is faster than arm’s one. Then, we can run tests which is necessary to launch emulator instances faster.

On ruby_lib_core project, I built the environment for Android and iOS. The project already has over 50 scenarios as functional tests with Appium instance. It also has unit level fast test, of course.

iOS is on simulator. Android is on x86 emulator. Totally, it takes around 15 minutes, so far. I haven’t turned it yet with like useXctestrunFile though. I set them to run 14 jobs at once. Each job can run in 10 min. A few project takes over 10 min.

For iOS jobs, building WDA is the most high cost. We can use pre-build xctestrun file if we turn more, but currently it is enough to build every time. If we can reduce the build time, the test running time should be short over a couple of mins.

For Android jobs, launching emulator takes a couple of mins. If we can use real services or pre-launched devices, the time can be faster.

If you would like to find an example for Azure x Appium environment, feel free to see the Appium project’s code 🙂

[idb][iOS] idb renamed from FBSimulatorControl

FB has been renamed from FBSimulatorControl to idb as https://github.com/facebook/idb which also replaces WebDriverAgent with it, according to https://github.com/facebook/idb/issues/526. idb wraps handling simulators and real devices.

They also published brilliant documentation https://www.fbidb.io/ . It has a part about how idb works for xctest framework. https://www.fbidb.io/docs/test_execution

In the page, we can see essential concepts/words for XCUITests.

e.g. Run Many in Build Once, Run Many, Run Repeated by test-without-building which is also used in [Appium] Prevent building WDA with useXctestrunFile or usePrebuiltWDA to prevent build frequency in order to make test execution fast, testmanagerd daemon to handle test Applications via Xcode.

WWDC will come soon. Looking forward to seeing new/stable UI testing or testing related features there.

[update]

The most interesting thing in the idb is the command has Logic Test, Application Test and UI Test.

Logic tests start from here. Application tests is like an instrumentation tests in Android. It runs inside an iOS App Host Process. Easy to imagine like instrument in Espresso.

Logic tests are typically injected into a small host process like the xctest commandline.

Application Tests are similar to Logic Tests, but they run inside an iOS App Host Process.

In Xcode 7, Apple deprecated UIAutomation and replaced it with UI Testing support inside the XCTest framework itself. 

[Android] A note for jetpack benchmark feature in Android

At Google I/O, benchmarking feature has been released. The video is this.

In 2015, I wrote an article, titled [iOS][Swift]XCTestでパフォーマンスを計測したり、処理をwaitする. It was about how to measure performance in XCTest. It was able to use for both non-UI and UI tests.

As the similar way, we finally can get the way to measure performance on Android platform by benchmark! Below is the diff of iOS and Android.

//XCTest, Swift
func testMeasureMetrics(){
    measureMetrics([XCTPerformanceMetric_WallClockTime], automaticallyStartMeasuring: true, forBlock: {
        // Write test scenarios you would like to measure
    })
}

// Kotlin
@get:Rule val benchmarkRule = BenchmarkRule()

@Test
fun testMeasurePeroformance() {
    benchmarkRule.measureRepeated {
        // Write test scenarios you would like to measure
    }
}

They are very similar.

As the left side image, the benchmark focuses on measuring code performance mainly. It is not for the real world. The key is to reduce differences between test environment outside of code.


For now, if you would like to measure app performance before releasing the app in development environment or close to real user environment, we have below ways, for example.

|internal performance|      | close to real user environment |
| benchmark / Nimble | <==> | HeadSpin                       |

Take a look at Benchmark further

androidx.benchmark.AndroidBenchmarkRunner handles the benchmark feature. The runner is AndroidBenchmarkRunner. We should use the runner to measure such performance, we should switch AndroidTestRunner or your own Runner with it.

You should modulize your test target like https://developer.android.com/studio/projects/android-library#Convert and import it in the benchmark module. Or you should add the benchmark features into your test module.

As https://developer.android.com/studio/profile/benchmark#warnings , you must ensure your test app has been disabled debug feature since it make the performance worse. If you would like to measure production level code, it is mondatory tip to make the result reliable.

Anyway, it will be very promising to ensure the production code performance continuously.

https://github.com/KazuCocoa/EspressoEnv/pull/21/files is a simple example.
You can find samples in https://developer.android.com/studio/profile/benchmark#samples, too.

Happy testing and measuring performacne 🙂

[Android] Updated the official Fundamentals of Testing doc

Fundamentals of Testing has been updated based on AndroidX series.

As I have proposed similar pyramid for a long time to friends of mine and colleagues. e.g. [English]Test automation design for Cookpad’s global Android app, 2018, [Japanese]Android/iOSアプリのテストの区分戦略, 2016

In the article, below is mapped.

Toolset is also very similar, especially using  Espresso Intents to simplify and focus on functional tests for each view. Large Tests / User Scenario Tests by Appium or UiAutomator, too. Truth based assertion also. (I used assertj before, but I betted to Truth because I faced test not found errors in Android environment with the assertj.)

I’m happy to see my belief for mobile test automation design strategy has been going the proper way.

BTW, Appium also supports tests for app bundles. http://appium.io/docs/en/writing-running-appium/android/android-appbundle/

[Android][Appium] Page Source of Jetpack Compose

Google announced Jetpack Compose to simplify and programable UI development. I thought it was like Flutter then 🙂

I wondered if we can get view hierarchy correctly via the feature since if the feature is like Flutter, it is not on full Android view system. Espresso and UiAutomator probably cannot find element provided by it. (Kind of Unity app)

https://github.com/KazuCocoa/pagesource-jetpack-compose is the result. (I’m updating the repo)

The left image is button view. If they are built by XML, Espresso and UiAutomator can get full hierarchy to detect elements.

But as following XML, I was not able to get each element via them. uiautomator2 in Appium gets elements via UiDevice. espresso gets elements via ViewGroup (Ordinary, we get them via breadthFirstViewTraversal, but it caused OOM, so we changed to get view data via View…)

uiautomator2 Driver

<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>
<hierarchy index="0" class="hierarchy" rotation="0" width="1080" height="1794">
  <android.widget.FrameLayout index="0" package="androidx.ui.demos" class="android.widget.FrameLayout" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[0,0][1080,1794]" displayed="true">
    <android.view.ViewGroup index="0" package="androidx.ui.demos" class="android.view.ViewGroup" text="" resource-id="android:id/decor_content_parent" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[0,0][1080,1794]" displayed="true">
      <android.widget.FrameLayout index="0" package="androidx.ui.demos" class="android.widget.FrameLayout" text="" resource-id="android:id/action_bar_container" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[0,63][1080,210]" displayed="true">
        <android.view.ViewGroup index="0" package="androidx.ui.demos" class="android.view.ViewGroup" text="" resource-id="android:id/action_bar" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[0,63][1080,210]" displayed="true">
          <android.widget.TextView index="0" package="androidx.ui.demos" class="android.widget.TextView" text="Material/Buttons" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[42,101][443,172]" displayed="true" />
        </android.view.ViewGroup>
      </android.widget.FrameLayout>
      <android.widget.FrameLayout index="1" package="androidx.ui.demos" class="android.widget.FrameLayout" text="" resource-id="android:id/content" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[0,210][1080,1794]" displayed="true">
        <android.widget.FrameLayout index="0" package="androidx.ui.demos" class="android.widget.FrameLayout" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[0,210][1080,1794]" displayed="true">
          <android.view.ViewGroup index="0" package="androidx.ui.demos" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="true" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[0,210][1080,1794]" displayed="true" />
        </android.widget.FrameLayout>
      </android.widget.FrameLayout>
    </android.view.ViewGroup>
  </android.widget.FrameLayout>
</hierarchy>

Espresso Driver

<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>
<com.android.internal.policy.DecorView index="0" package="androidx.ui.demos" class="com.android.internal.policy.DecorView" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible="true" bounds="[0,0][1080,1920]" viewIndex="0">
  <com.android.internal.widget.ActionBarOverlayLayout index="0" package="androidx.ui.demos" class="com.android.internal.widget.ActionBarOverlayLayout" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible="true" bounds="[0,0][1080,1794]" resource-id="android:id/decor_content_parent" viewIndex="1">
    <android.widget.FrameLayout index="0" package="androidx.ui.demos" class="android.widget.FrameLayout" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible="true" bounds="[0,210][1080,1794]" resource-id="android:id/content" viewIndex="2">
      <android.widget.FrameLayout index="0" package="androidx.ui.demos" class="android.widget.FrameLayout" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible="true" bounds="[0,210][1080,1794]" viewIndex="3">
        <androidx.ui.core.AndroidCraneView index="0" package="androidx.ui.demos" class="androidx.ui.core.AndroidCraneView" checkable="false" checked="false" clickable="false" enabled="true" focusable="true" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible="true" bounds="[0,210][1080,1794]" viewIndex="4" />
      </android.widget.FrameLayout>
    </android.widget.FrameLayout>
    <com.android.internal.widget.ActionBarContainer index="1" package="androidx.ui.demos" class="com.android.internal.widget.ActionBarContainer" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible="true" bounds="[0,63][1080,210]" resource-id="android:id/action_bar_container" viewIndex="5">
      <android.widget.Toolbar index="0" package="androidx.ui.demos" class="android.widget.Toolbar" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible="true" bounds="[0,63][1080,210]" resource-id="android:id/action_bar" viewIndex="6">
        <android.widget.TextView index="0" package="androidx.ui.demos" class="android.widget.TextView" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible="true" bounds="[42,101][443,172]" text="Material/Buttons" hint="false" viewIndex="7" />
        <android.widget.ActionMenuView index="1" package="androidx.ui.demos" class="android.widget.ActionMenuView" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible="false" bounds="[1080,63][1080,210]" viewIndex="8" />
      </android.widget.Toolbar>
      <com.android.internal.widget.ActionBarContextView index="1" package="androidx.ui.demos" class="com.android.internal.widget.ActionBarContextView" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible="false" bounds="[0,63][0,63]" resource-id="android:id/action_context_bar" viewIndex="9" />
    </com.android.internal.widget.ActionBarContainer>
  </com.android.internal.widget.ActionBarOverlayLayout>
  <android.view.View index="1" package="androidx.ui.demos" class="android.view.View" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible="true" bounds="[0,1794][1080,1920]" resource-id="android:id/navigationBarBackground" viewIndex="10" />
  <android.view.View index="2" package="androidx.ui.demos" class="android.view.View" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible="true" bounds="[0,0][1080,63]" resource-id="android:id/statusBarBackground" viewIndex="11" />
</com.android.internal.policy.DecorView>

As seeing the XMLs, you cannot find some elements which exist in the above image.

There were no resources such as resource_id nor content-description as well. What about ViewTagin Appium (setTag in Android)?

The compose feature is pre-alpha as they address. So, in the future, they will support Espresso, then, we should be able to get view data as well as traditional XML tool chains.

Anyway, the programatic way is pretty interesting for me.

update:

[iOS]Xcode returns an authorization error

When I ran xcodebuild commands, I got an error which was about Install Failed: Error Domain=DVTDownloadableErrors Code=3 “The authorization was denied since no user interaction was possible.” UserInfo={AuthorizationErrorCode=-60007, NSLocalizedDescription=The authorization was denied since no user interaction was possible.}

Then, xcodebuild -checkFirstLaunchStatus returns 69 status code.

Maybe, it can fix with xcodebuild -runFirstLaunch, but I haven’t met this kind of error for 4 or 5 years.

Interesting…

Read [改訂新版]マインドマップから始めるソフトウェアテスト

I read [改訂新版]マインドマップから始めるソフトウェアテスト which is renewed software testing book. Ordinary, the was published in 2007. We never get new the book via Amazon etc recently even if it is very helpful for Test/QA engineers.

Mindmap tools are very useful toolset to break our thought down and arrange them. I like it very much. I often use the method in many situations.

In testing activities, we usually create test cases on spread sheet or Excel. But as same as development, test also has design and techniques. The concrete test cases in spreadsheet appear after the design phase.

In testing activities, we usually create test cases on spreadsheet or Excel. But as same as development, test also has design and techniques. The test cases in the spreadsheet are generated after the design phase. On the other hand, the test cases can be not good ones if the design is not well considered.

Mindmap helps then. We can spread our thought in the map, categorise them and re-structure if we need. It might lead to a well-considered design for testing. It reduces the risk of poor test cases.

[Appium] COMPILER_INDEX_STORE_ENABLE does not affect WDA build

I expected COMPILER_INDEX_STORE_ENABLE slightly improved WDA build time, but it did not affect… I would remain the result here.

$ time xcodebuild  build-for-testing -derivedDataPath ./tmp -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -sdk iphonesimulator IPHONEOS_DEPLOYMENT_TARGET=12.1 GCC_TREAT_WARNINGS_AS_ERRORS=0

No COMPILER_INDEX_STORE_ENABLE=NO

** TEST BUILD SUCCEEDED ** [31.798 sec]
** TEST BUILD SUCCEEDED ** [32.316 sec]
** TEST BUILD SUCCEEDED ** [32.578 sec]

With COMPILER_INDEX_STORE_ENABLE=NO

** TEST BUILD SUCCEEDED ** [32.278 sec]
** TEST BUILD SUCCEEDED ** [32.352 sec]
** TEST BUILD SUCCEEDED ** [32.470 sec]

Update:

But the COMPILER_INDEX_STORE_ENABLE=NO does not specify -index-store-path for the clang build. It slightly affects in some case, I guess…. But according to the above, it probably does not affect to WDA, anyway.

[Appium]Re-use existing WDA in create session command

In [Appium] Prevent building WDA with useXctestrunFile or usePrebuiltWDA, I explained how to skip re-building WDA every session in order to make test setup faster.

I would like to show a “cache” feature for WDA in Appium. After this PR , the function will work correctly. The PR will be in 1.12.1 or 1.13.0.

As a user, avoiding useNewWDA: true is the only thing to get the benefit since the capability forces Appium to re-install WDA every session.

Below comparison data is based on ruby_lib_core test suite. The host machine spec is also the same as [Appium] Prevent building WDA with useXctestrunFile or usePrebuiltWDA.

Result

  • After: Upcoming Appium
    • 4 sec
  • Before: Appium 1.12.0
    • 20 sec

The range to measure the time was in a create session command. As a Appium log, from --> POST /wd/hub/session to [HTTP] <-- POST /wd/hub/session/xxxxx/timeouts 200 8 ms - 14 was.

You can run UI tests less delay between each test case. If you do not change or re-install WDA every session, the improvement has a significant impact on your test running time.

Logs

The fidderence between the before and after is [WD Proxy] Got an unexpected response: {"errno":"ECONNRESET","code":"ECONNRESET","syscall":"read"}. It appears frequently in the Before log, while non of such loop in the After log.

A log in Before

2019-03-23 10:02:00:880 - [HTTP] --> POST /wd/hub/session
2019-03-23 10:02:00:880 - [HTTP] {"desiredCapabilities":{"platformName":"ios","automationName":"XCUITest","bundleId":"com.kazucocoa.apple-samplecode.UICatalog","udid":"auto","platformVersion":"12.1","deviceName":"iPhone 8","useNewWDA":false,"useJSONSource":true,"someCapability":"some_capability","newCommandTimeout":120,"wdaLocalPort":8100,"waitForQuiescence":true,"reduceMotion":true,"screenshotQuality":2,"xcodeSigningId":"iPhone Developer","xcodeOrgId":"xxxxxx","updatedWDABundleId":"com.kazucocoa.WebDriverAgentRunner","derivedDataPath":"/Users/kazu/GitHub/ruby_lib_core/tmp/xxxxxx","bootstrapPath":"/Users/kazu/GitHub/ruby_lib_core/tmp/xxxxxx/Build/Products","useXctestrunFile":true},"capabilities":{"firstMatch":[{"platformName":"ios","appium:automationName":"XCUITest","appium:bundleId":"com.kazucocoa.apple-samplecode.UICatalog","appium:udid":"auto","appium:platformVersion":"12.1","appium:deviceName":"iPhone 8","appium:useNewWDA":false,"appium:useJSONSource":true,"appium:someCapability":"some_capability","appium:ne
2019-03-23 10:02:00:882 - [debug] [W3C] Calling AppiumDriver.createSession() with args: [{"platformName":"ios","automationName":"XCUITest","bundleId":"com.kazucocoa.apple-samplecode.UICatalog","udid":"auto","platformVersion":"12.1","deviceName":"iPhone 8","useNewWDA":false,"useJSONSource":true,"someCapability":"some_capability","newCommandTimeout":120,"wdaLocalPort":8100,"waitForQuiescence":true,"reduceMotion":true,"screenshotQuality":2,"xcodeSigningId":"iPhone Developer","xcodeOrgId":"xxxxxx","updatedWDABundleId":"com.kazucocoa.WebDriverAgentRunner","derivedDataPath":"/Users/kazu/GitHub/ruby_lib_core/tmp/xxxxxx","bootstrapPath":"/Users/kazu/GitHub/ruby_lib_core/tmp/xxxxxx/Build/Products","useXctestrunFile":true},null,{"firstMatch":[{"platformName":"ios","appium:automationName":"XCUITest","appium:bundleId":"com.kazucocoa.apple-samplecode.UICatalog","appium:udid":"auto","appium:platformVersion":"12.1","appium:deviceName":"iPhone 8","appium:useNewWDA":false,"appium:useJSONSource":true,"appium:someCapability":"some_capability","appium:newCommandTimeout":120,"appium:wdaLocalPort":8100,"appi...
2019-03-23 10:02:00:883 - [debug] [BaseDriver] Event 'newSessionRequested' logged at 1553335320883 (19:02:00 GMT+0900 (Japan Standard Time))
2019-03-23 10:02:01:068 - [Appium] Appium v1.12.0-beta.0 creating new XCUITestDriver (v2.109.0) session
2019-03-23 10:02:01:069 - [Appium] Capabilities:
2019-03-23 10:02:01:069 - [Appium]   platformName: ios
2019-03-23 10:02:01:069 - [Appium]   automationName: XCUITest
2019-03-23 10:02:01:069 - [Appium]   bundleId: com.kazucocoa.apple-samplecode.UICatalog
2019-03-23 10:02:01:069 - [Appium]   udid: auto
2019-03-23 10:02:01:069 - [Appium]   platformVersion: 12.1
2019-03-23 10:02:01:069 - [Appium]   deviceName: iPhone 8
2019-03-23 10:02:01:069 - [Appium]   useNewWDA: false
2019-03-23 10:02:01:069 - [Appium]   useJSONSource: true
...
2019-03-23 10:02:01:070 - [Appium]   updatedWDABundleId: com.kazucocoa.WebDriverAgentRunner
2019-03-23 10:02:01:070 - [Appium]   derivedDataPath: /Users/kazu/GitHub/ruby_lib_core/tmp/xxxxxx
2019-03-23 10:02:01:070 - [Appium]   bootstrapPath: /Users/kazu/GitHub/ruby_lib_core/tmp/xxxxxx/Build/Products
2019-03-23 10:02:01:070 - [Appium]   useXctestrunFile: true
2019-03-23 10:02:01:072 - [debug] [BaseDriver] W3C capabilities {"alwaysMatch":{"platformNa... and MJSONWP desired capabilities {"platformName":"ios","auto... were provided
2019-03-23 10:02:01:072 - [debug] [BaseDriver] Creating session with W3C capabilities: {"alwaysMatch":{"platformNa...
2019-03-23 10:02:01:077 - [BaseDriver] The following capabilities were provided, but are not recognized by appium: someCapability.
2019-03-23 10:02:01:078 - [BaseDriver] Session created with session id: afbfeff7-3d9d-4857-9724-8a32e650fde6
...
2019-03-23 10:02:01:495 - [XCUITest] Setting up real device
2019-03-23 10:02:01:899 - [XCUITest] Using WDA path: '/Users/kazu/GitHub/ruby_lib_core/tmp/xxxxxx/Build/Products'
2019-03-23 10:02:01:899 - [XCUITest] Using WDA agent: '/Users/kazu/GitHub/ruby_lib_core/tmp/xxxxxx/Build/Products/WebDriverAgent.xcodeproj'
2019-03-23 10:02:02:074 - [XCUITest] Detected 1 obsolete cached process from previous WDA sessions. Cleaning up...
2019-03-23 10:02:02:086 - [debug] [WD Proxy] Matched '/status' to command name 'getStatus'
2019-03-23 10:02:02:087 - [debug] [WD Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
2019-03-23 10:02:05:106 - [WD Proxy] Got an unexpected response: {"code":"ESOCKETTIMEDOUT","connect":false}
2019-03-23 10:02:05:107 - [debug] [XCUITest] WDA is not listening at 'http://localhost:8100/'
2019-03-23 10:02:05:107 - [debug] [XCUITest] WDA is currently not running. There is nothing to cache
2019-03-23 10:02:05:107 - [debug] [XCUITest] Trying to start WebDriverAgent 1 times with 10000ms interval
2019-03-23 10:02:05:107 - [debug] [XCUITest] These values can be customized by changing wdaStartupRetries/wdaStartupRetryInterval capabilities
2019-03-23 10:02:05:108 - [debug] [BaseDriver] Event 'wdaStartAttempted' logged at 1553335325108 (19:02:05 GMT+0900 (Japan Standard Time))
2019-03-23 10:02:05:108 - [XCUITest] Launching WebDriverAgent on the device
2019-03-23 10:02:05:109 - [debug] [XCUITest] Killing running processes 'xcodebuild.*242bfcc998fd156df0bd0ad1dde8ab8e0a032114, iproxy 8100' for the device 242bfcc998fd156df0bd0ad1dde8ab8e0a032114...
2019-03-23 10:02:05:324 - [debug] [XCUITest] 'pgrep -nif xcodebuild.*242bfcc998fd156df0bd0ad1dde8ab8e0a032114' didn't detect any matching processes. Return code: 1
2019-03-23 10:02:05:356 - [debug] [XCUITest] 'pgrep -nif iproxy 8100' didn't detect any matching processes. Return code: 1
2019-03-23 10:02:05:356 - [debug] [XCUITest] Starting iproxy to forward traffic from local port 8100 to device port 8100 over USB for the device 242bfcc998fd156df0bd0ad1dde8ab8e0a032114
2019-03-23 10:02:10:383 - [debug] [XCUITest] Beginning test with command 'xcodebuild test-without-building -xctestrun /Users/kazu/GitHub/ruby_lib_core/tmp/xxxxxx/Build/Products/242bfcc998fd156df0bd0ad1dde8ab8e0a032114_12.1.xctestrun -destination id=242bfcc998fd156df0bd0ad1dde8ab8e0a032114 IPHONEOS_DEPLOYMENT_TARGET=12.1 GCC_TREAT_WARNINGS_AS_ERRORS=0' in directory '/Users/kazu/GitHub/ruby_lib_core/tmp/xxxxxx/Build/Products'
2019-03-23 10:02:10:384 - [debug] [XCUITest] Output from xcodebuild will not be logged. To change this, use 'showXcodeLog' desired capability
2019-03-23 10:02:10:979 - [debug] [XCUITest] Waiting up to 60000ms for WebDriverAgent to start
2019-03-23 10:02:10:980 - [debug] [WD Proxy] Matched '/status' to command name 'getStatus'
2019-03-23 10:02:10:981 - [debug] [WD Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
2019-03-23 10:02:10:990 - [WD Proxy] Got an unexpected response: {"errno":"ECONNRESET","code":"ECONNRESET","syscall":"read"}
2019-03-23 10:02:11:652 - [debug] [XCUITest] Log file for xcodebuild test: /Users/kazu/Library/Developer/Xcode/DerivedData/temporary-fkyiqlfygocksigngthmuhoipeic/Logs/Test/Test-Transient Testing-2019.03.23_19-02-11-+0900.xcresult/1_Test/Diagnostics/WebDriverAgentRunner-0B9129D8-85D9-476A-84AD-75E64C230A99/WebDriverAgentRunner-EEA39F35-7427-4D00-B4F4-522C3A215EA0/Session-WebDriverAgentRunner-2019-03-23_190211-B6ptNa.log
2019-03-23 10:02:11:991 - [debug] [WD Proxy] Matched '/status' to command name 'getStatus'
2019-03-23 10:02:11:992 - [debug] [WD Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
2019-03-23 10:02:11:996 - [WD Proxy] Got an unexpected response: {"errno":"ECONNRESET","code":"ECONNRESET","syscall":"read"}
2019-03-23 10:02:12:997 - [debug] [WD Proxy] Matched '/status' to command name 'getStatus'
2019-03-23 10:02:12:997 - [debug] [WD Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
2019-03-23 10:02:13:005 - [WD Proxy] Got an unexpected response: {"errno":"ECONNRESET","code":"ECONNRESET","syscall":"read"}
2019-03-23 10:02:14:006 - [debug] [WD Proxy] Matched '/status' to command name 'getStatus'
2019-03-23 10:02:14:006 - [debug] [WD Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
2019-03-23 10:02:14:011 - [WD Proxy] Got an unexpected response: {"errno":"ECONNRESET","code":"ECONNRESET","syscall":"read"}
2019-03-23 10:02:15:011 - [debug] [WD Proxy] Matched '/status' to command name 'getStatus'
2019-03-23 10:02:15:011 - [debug] [WD Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
2019-03-23 10:02:15:016 - [WD Proxy] Got an unexpected response: {"errno":"ECONNRESET","code":"ECONNRESET","syscall":"read"}
2019-03-23 10:02:16:017 - [debug] [WD Proxy] Matched '/status' to command name 'getStatus'
2019-03-23 10:02:16:017 - [debug] [WD Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
2019-03-23 10:02:16:024 - [WD Proxy] Got an unexpected response: {"errno":"ECONNRESET","code":"ECONNRESET","syscall":"read"}
2019-03-23 10:02:17:024 - [debug] [WD Proxy] Matched '/status' to command name 'getStatus'
2019-03-23 10:02:17:025 - [debug] [WD Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
2019-03-23 10:02:17:030 - [WD Proxy] Got an unexpected response: {"errno":"ECONNRESET","code":"ECONNRESET","syscall":"read"}
2019-03-23 10:02:18:031 - [debug] [WD Proxy] Matched '/status' to command name 'getStatus'
2019-03-23 10:02:18:032 - [debug] [WD Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
2019-03-23 10:02:18:051 - [debug] [WD Proxy] Got response with status 200: "{\n  \"value\" : {\n    \"state\" : \"success\",\n    \"os\" : {\n      \"name\" : \"iOS\",\n      \"version\" : \"12.1.4\",\n      \"sdkVersion\" : \"12.0\"\n    },\n    \"ios\" : {\n      \"simulatorVersion\" : \"12.1.4\",\n      \"ip\" : \"172.254.99.33\"\n    },\n    \"build\" : {\n      \"upgradedAt\" : \"1552566621411\",\n      \"time\" : \"Mar 23 2019 13:54:25\",\n      \"productBundleIdentifier\" : \"com.kazucocoa.WebDriverAgentRunner\"\n    }\n  },\n  \"sessionId\" : \"F928A843-EFDA-4BCA-B1FA-EA770C936B7F\",\n  \"status\" : 0\n}"
2019-03-23 10:02:18:052 - [debug] [XCUITest] WebDriverAgent information:
2019-03-23 10:02:18:052 - [debug] [XCUITest] {
2019-03-23 10:02:18:052 - [debug] [XCUITest]   "state": "success",
2019-03-23 10:02:18:052 - [debug] [XCUITest]   "os": {
2019-03-23 10:02:18:052 - [debug] [XCUITest]     "name": "iOS",
2019-03-23 10:02:18:052 - [debug] [XCUITest]     "version": "12.1.4",
2019-03-23 10:02:18:052 - [debug] [XCUITest]     "sdkVersion": "12.0"
2019-03-23 10:02:18:052 - [debug] [XCUITest]   },
2019-03-23 10:02:18:052 - [debug] [XCUITest]   "ios": {
2019-03-23 10:02:18:052 - [debug] [XCUITest]     "simulatorVersion": "12.1.4",
2019-03-23 10:02:18:053 - [debug] [XCUITest]     "ip": "172.254.99.33"
2019-03-23 10:02:18:053 - [debug] [XCUITest]   },
2019-03-23 10:02:18:053 - [debug] [XCUITest]   "build": {
2019-03-23 10:02:18:053 - [debug] [XCUITest]     "upgradedAt": "1552566621411",
2019-03-23 10:02:18:053 - [debug] [XCUITest]     "time": "Mar 23 2019 13:54:25",
2019-03-23 10:02:18:053 - [debug] [XCUITest]     "productBundleIdentifier": "com.kazucocoa.WebDriverAgentRunner"
2019-03-23 10:02:18:053 - [debug] [XCUITest]   }
2019-03-23 10:02:18:053 - [debug] [XCUITest] }
2019-03-23 10:02:18:054 - [debug] [XCUITest] WebDriverAgent successfully started after 7669ms
2019-03-23 10:02:18:055 - [debug] [BaseDriver] Event 'wdaSessionAttempted' logged at 1553335338055 (19:02:18 GMT+0900 (Japan Standard Time))
2019-03-23 10:02:18:055 - [debug] [XCUITest] Sending createSession command to WDA
2019-03-23 10:02:18:056 - [debug] [WD Proxy] Matched '/session' to command name 'createSession'
2019-03-23 10:02:18:056 - [debug] [WD Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"desiredCapabilities":{"bundleId":"com.kazucocoa.apple-samplecode.UICatalog","arguments":[],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true}}
2019-03-23 10:02:20:733 - [debug] [WD Proxy] Got response with status 200: {"value":{"sessionId":"20DCD0BD-8DF0-403B-B1E7-054C5AAEBFF3","capabilities":{"device":"iphone","browserName":"UICatalog","sdkVersion":"12.1.4","CFBundleIdentifier":"com.kazucocoa.apple-samplecode.UICatalog"}},"sessionId":"20DCD0BD-8DF0-403B-B1E7-054C5AAEBFF3","status":0}
2019-03-23 10:02:20:733 - [debug] [BaseDriver] Event 'wdaSessionStarted' logged at 1553335340733 (19:02:20 GMT+0900 (Japan Standard Time))
2019-03-23 10:02:20:733 - [debug] [BaseDriver] Event 'wdaStarted' logged at 1553335340733 (19:02:20 GMT+0900 (Japan Standard Time))
2019-03-23 10:02:20:733 - [XCUITest] Skipping setting of the initial display orientation. Set the "orientation" capability to either "LANDSCAPE" or "PORTRAIT", if this is an undesired behavior.
2019-03-23 10:02:20:733 - [debug] [BaseDriver] Event 'orientationSet' logged at 1553335340733 (19:02:20 GMT+0900 (Japan Standard Time))
2019-03-23 10:02:20:741 - [debug] [WD Proxy] Matched '/appium/settings' to command name 'updateSettings'
2019-03-23 10:02:20:741 - [debug] [WD Proxy] Proxying [POST /appium/settings] to [POST http://localhost:8100/session/20DCD0BD-8DF0-403B-B1E7-054C5AAEBFF3/appium/settings] with body: {"settings":{"useJSONSource":true}}
2019-03-23 10:02:20:747 - [debug] [WD Proxy] Got response with status 200: {"value":{"screenshotQuality":1,"mjpegScalingFactor":100,"elementResponseAttributes":"type,label","shouldUseCompactResponses":true,"mjpegServerFramerate":10,"mjpegServerScreenshotQuality":25},"sessionId":"20DCD0BD-8DF0-403B-B1E7-054C5AAEBFF3","status":0}
2019-03-23 10:02:20:747 - [XCUITest] Setting the quality of phone screenshot: '2'
2019-03-23 10:02:20:748 - [debug] [WD Proxy] Matched '/appium/settings' to command name 'updateSettings'
2019-03-23 10:02:20:749 - [debug] [WD Proxy] Proxying [POST /appium/settings] to [POST http://localhost:8100/session/20DCD0BD-8DF0-403B-B1E7-054C5AAEBFF3/appium/settings] with body: {"settings":{"screenshotQuality":2}}
2019-03-23 10:02:20:749 - [debug] [XCUITest] Connection to WDA timed out
2019-03-23 10:02:20:749 - [debug] [iProxy] recv failed: Operation not permitted
2019-03-23 10:02:20:753 - [debug] [WD Proxy] Got response with status 200: {"value":{"screenshotQuality":2,"mjpegScalingFactor":100,"elementResponseAttributes":"type,label","shouldUseCompactResponses":true,"mjpegServerFramerate":10,"mjpegServerScreenshotQuality":25},"sessionId":"20DCD0BD-8DF0-403B-B1E7-054C5AAEBFF3","status":0}
2019-03-23 10:02:20:754 - [Appium] New XCUITestDriver session created successfully, session afbfeff7-3d9d-4857-9724-8a32e650fde6 added to master session list
2019-03-23 10:02:20:754 - [debug] [BaseDriver] Event 'newSessionStarted' logged at 1553335340754 (19:02:20 GMT+0900 (Japan Standard Time))
2019-03-23 10:02:20:755 - [debug] [W3C (afbfeff7)] Cached the protocol value 'W3C' for the new session afbfeff7-3d9d-4857-9724-8a32e650fde6
2019-03-23 10:02:20:755 - [debug] [W3C (afbfeff7)] Responding to client with driver.createSession() result: {"capabilities":{"webStorageEnabled":false,"locationContextEnabled":false,"browserName":"","platform":"MAC","javascriptEnabled":true,"databaseEnabled":false,"takesScreenshot":true,"networkConnectionEnabled":false,"platformName":"ios","automationName":"XCUITest","bundleId":"com.kazucocoa.apple-samplecode.UICatalog","udid":"242bfcc998fd156df0bd0ad1dde8ab8e0a032114","platformVersion":"12.1","deviceName":"iPhone 8","useNewWDA":false,"useJSONSource":true,"someCapability":"some_capability","newCommandTimeout":120,"wdaLocalPort":8100,"waitForQuiescence":true,"reduceMotion":true,"screenshotQuality":2,"xcodeSigningId":"iPhone Developer","xcodeOrgId":"xxxxxx","updatedWDABundleId":"com.kazucocoa.WebDriverAgentRunner","derivedDataPath":"/Users/kazu/GitHub/ruby_lib_core/tmp/xxxxxx","bootstrapPath":"/Users/kazu/GitHub/ruby_lib_core/tmp/xxxxxx/Build/Products","useXctestrunFile":true}}
2019-03-23 10:02:20:759 - [HTTP] <-- POST /wd/hub/session 200 19878 ms - 951
2019-03-23 10:02:20:759 - [HTTP]
2019-03-23 10:02:20:759 - [debug] [XCUITest] Connection to WDA timed out
2019-03-23 10:02:20:759 - [debug] [iProxy] recv failed: Operation not permitted
2019-03-23 10:02:20:761 - [HTTP] --> POST /wd/hub/session/afbfeff7-3d9d-4857-9724-8a32e650fde6/timeouts
2019-03-23 10:02:20:761 - [HTTP] {"implicit":0}
2019-03-23 10:02:20:762 - [debug] [W3C (afbfeff7)] Calling AppiumDriver.timeouts() with args: [null,null,null,null,0,"afbfeff7-3d9d-4857-9724-8a32e650fde6"]
2019-03-23 10:02:20:762 - [debug] [XCUITest] Executing command 'timeouts'
2019-03-23 10:02:20:768 - [debug] [BaseDriver] W3C timeout argument: {"implicit":0}}
2019-03-23 10:02:20:768 - [debug] [BaseDriver] Set implicit wait to 0ms
2019-03-23 10:02:20:768 - [debug] [W3C (afbfeff7)] Responding to client with driver.timeouts() result: null
2019-03-23 10:02:20:769 - [HTTP] <-- POST /wd/hub/session/afbfeff7-3d9d-4857-9724-8a32e650fde6/timeouts 200 8 ms - 14
2019-03-23 10:02:20:769 - [HTTP]

A log in After

2019-03-23 10:02:51:982 - [HTTP] --> POST /wd/hub/session
2019-03-23 10:02:51:982 - [HTTP] {"desiredCapabilities":{"platformName":"ios","automationName":"XCUITest","bundleId":"com.kazucocoa.apple-samplecode.UICatalog","udid":"auto","platformVersion":"12.1","deviceName":"iPhone 8","useNewWDA":false,"useJSONSource":true,"someCapability":"some_capability","newCommandTimeout":120,"wdaLocalPort":8100,"waitForQuiescence":true,"reduceMotion":true,"screenshotQuality":2,"xcodeSigningId":"iPhone Developer","xcodeOrgId":"xxxxxx","updatedWDABundleId":"com.kazucocoa.WebDriverAgentRunner","derivedDataPath":"/Users/kazu/GitHub/ruby_lib_core/tmp/xxxxxx","bootstrapPath":"/Users/kazu/GitHub/ruby_lib_core/tmp/xxxxxx/Build/Products","useXctestrunFile":true},"capabilities":{"firstMatch":[{"platformName":"ios","appium:automationName":"XCUITest","appium:bundleId":"com.kazucocoa.apple-samplecode.UICatalog","appium:udid":"auto","appium:platformVersion":"12.1","appium:deviceName":"iPhone 8","appium:useNewWDA":false,"appium:useJSONSource":true,"appium:someCapability":"some_capability","appium:ne
2019-03-23 10:02:51:983 - [debug] [W3C] Calling AppiumDriver.createSession() with args: [{"platformName":"ios","automationName":"XCUITest","bundleId":"com.kazucocoa.apple-samplecode.UICatalog","udid":"auto","platformVersion":"12.1","deviceName":"iPhone 8","useNewWDA":false,"useJSONSource":true,"someCapability":"some_capability","newCommandTimeout":120,"wdaLocalPort":8100,"waitForQuiescence":true,"reduceMotion":true,"screenshotQuality":2,"xcodeSigningId":"iPhone Developer","xcodeOrgId":"xxxxxx","updatedWDABundleId":"com.kazucocoa.WebDriverAgentRunner","derivedDataPath":"/Users/kazu/GitHub/ruby_lib_core/tmp/xxxxxx","bootstrapPath":"/Users/kazu/GitHub/ruby_lib_core/tmp/xxxxxx/Build/Products","useXctestrunFile":true},null,{"firstMatch":[{"platformName":"ios","appium:automationName":"XCUITest","appium:bundleId":"com.kazucocoa.apple-samplecode.UICatalog","appium:udid":"auto","appium:platformVersion":"12.1","appium:deviceName":"iPhone 8","appium:useNewWDA":false,"appium:useJSONSource":true,"appium:someCapability":"some_capability","appium:newCommandTimeout":120,"appium:wdaLocalPort":8100,"appi...
2019-03-23 10:02:51:983 - [debug] [BaseDriver] Event 'newSessionRequested' logged at 1553335371983 (19:02:51 GMT+0900 (Japan Standard Time))
2019-03-23 10:02:51:984 - [Appium] Appium v1.12.0-beta.0 creating new XCUITestDriver (v2.109.0) session
2019-03-23 10:02:51:985 - [Appium] Capabilities:
2019-03-23 10:02:51:985 - [Appium]   platformName: ios
2019-03-23 10:02:51:985 - [Appium]   automationName: XCUITest
2019-03-23 10:02:51:985 - [Appium]   bundleId: com.kazucocoa.apple-samplecode.UICatalog
2019-03-23 10:02:51:986 - [Appium]   udid: auto
2019-03-23 10:02:51:986 - [Appium]   platformVersion: 12.1
2019-03-23 10:02:51:986 - [Appium]   deviceName: iPhone 8
2019-03-23 10:02:51:986 - [Appium]   useNewWDA: false
2019-03-23 10:02:51:986 - [Appium]   useJSONSource: true
...
2019-03-23 10:02:51:987 - [Appium]   updatedWDABundleId: com.kazucocoa.WebDriverAgentRunner
2019-03-23 10:02:51:987 - [Appium]   derivedDataPath: /Users/kazu/GitHub/ruby_lib_core/tmp/xxxxxx
2019-03-23 10:02:51:987 - [Appium]   bootstrapPath: /Users/kazu/GitHub/ruby_lib_core/tmp/xxxxxx/Build/Products
2019-03-23 10:02:51:987 - [Appium]   useXctestrunFile: true
2019-03-23 10:02:51:988 - [debug] [BaseDriver] W3C capabilities {"alwaysMatch":{"platformNa... and MJSONWP desired capabilities {"platformName":"ios","auto... were provided
2019-03-23 10:02:51:988 - [debug] [BaseDriver] Creating session with W3C capabilities: {"alwaysMatch":{"platformNa...
2019-03-23 10:02:51:992 - [BaseDriver] The following capabilities were provided, but are not recognized by appium: someCapability.
2019-03-23 10:02:51:993 - [BaseDriver] Session created with session id: b7c1b068-2b1f-420f-ae2a-4b7de624bb77
...
2019-03-23 10:02:52:224 - [XCUITest] Setting up real device
2019-03-23 10:02:52:623 - [XCUITest] Using WDA path: '/Users/kazu/GitHub/ruby_lib_core/tmp/xxxxxx/Build/Products'
2019-03-23 10:02:52:623 - [XCUITest] Using WDA agent: '/Users/kazu/GitHub/ruby_lib_core/tmp/xxxxxx/Build/Products/WebDriverAgent.xcodeproj'
2019-03-23 10:02:52:771 - [XCUITest] Detected 1 obsolete cached process from previous WDA sessions. Cleaning up...
2019-03-23 10:02:52:777 - [debug] [WD Proxy] Matched '/status' to command name 'getStatus'
2019-03-23 10:02:52:777 - [debug] [WD Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
2019-03-23 10:02:52:787 - [debug] [WD Proxy] Got response with status 200: "{\n  \"value\" : {\n    \"state\" : \"success\",\n    \"os\" : {\n      \"name\" : \"iOS\",\n      \"version\" : \"12.1.4\",\n      \"sdkVersion\" : \"12.0\"\n    },\n    \"ios\" : {\n      \"simulatorVersion\" : \"12.1.4\",\n      \"ip\" : \"172.254.99.33\"\n    },\n    \"build\" : {\n      \"upgradedAt\" : \"1552566621411\",\n      \"time\" : \"Mar 23 2019 13:54:25\",\n      \"productBundleIdentifier\" : \"com.kazucocoa.WebDriverAgentRunner\"\n    }\n  },\n  \"sessionId\" : \"20DCD0BD-8DF0-403B-B1E7-054C5AAEBFF3\",\n  \"status\" : 0\n}"
2019-03-23 10:02:52:787 - [debug] [XCUITest] Connection to WDA timed out
2019-03-23 10:02:52:787 - [debug] [iProxy] recv failed: Operation not permitted
2019-03-23 10:02:52:788 - [debug] [XCUITest] Upgrade timestamp of the currently bundled WDA: null
2019-03-23 10:02:52:788 - [debug] [XCUITest] Upgrade timestamp of the WDA on the device: 1552566621411
2019-03-23 10:02:52:788 - [XCUITest] Will reuse previously cached WDA instance at 'http://localhost:8100/' with 'com.kazucocoa.WebDriverAgentRunner'. Set the wdaLocalPort capability to a value different from 8100 if this is an undesired behavior.
2019-03-23 10:02:52:788 - [debug] [XCUITest] Trying to start WebDriverAgent 1 times with 10000ms interval
2019-03-23 10:02:52:788 - [debug] [XCUITest] These values can be customized by changing wdaStartupRetries/wdaStartupRetryInterval capabilities
2019-03-23 10:02:52:788 - [debug] [BaseDriver] Event 'wdaStartAttempted' logged at 1553335372788 (19:02:52 GMT+0900 (Japan Standard Time))
2019-03-23 10:02:52:788 - [XCUITest] Using provided WebdriverAgent at 'http://localhost:8100/'
2019-03-23 10:02:52:789 - [debug] [WD Proxy] Matched '/status' to command name 'getStatus'
2019-03-23 10:02:52:803 - [debug] [WD Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
2019-03-23 10:02:52:810 - [debug] [XCUITest] Connection to WDA timed out
2019-03-23 10:02:52:810 - [debug] [iProxy] recv failed: Operation not permitted
2019-03-23 10:02:52:811 - [debug] [WD Proxy] Got response with status 200: "{\n  \"value\" : {\n    \"state\" : \"success\",\n    \"os\" : {\n      \"name\" : \"iOS\",\n      \"version\" : \"12.1.4\",\n      \"sdkVersion\" : \"12.0\"\n    },\n    \"ios\" : {\n      \"simulatorVersion\" : \"12.1.4\",\n      \"ip\" : \"172.254.99.33\"\n    },\n    \"build\" : {\n      \"upgradedAt\" : \"1552566621411\",\n      \"time\" : \"Mar 23 2019 13:54:25\",\n      \"productBundleIdentifier\" : \"com.kazucocoa.WebDriverAgentRunner\"\n    }\n  },\n  \"sessionId\" : \"20DCD0BD-8DF0-403B-B1E7-054C5AAEBFF3\",\n  \"status\" : 0\n}"
2019-03-23 10:02:52:811 - [debug] [BaseDriver] Event 'wdaSessionAttempted' logged at 1553335372811 (19:02:52 GMT+0900 (Japan Standard Time))
2019-03-23 10:02:52:811 - [debug] [XCUITest] Sending createSession command to WDA
2019-03-23 10:02:52:811 - [debug] [WD Proxy] Matched '/session' to command name 'createSession'
2019-03-23 10:02:52:811 - [debug] [WD Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"desiredCapabilities":{"bundleId":"com.kazucocoa.apple-samplecode.UICatalog","arguments":[],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true}}
2019-03-23 10:02:55:881 - [debug] [WD Proxy] Got response with status 200: {"value":{"sessionId":"AF83370F-5CF2-458D-9945-2050BD7E38AF","capabilities":{"device":"iphone","browserName":"UICatalog","sdkVersion":"12.1.4","CFBundleIdentifier":"com.kazucocoa.apple-samplecode.UICatalog"}},"sessionId":"AF83370F-5CF2-458D-9945-2050BD7E38AF","status":0}
2019-03-23 10:02:55:881 - [debug] [BaseDriver] Event 'wdaSessionStarted' logged at 1553335375881 (19:02:55 GMT+0900 (Japan Standard Time))
2019-03-23 10:02:55:882 - [debug] [BaseDriver] Event 'wdaStarted' logged at 1553335375881 (19:02:55 GMT+0900 (Japan Standard Time))
2019-03-23 10:02:55:882 - [XCUITest] Skipping setting of the initial display orientation. Set the "orientation" capability to either "LANDSCAPE" or "PORTRAIT", if this is an undesired behavior.
2019-03-23 10:02:55:882 - [debug] [BaseDriver] Event 'orientationSet' logged at 1553335375882 (19:02:55 GMT+0900 (Japan Standard Time))
2019-03-23 10:02:55:885 - [debug] [WD Proxy] Matched '/appium/settings' to command name 'updateSettings'
2019-03-23 10:02:55:885 - [debug] [WD Proxy] Proxying [POST /appium/settings] to [POST http://localhost:8100/session/AF83370F-5CF2-458D-9945-2050BD7E38AF/appium/settings] with body: {"settings":{"useJSONSource":true}}
2019-03-23 10:02:55:885 - [debug] [XCUITest] Connection to WDA timed out
2019-03-23 10:02:55:886 - [debug] [iProxy] recv failed: Operation not permitted
2019-03-23 10:02:55:891 - [debug] [XCUITest] Connection to WDA timed out
2019-03-23 10:02:55:891 - [debug] [iProxy] recv failed: Operation not permitted
2019-03-23 10:02:55:891 - [debug] [WD Proxy] Got response with status 200: {"value":{"screenshotQuality":2,"mjpegScalingFactor":100,"elementResponseAttributes":"type,label","shouldUseCompactResponses":true,"mjpegServerFramerate":10,"mjpegServerScreenshotQuality":25},"sessionId":"AF83370F-5CF2-458D-9945-2050BD7E38AF","status":0}
2019-03-23 10:02:55:891 - [XCUITest] Setting the quality of phone screenshot: '2'
2019-03-23 10:02:55:893 - [debug] [WD Proxy] Matched '/appium/settings' to command name 'updateSettings'
2019-03-23 10:02:55:893 - [debug] [WD Proxy] Proxying [POST /appium/settings] to [POST http://localhost:8100/session/AF83370F-5CF2-458D-9945-2050BD7E38AF/appium/settings] with body: {"settings":{"screenshotQuality":2}}
2019-03-23 10:02:55:898 - [debug] [XCUITest] Connection to WDA timed out
2019-03-23 10:02:55:898 - [debug] [iProxy] recv failed: Operation not permitted
2019-03-23 10:02:55:900 - [debug] [WD Proxy] Got response with status 200: {"value":{"screenshotQuality":2,"mjpegScalingFactor":100,"elementResponseAttributes":"type,label","shouldUseCompactResponses":true,"mjpegServerFramerate":10,"mjpegServerScreenshotQuality":25},"sessionId":"AF83370F-5CF2-458D-9945-2050BD7E38AF","status":0}
2019-03-23 10:02:55:900 - [Appium] New XCUITestDriver session created successfully, session b7c1b068-2b1f-420f-ae2a-4b7de624bb77 added to master session list
2019-03-23 10:02:55:900 - [debug] [BaseDriver] Event 'newSessionStarted' logged at 1553335375900 (19:02:55 GMT+0900 (Japan Standard Time))
2019-03-23 10:02:55:900 - [debug] [W3C (b7c1b068)] Cached the protocol value 'W3C' for the new session b7c1b068-2b1f-420f-ae2a-4b7de624bb77
2019-03-23 10:02:55:901 - [debug] [W3C (b7c1b068)] Responding to client with driver.createSession() result: {"capabilities":{"webStorageEnabled":false,"locationContextEnabled":false,"browserName":"","platform":"MAC","javascriptEnabled":true,"databaseEnabled":false,"takesScreenshot":true,"networkConnectionEnabled":false,"platformName":"ios","automationName":"XCUITest","bundleId":"com.kazucocoa.apple-samplecode.UICatalog","udid":"242bfcc998fd156df0bd0ad1dde8ab8e0a032114","platformVersion":"12.1","deviceName":"iPhone 8","useNewWDA":false,"useJSONSource":true,"someCapability":"some_capability","newCommandTimeout":120,"wdaLocalPort":8100,"waitForQuiescence":true,"reduceMotion":true,"screenshotQuality":2,"xcodeSigningId":"iPhone Developer","xcodeOrgId":"xxxxxx","updatedWDABundleId":"com.kazucocoa.WebDriverAgentRunner","derivedDataPath":"/Users/kazu/GitHub/ruby_lib_core/tmp/xxxxxx","bootstrapPath":"/Users/kazu/GitHub/ruby_lib_core/tmp/xxxxxx/Build/Products","useXctestrunFile":true}}
2019-03-23 10:02:55:902 - [HTTP] <-- POST /wd/hub/session 200 3919 ms - 951
2019-03-23 10:02:55:908 - [HTTP]
2019-03-23 10:02:55:909 - [HTTP] --> POST /wd/hub/session/b7c1b068-2b1f-420f-ae2a-4b7de624bb77/timeouts
2019-03-23 10:02:55:909 - [HTTP] {"implicit":0}
2019-03-23 10:02:55:909 - [debug] [W3C (b7c1b068)] Calling AppiumDriver.timeouts() with args: [null,null,null,null,0,"b7c1b068-2b1f-420f-ae2a-4b7de624bb77"]
2019-03-23 10:02:55:910 - [debug] [XCUITest] Executing command 'timeouts'
2019-03-23 10:02:55:911 - [debug] [BaseDriver] W3C timeout argument: {"implicit":0}}
2019-03-23 10:02:55:911 - [debug] [BaseDriver] Set implicit wait to 0ms
2019-03-23 10:02:55:911 - [debug] [W3C (b7c1b068)] Responding to client with driver.timeouts() result: null
2019-03-23 10:02:55:912 - [HTTP] <-- POST /wd/hub/session/b7c1b068-2b1f-420f-ae2a-4b7de624bb77/timeouts 200 2 ms - 14
2019-03-23 10:02:55:912 - [HTTP]

Conclusion

The time has been improved.

Automated tests are not only “conducting tests” part, but also designing and analysing the result. We have many tools to achieve it. Re-using other area’s brilliant knowledge is also important.

I hope Appium can be a way to achieve it across various platforms. Not only for iOS and Swift, Android for Java/Kotlin, Windows for .NET, etc.