As you probably know, there are a lots of similarities between Selenium and Appium. As Appium is built to test all kinds of mobile apps (native, mobile web, and hybrid) it is surprisingly similar to Selenium which only works with mobile web.
Here are 4 quick steps you need to take to get your mobile website testing up and running using Appium, and naturally using real devices at Testdroid Cloud.
RUN TESTS WITH READY-MADE EXAMPLE
1. Download the Testdroid sample Appium TestScript for Chrome testdroid_chrome.py and navigate to the download directory via command line. (Make sure your machine is configured to run Python scripts. Instructions on setting up you machine can be found here.)
2. Open the TestScript testdroid_chrome.py in any text editor. Set the screenshotDir to path where you want the screenshots to be saved in at your machine, and your credentials against testdroid_username and testdroid_password Desired Capabilities. Details on all testdroid_ Desired Capabilities can be found here, but you can use default values for now.
3. Run the test script ->
$ python testdroid_chrome.py
4. The screenshots are available locally on your machine inside the directory you specified in Step 2. Continue by logging into https://new.testdroid.com and navigate to project name as defined in testdroid_project Desired Capability to get the following log files: A) Appium server log and B) Logcat/Instruments log.
EXTEND THE SAMPLE FOR RUNNING YOUR OWN TESTS
Using the sample script as a base, you can easily extend the tests for your own website.
In the Testscript find the line like:
elem = driver.find_element_by_xpath('//*[@id="xxx"]')
This is the WebDriver command that tries to find an element on the web page. We are finding elements referring them with their XPath, but you are free to use other methods as you prefer (e.g. find_element_by_id, find_element_by_name).
In addition, more information about Appium use can be found here.
‘ONE MORE THING…’
Please contact email@example.com to get the full access with Appium at Testdroid Cloud.
Learn how to do mobile web testing more efficiently and effectively and reap the benefits of it.Download