Upgrade to Pro — share decks privately, control downloads, hide ads and more …

WebDriverAgentってなに?

Shingo Tamaki
January 19, 2017

 WebDriverAgentってなに?

WebDriverAgentってなに?
Appium1.6.xの気になるところを調べてみた

Shingo Tamaki

January 19, 2017
Tweet

More Decks by Shingo Tamaki

Other Decks in Technology

Transcript

  1. WebDriverAgentͬͯͳʹʁ
    Appium1.6.xͷؾʹͳΔͱ͜ΖΛௐ΂ͯΈͨ

    View full-size slide

  2. ࣗݾ঺հ
    ۄ৓৴ޛ
    • גࣜձࣾ Origami
    • iOS Engineer
    • Favorite iOS framework
    • HomeKit/XCUITest/XCTest/Core Bluetooth

    View full-size slide

  3. ిࢠ޻࡞ͷษڧձ΍ͬͯ·͢
    iOSΤϯδχΞͷͨΊͷిࢠ޻࡞ษڧձ
    h"ps:/
    /www.facebook.com/groups/1698775433676484/

    View full-size slide

  4. UIςετࣗಈԽͯ͠·͔͢ʁ

    View full-size slide

  5. XCUITestΛ࢖ͬͨࣄ͕͋Δ
    or
    ࢖͍ͬͯΔ

    View full-size slide

  6. AppiumΛ࢖͍ͬͯΔ
    or
    ࢼͨ͜͠ͱ͕͋Δ

    View full-size slide

  7. ͦͷଞͷUIςεςΠϯάϑϨʔϜϫʔΫΛ
    ࢖ͬͨࣄ͕͋Δʁ
    • KIF
    • Carabash
    • EarlGray
    • etc

    View full-size slide

  8. Appium is Կʁ
    • ϚϧνϓϥοτϑΥʔϜ(iOS/Android/WindowsPhone)
    • UIςεςΟϯάϑϨʔϜϫʔΫ
    • ༷ʑͳςεςΟϯάϑϨʔϜϫʔΫ͕બ୒Մೳ
    • ϓϩμΫτίʔυʹมߋͳ͘ಋೖՄೳ
    • SeleniumϥΠΫͳ࢓༷ͷͨΊɺ਌͠Έ΍͍͢

    View full-size slide

  9. ಋೖ࣮੷΋ଟ͘ݟ͔͚·͢

    View full-size slide

  10. ಋೖ࣮੷΋ଟ͘ݟ͔͚·͢

    View full-size slide

  11. ಋೖ࣮੷΋ଟ͘ݟ͔͚·͢

    View full-size slide

  12. ಋೖ࣮੷΋ଟ͘ݟ͔͚·͢

    View full-size slide

  13. ಋೖ࣮੷΋ଟ͘ݟ͔͚·͢

    View full-size slide

  14. ࠓ೔࿩͞ͳ͍ࣄ
    • Appiumͷ۩ମతͳಋೖํ๏ʹ͍ͭͯ
    • UIςετͷಋೖίετ΍ӡ༻ʹ͍ͭͯ

    View full-size slide

  15. ࠷ۙͷAppiumͷมԽʹ͍ͭͯ

    View full-size slide

  16. ͦͷલʹiOSͷมԽͷ͓͞Β͍

    View full-size slide

  17. UIAutoma)on
    • Xcode6·Ͱͷඪ४UIςεςΟϯάϑϨʔϜϫʔΫ
    • instrumentsͷςϯϓϨʔτͷҰͭ
    • ςετίʔυ͸javascriptͰهड़

    View full-size slide

  18. XCUITest
    • Xcode7͔Β৽ͨʹ௥Ճ͞ΕͨUITestͷϑϨʔϜϫʔΫ
    • XCTestಉ༷ʹTest BundleΛϓϩδΣΫτʹ௥Ճ͢Δ
    • Objec6ve-C or Swi=ͰUIςετॻ͘͜ͱ͕Մೳ
    • XCTRunner͕ςετର৅ͷΞϓϦͷUIૢ࡞Λߦ͏

    View full-size slide

  19. XCUITest
    • XCTRunner͕ςετର৅ͷΞϓϦͷUI
    ૢ࡞Λߦ͏
    fbsimctl
    3435BE60-1111-2222-333-6C1E2B4C
    4A77 list_apps | grep bundle_id
    "bundleid" =
    "com.apple.test.XCUITestSampleUITests-
    Runner";
    ...
    "bundleid" = "com.apple.mobilesafari";
    "bundle_id" =
    "com.hoge.XCUITestSample";

    View full-size slide

  20. Architecture (Before 1.6.0)
    UIAutoma)onʹΑΔ࣮ߦ
    1. ޷͖ͳςεςΠϯάϑϨʔϜϫʔΫ
    2. ֤ݴޠͰ༻ҙ͞ΕͨAppiumClient࣮૷ͰJSON Wire Protocolੜ
    ੒͠ૹ৴
    3. AppiumServer͕υϥΠόʔܦ༝ͰUIAutoma)on࣮ߦ

    View full-size slide

  21. Architecture (a,er 1.6.0)
    XCUITestʹΑΔ࣮ߦ
    1. ޷͖ͳςεςΠϯάϑϨʔϜϫʔΫ
    2. ֤ݴޠͰ༻ҙ͞ΕͨAppiumClient࣮૷ͰJSON Wire Protocolੜ
    ੒͠ૹ৴
    3. AppiumServer͕υϥΠόʔܦ༝ͰXCUITest࣮ߦ

    View full-size slide

  22. Θ͔ΒΜϙΠϯτ
    ͦ΋ͦ΋ͷUIAutoma)on͸jsͰίʔυॻ͍࣮ͯߦ
    ͭ·Γ֎෦͔ΒiOS SimulatorΛૢ࡞͸ͦ΋ͦ΋ग़དྷΔ࡞Γ
    → Θ͔Δ (appium-ios-driver͸࣮ࡍ΋͏ͪΐͬͱෳࡶͳ࡞Γʹͳͬ
    ͯ·͢)

    View full-size slide

  23. Θ͔ΒΜϙΠϯτ
    XCUITestΛ֎෦͔Βૢ࡞͢Δʁ
    → Θ͔ΒΜ
    XCUITestͬͯϓϩδΣΫτʹTestόϯυϧೖΕͯςετίʔυ࣮
    ߦͤ͞Δײ͡Ͱ͢ΑͶʁ
    Appiumͷྑ͞ͷҰͭ͸ϓϩμΫτίʔυʹखΛՃ͑ͣʹUIςετ
    ͕ग़དྷΔࣄͷ͸ͣʁ΍ΊͪΌͬͨʁ
    XCUITestͬͯϓϩδΣΫτͷ֎͔Βίϯτϩʔϧग़དྷΔͷʁ!

    View full-size slide

  24. ௐ΂ͯΈͨɻ

    View full-size slide

  25. 1.6.0͔ΒXCUITestαϙʔτͨ͠Αͱɻ
    h"ps:/
    /github.com/appium/appium/releases

    View full-size slide

  26. ৽ͨʹ௥Ճ͞ΕͨDriver
    appium-xcuitest-driver
    h"ps:/
    /github.com/appium/appium-xcuitest-driver#appium-
    xcuitest-driver

    View full-size slide

  27. ߋʹͦͷதͰ࢖༻͞Ε͍ͯΔWebDriverAgent
    h"ps:/
    /github.com/facebook/WebDriverAgent
    h"ps:/
    /www.youtube.com/watch?v=Ea6YGFxBxY

    View full-size slide

  28. WebDriverAgent
    • WebDriverαʔόʔ࣮૷
    • ىಈ͢ΔͱΞϓϦ͸WebDriverͱͯ͠APIΛίʔϧग़དྷΔαʔό
    ͱͯ͠ىಈ͠·͢
    • WebDriverAgentΛ࢖͏ࣄͰ֎෦͔Βୟ͚ΔUI Test RunnerΛ࣮
    ݱ͍ͯ͠Δ
    • UIͷૢ࡞ʹ͍ͭͯ͸PrivateAPIΛ࢖༻͍ͯ͠Δͱͷࣄ

    View full-size slide

  29. ΋Ұ౓XCUITestΛࢥ͍ग़ͯ͠ΈΔɻ

    View full-size slide

  30. ·ͱΊ
    • WebDriverAgent͸WebDriverαʔό࣮૷
    • WebDriverAgent͸UI Test Runnerͷ୅ΘΓͱͯ͠ΞϓϦΛૢ࡞
    ͢ΔࣄͰ͜Ε·ͰͷAppiumͱ(΄΅)มΘΒ͵ڍಈΛ࣮ݱ͍ͯ͠
    Δ
    • ςετίʔυॻ͘෼ʹ͸UIAutoma:on/XCUITestͷͲͪΒ͕ಈ
    ͍ͯΔ͔͸ҙࣝ͢Δඞཁ͸ͳ͍ɻ

    View full-size slide