RobotFramework + SeleniumLibrary + Appiumで、iOSシミュレータ上のSafariブラウザでテストする

以前、AndroidChromeを使うテストをRobot Frameworkで書いてみました。
RobotFramework + SeleniumLibraryにて、Android実機上のChromeを使ってテストする - メモ的な思考的な

今回は、iOSシミュレータ上のSafariを使うテストをRobot Frameworkで書いてみます。

なお、DesiredCapabilitiesの内容についてはSeleniumWikiに情報があります。
DesiredCapabilities · SeleniumHQ/selenium Wiki · GitHub

 
目次

 

環境

  • Mac OS X 10.11.6
  • Python 3.6.2
  • RobotFramework 3.0.2
  • SeleniumLibrary 3.0.0b1
  • iOS シミュレータ 10.2
  • Node.js 8.4.0
  • Xcode 8.2.1
  • AppiumとSeleniumは、いずれかの組み合わせで動作

 
今回、iOSシミュレータのSafariを使うために、Appium経由で操作してみます。

なお、RobotFrameworkとAppiumを連携するための robotframework-appiumlibrary ライブラリは不要でした。
serhatbolsu/robotframework-appiumlibrary: AppiumLibrary is an appium testing library for RobotFramework

 

環境構築

Node.jsのインストール

Appiumを使うためにはNode.jsが必要なため、Node.jsをインストールします。

 

既存のNode.jsを削除

手元のNode.jsを確認したところ、Node.jsがあったため、アンインストールします。

$ brew uninstall node
Error: Refusing to uninstall /usr/local/Cellar/node/8.1.4
because it is required by heroku 6.12.8, which is currently installed.
You can override this and force removal with:
  brew uninstall --ignore-dependencies node

以前、Heroku Toolbeltをインストールした時のものが残っているようでした。

 
今回、Heroku ToolbeltのNode.jsは後で入れ直すことにして、アンインストールします。

$ brew uninstall heroku
Uninstalling /usr/local/Cellar/heroku/6.12.8... (5,974 files, 30.7MB)
heroku 5.6.1-0976cf3 1 is still installed.
Remove all versions with `brew uninstall --force heroku`.

 
削除しきれていないようなので、Herokuのドキュメントに従って削除します。
Heroku CLI | Heroku Dev Center

$ brew uninstall --force heroku
Uninstalling heroku... (12,942 files, 79.7MB)

# herokuに書いてあった方法で追加削除
$ rm -rf ~/.local/share/heroku ~/.config/heroku ~/Library/Caches/heroku
(特に結果は表示されない)

 
もう一度確認とまだインストールされていたため、そちらもアンインストールします。

$ node -v
v8.1.4

# アンインストール
$ brew uninstall node
Uninstalling /usr/local/Cellar/node/8.1.4... (3,782 files, 44.7MB)

# 確認
$ node -v
-bash: /usr/local/bin/node: No such file or directory

 

nodebrewのインストール

Node.jsもバージョン管理したいなと思ったところ、nodebrewがありました。

そこで、以下を参考にnodebrewをインストールします。
Homebrewからnodebrewをインストールして、Node.jsをインストールするまで - Qiita

$ brew install nodebrew
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (caskroom/cask).

==> Using the sandbox
==> Downloading https://github.com/hokaccha/nodebrew/archive/v0.9.7.tar.gz
==> Downloading from https://codeload.github.com/hokaccha/nodebrew/tar.gz/v0.9.7
######################################################################## 100.0%
==> /usr/local/Cellar/nodebrew/0.9.7/bin/nodebrew setup_dirs
==> Caveats
Add path:
  export PATH=$HOME/.nodebrew/current/bin:$PATH

To use Homebrew's directories rather than ~/.nodebrew add to your profile:
  export NODEBREW_ROOT=/usr/local/var/nodebrew

Bash completion has been installed to:
  /usr/local/etc/bash_completion.d

zsh completions have been installed to:
  /usr/local/share/zsh/site-functions
==> Summary
🍺  /usr/local/Cellar/nodebrew/0.9.7: 8 files, 38KB, built in 17 seconds

 

nodebrewのセットアップ

nodebrew setup

# セットアップ
$ nodebrew setup
Fetching nodebrew...
Installed nodebrew in $HOME/.nodebrew

========================================
Export a path to nodebrew:

export PATH=$HOME/.nodebrew/current/bin:$PATH
========================================

~/.bash_profileに追記

export PATH=$HOME/.nodebrew/current/bin:$PATH

.bash_profileを再読込

$ source ~/.bash_profile

 

nodebrewを使ったNode.jsのインストール
$ nodebrew install-binary stable
Fetching: https://nodejs.org/dist/v8.4.0/node-v8.4.0-darwin-x64.tar.gz
######################################################################## 100.0%
Installed successfully

 

使うバージョンを指定
$ nodebrew use stable
use v8.4.0

 

npm init

全部Enterで進めます

$ npm init
This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sensible defaults.

See `npm help json` for definitive documentation on these fields
and exactly what they do.

Use `npm install <pkg>` afterwards to install a package and
save it as a dependency in the package.json file.

Press ^C at any time to quit.
package name: (selenium_appium_sample) 
version: (1.0.0) 
description: 
entry point: (index.js) 
test command: 
git repository: 
keywords: 
author: 
license: (ISC) 
About to write to path/to/robotframework_sample/selenium_appium_sample/package.json:

{
  "name": "selenium_appium_sample",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC"
}


Is this ok? (yes) 

 

Appiumのインストール

GitHubのREADMEに従い、Appium本体をインストールします。
GitHub - appium/appium: Automation for iOS, Android, and Windows Apps.

$ npm install -g appium

npm WARN deprecated babel-core@5.8.24: Babel 5 is no longer being maintained. Upgrade to Babel 6.
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated line-numbers@0.2.0: Copy its ~20 LOC directly into your code instead.
/Users/you/.nodebrew/node/v8.4.0/bin/appium -> /Users/you/.nodebrew/node/v8.4.0/lib/node_modules/appium/build/lib/main.js

> appium-chromedriver@2.11.2 install /Users/you/.nodebrew/node/v8.4.0/lib/node_modules/appium/node_modules/appium-chromedriver
> node install-npm.js

info Chromedriver Install Installing Chromedriver version '2.28' for platform 'mac' and architecture '64'
info Chromedriver Install Opening temp file to write chromedriver_mac64 to...
info Chromedriver Install Downloading https://chromedriver.storage.googleapis.com/2.28/chromedriver_mac64.zip...
info Chromedriver Install Writing binary content to /var/folders/h0/l5plp4zd3517r988jpm481g00000gn/T/2017815-1009-nx99nt.vp8p/chromedriver_mac64.zip...
info Chromedriver Install Extracting /var/folders/h0/l5plp4zd3517r988jpm481g00000gn/T/2017815-1009-nx99nt.vp8p/chromedriver_mac64.zip to /var/folders/h0/l5plp4zd3517r988jpm481g00000gn/T/2017815-1009-nx99nt.vp8p/chromedriver_mac64
info Chromedriver Install Creating /Users/you/.nodebrew/node/v8.4.0/lib/node_modules/appium/node_modules/appium-chromedriver/chromedriver/mac...
info Chromedriver Install Copying unzipped binary, reading from /var/folders/h0/l5plp4zd3517r988jpm481g00000gn/T/2017815-1009-nx99nt.vp8p/chromedriver_mac64/chromedriver...
info Chromedriver Install Writing to /Users/you/.nodebrew/node/v8.4.0/lib/node_modules/appium/node_modules/appium-chromedriver/chromedriver/mac/chromedriver...
info Chromedriver Install /Users/you/.nodebrew/node/v8.4.0/lib/node_modules/appium/node_modules/appium-chromedriver/chromedriver/mac/chromedriver successfully put in place

> appium-selendroid-driver@1.6.2 install /Users/you/.nodebrew/node/v8.4.0/lib/node_modules/appium/node_modules/appium-selendroid-driver
> node ./bin/install.js

dbug AndroidDriver Getting Java version
info AndroidDriver Java version is: 1.8.0_144
info Selendroid Ensuring /Users/you/.nodebrew/node/v8.4.0/lib/node_modules/appium/node_modules/appium-selendroid-driver/selendroid/download exists
info Selendroid Downloading Selendroid standalone server version 0.17.0 from http://repo1.maven.org/maven2/io/selendroid/selendroid-standalone/0.17.0/selendroid-standalone-0.17.0-with-dependencies.jar --> /Users/you/.nodebrew/node/v8.4.0/lib/node_modules/appium/node_modules/appium-selendroid-driver/selendroid/download/selendroid-server-7cf7163ac47f1c46eff95b62f78b58c1dabdec534acc6632da3784739f6e9d82.jar
info Selendroid Writing binary content to /Users/you/.nodebrew/node/v8.4.0/lib/node_modules/appium/node_modules/appium-selendroid-driver/selendroid/download/selendroid-server.jar.tmp
info Selendroid Selendroid standalone server downloaded
info Selendroid Determining AndroidManifest location
info Selendroid Determining server apk location
info Selendroid Extracting manifest and apk to /Users/you/.nodebrew/node/v8.4.0/lib/node_modules/appium/node_modules/appium-selendroid-driver/selendroid/download
info Selendroid Copying manifest and apk to /Users/you/.nodebrew/node/v8.4.0/lib/node_modules/appium/node_modules/appium-selendroid-driver/selendroid
info Selendroid Cleaning up temp files
info Selendroid Fixing AndroidManifest icon bug

> appium-uiautomator2-driver@0.3.3 install /Users/you/.nodebrew/node/v8.4.0/lib/node_modules/appium/node_modules/appium-uiautomator2-driver
> node ./bin/install.js

dbug AndroidDriver Getting Java version
info AndroidDriver Java version is: 1.8.0_144
info UiAutomator2 downloading UiAutomator2 Server APK v0.1.5 : https://github.com/appium/appium-uiautomator2-server/releases/download/v0.1.5/appium-uiautomator2-server-v0.1.5.apk
info UiAutomator2 downloading UiAutomator2 Server test APK v0.1.5 : https://github.com/appium/appium-uiautomator2-server/releases/download/v0.1.5/appium-uiautomator2-server-debug-androidTest.apk
info UiAutomator2 UiAutomator2 Server APKs downloaded

> appium-windows-driver@0.5.0 install /Users/you/.nodebrew/node/v8.4.0/lib/node_modules/appium/node_modules/appium-windows-driver
> node install-npm.js

Not installing WinAppDriver since did not detect a Windows system

> fsevents@1.1.2 install /Users/you/.nodebrew/node/v8.4.0/lib/node_modules/appium/node_modules/fsevents
> node install

[fsevents] Success: "/Users/you/.nodebrew/node/v8.4.0/lib/node_modules/appium/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64/fse.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile

> heapdump@0.3.9 install /Users/you/.nodebrew/node/v8.4.0/lib/node_modules/appium/node_modules/heapdump
> node-gyp rebuild

  CXX(target) Release/obj.target/addon/src/heapdump.o
  SOLINK_MODULE(target) Release/addon.node
+ appium@1.6.5
added 692 packages in 330.588s

 

Appium-doctorのインストール
$ npm install -g appium-doctor

/Users/you/.nodebrew/node/v8.4.0/bin/appium-doctor -> /Users/you/.nodebrew/node/v8.4.0/lib/node_modules/appium-doctor/appium-doctor.js
+ appium-doctor@1.4.3
added 155 packages in 28.769s

 

インストールされた内容を確認

[Node.js] インストール済みのパッケージ一覧を表示する - Qiita

$ npm -g list --depth=0
/Users/you/.nodebrew/node/v8.4.0/lib
├── appium@1.6.5
├── appium-doctor@1.4.3
└── npm@5.3.0

 

Javaまわりの設定を.bash_profileへ追加

Appium-doctorを実行したところ、 JAVA_HOME/bin のエラーが出ていたため、以下を参考に設定を追加します。
Appium Doctor - unable to set JAVA_HOME/bin - Issues/Bugs - Appium Discuss

export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home
export PATH=$PATH:$JAVA_HOME/bin

 

CarthageをHomebrewでインストール

Appium-doctorを実行したところ、 Carthage でエラーが出ました。

$ appium-doctor

info AppiumDoctor Appium Doctor v.1.4.3
info AppiumDoctor ### Diagnostic starting ###
info AppiumDoctor  ✔ The Node.js binary was found at: /Users/you/.nodebrew/current/bin/node
info AppiumDoctor  ✔ Node version is 8.4.0
info AppiumDoctor  ✔ Xcode is installed at: /Applications/Xcode.app/Contents/Developer
info AppiumDoctor  ✔ Xcode Command Line Tools are installed.
info AppiumDoctor  ✔ DevToolsSecurity is enabled.
info AppiumDoctor  ✔ The Authorization DB is set up properly.
WARN AppiumDoctor  ✖ Carthage was NOT found!
info AppiumDoctor  ✔ HOME is set to: /Users/you
info AppiumDoctor  ✔ ANDROID_HOME is set to: /Users/you/android/
info AppiumDoctor  ✔ JAVA_HOME is set to: /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home
info AppiumDoctor  ✔ adb exists at: /Users/you/android/platform-tools/adb
info AppiumDoctor  ✔ android exists at: /Users/you/android/tools/android
info AppiumDoctor  ✔ emulator exists at: /Users/you/android/tools/emulator
info AppiumDoctor  ✔ Bin directory of $JAVA_HOME is set
info AppiumDoctor ### Diagnostic completed, one fix needed. ###
info AppiumDoctor 
info AppiumDoctor ### Manual Fixes Needed ###
info AppiumDoctor The configuration cannot be automatically fixed, please do the following first:
WARN AppiumDoctor - Please install Carthage. Visit https://github.com/Carthage/Carthage#installing-carthage for more information.
info AppiumDoctor ###
info AppiumDoctor 
info AppiumDoctor Bye! Run appium-doctor again when all manual fixes have been applied!
info AppiumDoctor 

 
Carthageの最新版は、Xcode 8.3系が必要です。

ただ、都合により手元のMacSierraにはできないため、以下を参考に古いバージョンのCarthageをインストールします。
Homebrewで過去のバージョンを使いたい - Carpe Diem

Carthage 0.23.0であれば、Xcode 8.2.1でも動作するようでした。

# ログを確認
$ brew log carthage --oneline
Warning: homebrew/core is a shallow clone so only partial output will be shown.
To get a full clone run:
  git -C "$(brew --repo homebrew/core)" fetch --unshallow
75d2a4a carthage: update 0.25.0 bottle.
4253a70 carthage 0.25.0
4a9efba carthage: update 0.24.0 bottle.
f74d9ba carthage 0.24.0
330abb7 carthage: update 0.23.0 bottle.
9e8ceb0 carthage 0.23.0
6ae4f69 carthage: update 0.22.0 bottle.
80e29a8 carthage 0.22.0
632ebc1 carthage: update 0.21.0 bottle.
2cad486 carthage 0.21.0
6d42f60 carthage: update 0.20.1 bottle.
a98dcba carthage 0.20.1
d3e71df carthage: update 0.20.0 bottle.
2a81ba5 carthage 0.20
3e8dea9 carthage: update 0.19.1 bottle.
75270e7 carthage 0.19.1
016acde gosu: update 1.14.2 bottle.

# HomebrewのFormulaディレクトリへ移動
$ cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/

# git fetch
$ git fetch --unshallow
remote: Counting objects: 290412, done.
remote: Compressing objects: 100% (128802/128802), done.
remote: Total 290412 (delta 162162), reused 287051 (delta 158817), pack-reused 0
Receiving objects: 100% (290412/290412), 69.61 MiB | 392.00 KiB/s, done.
Resolving deltas: 100% (162162/162162), completed with 3292 local objects.

# ログを再確認
$ brew log carthage --oneline | grep 0.23.0
330abb7 carthage: update 0.23.0 bottle.
9e8ceb0 carthage 0.23.0

 
ハッシュがわかったため、インストールします。

# git checkoutで戻す
$ git checkout 330abb7 carthage.rb 

# brew installでインストールする
$ brew install carthage
==> Downloading https://homebrew.bintray.com/bottles/carthage-0.23.0.el_capitan.bottle.tar.gz
######################################################################## 100.0%
==> Pouring carthage-0.23.0.el_capitan.bottle.tar.gz
==> Caveats
Bash completion has been installed to:
  /usr/local/etc/bash_completion.d

zsh completions have been installed to:
  /usr/local/share/zsh/site-functions
==> Summary
🍺  /usr/local/Cellar/carthage/0.23.0: 64 files, 22.4MB

# Carthageのバージョンを確認
$ carthage --version
Please update to the latest Carthage version: 0.25.0. You currently are on 0.23.0
Unrecognized command: '--version'. See `carthage help`.

 
インストールが終わったため、Homebrewのリポジトリを戻しておきます。

$ git reset HEAD
Unstaged changes after reset:
M   Formula/carthage.rb
$ git checkout .

 
再度確認したところ、OKそうでした。

$ appium-doctor
info AppiumDoctor Appium Doctor v.1.4.3
info AppiumDoctor ### Diagnostic starting ###
info AppiumDoctor  ✔ The Node.js binary was found at: /Users/you/.nodebrew/current/bin/node
info AppiumDoctor  ✔ Node version is 8.4.0
info AppiumDoctor  ✔ Xcode is installed at: /Applications/Xcode.app/Contents/Developer
info AppiumDoctor  ✔ Xcode Command Line Tools are installed.
info AppiumDoctor  ✔ DevToolsSecurity is enabled.
info AppiumDoctor  ✔ The Authorization DB is set up properly.
info AppiumDoctor  ✔ Carthage was found at: /usr/local/bin/carthage
info AppiumDoctor  ✔ HOME is set to: /Users/you
info AppiumDoctor  ✔ ANDROID_HOME is set to: /Users/you/android/
info AppiumDoctor  ✔ JAVA_HOME is set to: /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home
info AppiumDoctor  ✔ adb exists at: /Users/you/android/platform-tools/adb
info AppiumDoctor  ✔ android exists at: /Users/you/android/tools/android
info AppiumDoctor  ✔ emulator exists at: /Users/you/android/tools/emulator
info AppiumDoctor  ✔ Bin directory of $JAVA_HOME is set
info AppiumDoctor ### Diagnostic completed, no fix needed. ###
info AppiumDoctor 
info AppiumDoctor Everything looks good, bye!
info AppiumDoctor 

 

iOS シミュレータの準備

Xcodeを起動し、 Window > Devices より、インストール済のシミュレータ一覧を表示します。

次に左下の + ボタン > Add Simulator よりシミュレータを追加します。

項目名
Simulator Name iOS10.2 for RF
Device Type iPhone 7 Plus
OS Version iOS 10.2

 

Robot Frameworkのテストコード実装

今回はGoogleでログインボタンを押してログイン画面へと遷移するテストを書いてみます。

*** Settings ***

# Libraryは大文字小文字の区別があるようで、libraryとしてしまうとIDEが認識しない
Library  SeleniumLibrary

# テストケースごとにブラウザを閉じる
Test Teardown  close browser

*** Keywords ***
Googleのトップページでスクリーンショットを撮る
    # iOSシミュレータを使うためのDesired Capabilitiesを設定する
    # platformVersionとdeviceNameはXcodeで作成した内容を指定
    ${caps}=  create dictionary  browserName=safari  platformName=iOS  platformVersion=10.2
    ...                          deviceName=iOS10.2 for RF

    # WebDriverにはRemote、command_executorにはAppiumの待ち受けているURL、
    # desired_capabilitiesには作成したDesired Capabilitiesをそれぞれ指定
    create webdriver  Remote  command_executor=http://localhost:4723/wd/hub  desired_capabilities=${caps}

    # Googleのトップページを開く
    go to  https://www.google.co.jp/

    # スクリーンショットを撮る
    capture page screenshot  filename=result_google_top.png


*** TestCases ***

Googleのトップページに関するテスト
    [Tags]  signin
    Googleのトップページでスクリーンショットを撮る

 

テスト実行

Appiumの起動

新しいターミナルを開いて、Appiumを起動します。

$ appium
[Appium] Welcome to Appium v1.6.5
[Appium] Appium REST http interface listener started on 0.0.0.0:4723

 

テストコードの実行

RobotFrameworkのテストを実行します。初回はシミュレータが起動するまでにかなり時間がかかります。

しばらく待つと、以下のようにテストをパスします。

# RobotFrameworkを実行
# iオプションでTag指定(topというタグがついているテストのみ実行)
$ robot -i top ios.robot 
===========================================
Ios
===========================================
Googleのトップページに関するテスト  | PASS |
-------------------------------------------
Ios                             | PASS |
1 critical test, 1 passed, 0 failed

 
また、iOSシミュレータの画面のスクリーンショットが撮られ、テスト実行時のディレクトリへと保存されます。

f:id:thinkAmi:20170915221906p:plain

 

Googleで検索するテスト

Selenium > 3.3.1 & Appium 1.6.5では失敗

続いて、Androidのときと同じようにGooglePythonを検索するテストを書いてみます。

GoogleでPythonを検索してスクリーンショットを撮り、結果を出力する
    ${caps}=  create dictionary  browserName=safari  platformName=iOS  platformVersion=10.2
    ...                          deviceName=iOS10.2 for RF
    create webdriver  Remote  command_executor=http://localhost:4723/wd/hub  desired_capabilities=${caps}
    go to  https://www.google.co.jp/

    # タイトルにGoogleが含まれていることを確認する
    ${page_title} =  get title
    should contain  ${page_title}  Google

    # 検索語を入力して送信する
    input text  name=q  Python
    # Robot FrameworkではEnterキーは\\13になる
    # https://github.com/robotframework/Selenium2Library/issues/4
    press key  name=q  \\13

    # Ajax遷移のため、適当に2秒待つ
    sleep  2sec

    # タイトルにPythonが含まれていることを確認する
    ${result_title} =  get title
    should contain  ${result_title}  Python

    # スクリーンショットを撮る
    capture page screenshot  filename=result_google_python.png

    # ログを見やすくするために改行を入れる
    log to console  ${SPACE}

    # 検索結果を表示する
    @{web_elements} =  get webelements  css=h3 > a
    :for  ${web_element}  in  @{web_elements}
    \  ${text} =  get text  ${web_element}
    \  log to console  ${text}
    \  ${href} =  call method  ${web_element}  get_attribute  href
    \  log to console  ${href}

 
実行します。

$ robot -i python ios.robot 
========================================
Ios
========================================
GoogleでPythonを検索するテスト  | FAIL |
WebDriverException: Message: Parameters were incorrect. We wanted {"required":["value"]} and you sent ["text","value","id","sessionId"]
----------------------------------------
Ios                          | FAIL |
1 critical test, 0 passed, 1 failed

テストが失敗しました。

エラーメッセージで検索すると、以下のIssueがありました。
Python Selenium client incompatible with Appium server 1.6.4. · Issue #8253 · appium/appium · GitHub

SendKeyまわりに不具合があるようです。

v1.6.6には取り込まれるそうなので、その時にまた確認することにします。

もしSendKeyまわりを使う場合には、SeleniumやAppiumを古いバージョンにして使う必要がありそうです。

 

Selenium == 3.3.1 & Appium 1.6.5では成功

どのバージョンなら動くかを調べたところ、以下に情報がありました。Selenium3.3.1 にすれば良さそうです。
send_keys -> Message: Parameters were incorrect. We wanted {"required":["value"]} and you sent ["text","sessionId","id","value"] · Issue #162 · appium/python-client · GitHub

 
バージョンを切り替えます。

# seleniumだけ3.3.1、あとは同じ
$ pip list
pip (9.0.1)
robotframework (3.0.2)
robotframework-seleniumlibrary (3.0.0b1)
selenium (3.3.1)
setuptools (28.8.0)

テストを実行してみます。

$ robot -i python ios.robot 
==============================================================================
Ios                                                                           
==============================================================================
GoogleでPythonを検索するテスト                                         
Python - ウィキペディア
https://ja.m.wikipedia.org/wiki/Python
【入門者必見】Pythonとは?言語の特徴やシェア、仕事市場を徹底解説 - 侍エンジニア塾
http://www.sejuku.net/blog/7720
Python基礎講座(1 Pythonとは) - Qiita
http://qiita.com/Usek/items/ff4d87745dfc5d9b85a4
Pythonとは?何に使えるの?Pythonの特徴や使い道を…|Udemy メディア
https://udemy.benesse.co.jp/development/python.html
Python入門
http://www.tohoho-web.com/python/
初心者でもほぼ無料でPythonを勉強できるコンテンツ10選 - paiza開発日誌
http://paiza.hatenablog.com/entry/2015/04/09/%E5%88%9D%E5%BF%83%E8%80%85%E3%81%A7%E3%82%82%E3%81%BB%E3%81%BC%E7%84%A1%E6%96%99%E3%81%A7Python%E3%82%92%E5%8B%89%E5%BC%B7%E3%81%A7%E3%81%8D%E3%82%8B%E3%82%B3%E3%83%B3%E3%83%86%E3%83%B3%E3%83%8410
Python チュートリアル — Python 3.6.1 ドキュメント
https://docs.python.jp/3/tutorial/index.html
Python 3.6.1 ドキュメント
https://docs.python.jp/3/index.html
GoogleでPythonを検索するテスト                                        | PASS |
------------------------------------------------------------------------------
Ios                                                                   | PASS |
1 critical test, 1 passed, 0 failed

成功しました。

スクリーンショットも問題なく撮れています。

f:id:thinkAmi:20170915221930p:plain

 

Selenium == 3.5.0 & Appium 1.7.0では成功 (2017/9/20追記)

Appium1.7.0がリリースされていたため、インストールして試してみました。

# アップデート
$ npm install -g appium
...
+ appium@1.7.0
added 78 packages, removed 110 packages and updated 92 packages in 161.01s

# バージョンを確認
$ appium --version
1.7.0

# Python環境を確認
$ pip list
robotframework (3.0.2)
robotframework-seleniumlibrary (3.0.0b1)
selenium (3.5.0)

 
環境が整いましたので、テストを実行してみます。

$ robot -i python ios.robot 

===============================
Ios
===============================
GoogleでPythonを検索するテスト                                         
Python - ウィキペディア
https://ja.m.wikipedia.org/wiki/Python
Python基礎講座(1 Pythonとは) - Qiita
http://qiita.com/Usek/items/ff4d87745dfc5d9b85a4
【入門者必見】Pythonとは?言語の特徴やシェア、仕事市場を徹底解説 ...
http://www.sejuku.net/blog/7720
Python 3を使うべきでない場合(なんてない) | プログラミング | ...
http://postd.cc/case-python-3/
初心者でもほぼ無料でPythonを勉強できるコンテンツ10選 - paiza開発 .. ...
http://paiza.hatenablog.com/entry/2015/04/09/%E5%88%9D%E5%BF%83%E8%80%85%E3%81%A7%E3%82%82%E3%81%BB%E3%81%BC%E7%84%A1%E6%96%99%E3%81%A7Python%E3%82%92%E5%8B%89%E5%BC%B7%E3%81%A7%E3%81%8D%E3%82%8B%E3%82%B3%E3%83%B3%E3%83%86%E3%83%B3%E3%83%8410
Pythonとは?何に使えるの?Pythonの特徴や使い道を… ...
https://udemy.benesse.co.jp/development/python.html
Python入門
http://www.tohoho-web.com/python/
Python 3.6.1 ドキュメント
https://docs.python.jp/3/index.html
Python チュートリアル — Python 3.6.1 ドキュメント
https://docs.python.jp/3/tutorial/index.html
GoogleでPythonを検索するテスト                                        | PASS |

テストがPASSしました。

Appium1.7.0ではsend_keysの不具合は修正されたようです。

 

Appiumの停止

そのままではAppiumは停止しないため、 Cmd + C で停止させます。

 

ソースコード

GitHubに上げました。 selenium_appium_sample/ios.robot ファイルが今回のテストファイルです。
thinkAmi-sandbox/RobotFramework-sample: Robot Framewrok samples