- ID: test_add_string_and_make_lowercase
- description: [FAST] type String, click Lower, get string back
- ID: test_add_string_and_make_uppercase
- description: [FAST] type String, click UpperCase, get STRING back
How to Prepare Appium working environment for Windows + Python
Steps
[try #1]
1. install node JS https://nodejs.org/en/
2. install Appium http://appium.io/index.html
3. install Appium Client https://pypi.python.org/pypi/Appium-Python-Client
pip install Appium-Python-Client
pip install pytest
4. have a look on sample code before creating ours
https://github.com/appium/sample-code/tree/master/sample-code/examples/python
and then ... encountering error
[try #2]
follow steps in Setup of below
https://github.com/appium/appium/blob/master/docs/en/appium-setup/running-on-windows.md
Setup
- 1. Download latest node and npm tools MSI (version >= 6.0). The
npmandnodejspaths should be in your PATH environment variable.- 2. Download latest Java JDK here (accept the license agreement first). Set 'JAVA_HOME' to be your JDK path. The
binin that directory should be added to your PATH variable.- 3. Install the Android SDK. Set
ANDROID_HOMEto be your Android SDK path and add thetoolsandplatform-toolsfolders to your PATH variable.
on Windows 10, SDK is installed in
Additional Setup for Android App TestingC:\Users\[UserName]\AppData\Local\Android\Sdk
after setting ANDROID_HOME and PATH, type "android list" to test if everything is fine
set ANDROID_HOME=C:\\Users\\[UserName]\\AppData\\Local\\Android\Sdk
set PATH=%PATH%;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools
if we want to keep this change persistently
https://shaochien.gitbooks.io/command-line-and-environment-variable-tutorial/content/environment-variable.html4. Install Apache Ant or use the one that comes with the Android Windows SDK in the eclipse\plugins folder. Be sure to add the folder containing Ant to your PATH variable.
5. Install Apache Maven and set the M2HOME and M2 environment variables. SetM2_HOMEto the directory maven is installed in, and setM2to thebinin that directory. Add the path you used forM2to your PATH.
QQ: what we use ant to do? (Apache Ant is a Java library and command-line tool that help
building software.)
QQ: what we use maven to do? (Apache Ant is a Java library and command-line tool that help building software.)
6. Open admin cmd
7. run command: npm install -g appium
8. run command: appium
9. Run a test from any Appium client (including Visual Studio)
- To run tests on Windows, you will need to have the Android Emulator
booted or an Android Device connected that is running an AVD with API
Level 17 or greater. Then run Appium on the command line (via the
appiumcommand) - Within test script, change value of 'platformVersion' to correspond with emulator version (i.e. '4.4.4')
- Within test script, change value of 'app' to PATH('path of .apk') and ensure the entire path (including close parenthesis) is on one line
Prepare Test Case
(take a look at https://github.com/appium/sample-code/blob/master/sample-code/examples/python/android_contacts.py first)
useful functions as
- find_element_by_id()
- click()
- clear()
- send_keys()
two test cases are created for demo purpose
source code and package were updated to
https://github.com/vash-hsu/appium/tree/master/01_helloworld
Reference:
https://github.com/appium/sample-codehttp://ypwalter.blogspot.tw/2015/05/appium-androidiosfirefox-os.html
http://www.qa-knowhow.com/?p=2363
沒有留言:
張貼留言