# Appium 1.4.13 Released

**URL:** <https://discuss.appium.io/t/appium-1-4-13-released/6258>\
**Category:** News\
**Created:** [September 28, 2015, 11:10pm UTC](https://discuss.appium.io/t/appium-1-4-13-released/6258 "2015-09-28T23:10:46Z")\
**Posts on this page:** 10\
**Page:** 3

<div class="post-metadata">

**Author:** ![Karthik\_Uppoor](https://discuss.appium.io/user_avatar/discuss.appium.io/karthik_uppoor/32/1857_2.png) [@Karthik\_Uppoor](https://discuss.appium.io/u/Karthik_Uppoor)\
**Post date:** [February 25, 2016, 2:51am UTC](https://discuss.appium.io/t/appium-1-4-13-released/6258/42 "2016-02-25T02:51:06Z")

</div>

Thank you @afwang …  
I hope it works on Ubuntu 14.04…

---

<div class="post-metadata">

**Author:** ![Karthik\_Uppoor](https://discuss.appium.io/user_avatar/discuss.appium.io/karthik_uppoor/32/1857_2.png) [@Karthik\_Uppoor](https://discuss.appium.io/u/Karthik_Uppoor)\
**Post date:** [February 25, 2016, 4:07am UTC](https://discuss.appium.io/t/appium-1-4-13-released/6258/43 "2016-02-25T04:07:43Z")

</div>

@afwang

Can you please explain me in detail, where should I write the test cases, to run on android device. Am kinda new to Appium. Explain with a simple test case (if possible).

After I run these commands :  
**npm install -g appium**  
**appium**

I am getting this :

**info: Welcome to Appium v1.4.16 (REV ae6877eff263066b26328d457bd285c0cc62430d)**  
**info: Appium REST http interface listener started on 0.0.0.0:4723**  
**info: Console LogLevel: debug**

When I visit the site **[http://0.0.0.0:4723/wd/hub/status](http://0.0.0.0:4723/wd/hub/status)** I get this on the web page:  
**{“status”:0,“value”:{“build”:{“version”:“1.4.16”,“revision”:“ae6877eff263066b26328d457bd285c0cc62430d”}}}**

and this in the terminal :  
**info: --\> GET /wd/hub/status {}**  
**info: [debug] Responding to client with success: {“status”:0,“value”:{“build”:{“version”:“1.4.16”,“revision”:“ae6877eff263066b26328d457bd285c0cc62430d”}}}**  
**info: \<-- GET /wd/hub/status 304 17.101 ms - - {“status”:0,“value”:{“build”:{“version”:“1.4.16”,“revision”:“ae6877eff263066b26328d457bd285c0cc62430d”}}}**

appium-doctor --android gives me this :

**karthik@dkarnik2-Vostro-3558:~/appiumworkspace/appium-1.4.13$ appium-doctor --android**  
**Running Android Checks**  
**✔ ANDROID\_HOME is set to "/home/karthik/selenium/android-sdk-linux"**  
**✔ JAVA\_HOME is set to "/usr/lib/jvm/java-7-openjdk-amd64."**  
**✔ ADB exists at /home/karthik/selenium/android-sdk-linux/platform-tools/adb**  
**✔ Android exists at /home/karthik/selenium/android-sdk-linux/tools/android**  
**✔ Emulator exists at /home/karthik/selenium/android-sdk-linux/tools/emulator**  
**✔ Android Checks were successful.**

**✔ All Checks were successful**  
**karthik@dkarnik2-Vostro-3558:~/appiumworkspace/appium-1.4.13$**

---

<div class="post-metadata">

**Author:** ![afwang](https://discuss.appium.io/user_avatar/discuss.appium.io/afwang/32/2419_2.png) [@afwang](https://discuss.appium.io/u/afwang)\
**Post date:** [February 25, 2016, 5:39am UTC](https://discuss.appium.io/t/appium-1-4-13-released/6258/44 "2016-02-25T05:39:19Z")

</div>

Appium works on a client-server model. Appium acts as the server, and your test cases behave as the client. If you have ever used Selenium hub before, launching a test with Appium is closely similar.

Without using a specific language, the basic steps you want to take to start a test with Appium are:

1. Instantiate an Appium driver using the “[http://0.0.0.0:4723/wd/hub](http://0.0.0.0:4723/wd/hub)” URL. If Appium is running remotely, you would use “http://(IP address of Appium’s machine):(port Appium server is listening on)/wd/hub”
2. Use the various WebDriver API commands to interact with the device.
3. End the driver session.

A quick example in Java:

```
DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability("platform", "Android");
caps.setCapability("deviceName", "Android");
caps.setCapability("app", "/path/to/apk");
AppiumDriver<MobileElement> driver = new AppiumDriver<>(new URL("http://localhost:4723/wd/hub"), caps);
//Find a TextView element on the screen
MobileElement text = driver.findElement(By.className("android.widget.TextView"));
System.out.println("TextView's text is: "+ text.getText());
//Click the text view
text.click();
//driver.tap(1, text, 1); would work as well
driver.quit(); // End the session
```

---

<div class="post-metadata">

**Author:** ![Karthik\_Uppoor](https://discuss.appium.io/user_avatar/discuss.appium.io/karthik_uppoor/32/1857_2.png) [@Karthik\_Uppoor](https://discuss.appium.io/u/Karthik_Uppoor)\
**Post date:** [February 25, 2016, 7:09am UTC](https://discuss.appium.io/t/appium-1-4-13-released/6258/45 "2016-02-25T07:09:50Z")

</div>

Do we get GUI part of Appium, like below image in linux (ubuntu 14.04) ??

 ![](https://discuss.appium.io/uploads/default/original/2X/8/8362d7a2b9500412d9efe9d420198929dbfd59a6.png)

if yes, then how ??

---

<div class="post-metadata">

**Author:** ![afwang](https://discuss.appium.io/user_avatar/discuss.appium.io/afwang/32/2419_2.png) [@afwang](https://discuss.appium.io/u/afwang)\
**Post date:** [February 25, 2016, 6:23pm UTC](https://discuss.appium.io/t/appium-1-4-13-released/6258/46 "2016-02-25T18:23:35Z")

</div>

No, the GUI version is not available for Linux systems. For my Linux systems, I install Appium using NPM, or I run it from source.

---

<div class="post-metadata">

**Author:** ![Karthik\_Uppoor](https://discuss.appium.io/user_avatar/discuss.appium.io/karthik_uppoor/32/1857_2.png) [@Karthik\_Uppoor](https://discuss.appium.io/u/Karthik_Uppoor)\
**Post date:** [February 26, 2016, 6:12am UTC](https://discuss.appium.io/t/appium-1-4-13-released/6258/47 "2016-02-26T06:12:33Z")

</div>

Hello @afwang  
Thanks a lot for helping me in setting up Appium…

**I am running this python code:**

> import os  
> import unittest  
> from appium import webdriver  
> from time import sleep
> 
> class ChessAndroidTests(unittest.TestCase):  
> “Class to run tests against the Chess Free app”  
> def setUp(self):  
> “Setup for the test”  
> desired\_caps = {}  
> desired\_caps[‘platformName’] = ‘Android’  
> desired\_caps[‘platformVersion’] = ‘4.4.2’  
> desired\_caps[‘deviceName’] = ‘karthikphone1’  
> # Returns abs path relative to this file and not cwd  
> desired\_caps[‘app’] = ‘/home/karthik/appiumworkspace/tests/uk.co.aifactory.chessfree.apk’  
> desired\_caps[‘appPackage’] = ‘uk.co.aifactory.chessfree’  
> desired\_caps[‘appActivity’] = ‘.ChessFreeActivity’  
> self.driver = webdriver.Remote(‘[http://localhost:4723/wd/hub](http://localhost:4723/wd/hub)’, desired\_caps)
> 
> ```
> def test_single_player_mode1(self):
> "Test the Single Player mode launches correctly"
> element = self.driver.find_element_by_name("PLAY!")
> element.click()
> self.driver.find_element_by_name("Continue...").click()
> 
> ```
> 
> self.driver.find\_element\_by\_name(“Single Player”).click()

> ```
> def tearDown(self):
> "Tear down the test"
> self.driver.quit()
> 
> ```
> 
> #—START OF SCRIPT  
> if \_ _name_ \_ == ‘\_ _main_ \_’:  
> suite = unittest.TestLoader().loadTestsFromTestCase(ChessAndroidTests)  
> unittest.TextTestRunner(verbosity=2).run(suite)

**I have connected my device to the notebook…**  
I get this error output ☹

> karthik@dkarnik2-Vostro-3558:~/appiumworkspace/appium-1.4.13/submodules/sample-code/examples/python$ python android\_chess.py  
> test\_single\_player\_mode1 ( **main**.ChessAndroidTests)  
> Test the Single Player mode launches correctly … ERROR

> ## ====================================================================== ERROR: test\_single\_player\_mode1 ( **main**.ChessAndroidTests) Test the Single Player mode launches correctly
> 
> Traceback (most recent call last):  
> File “android\_chess.py”, line 25, in test\_single\_player\_mode1  
> self.driver.find\_element\_by\_name(“Continue…”).click()  
> File “/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py”, line 330, in find\_element\_by\_name  
> return self.find\_element(by=By.NAME, value=name)  
> File “/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py”, line 712, in find\_element  
> {‘using’: by, ‘value’: value})[‘value’]  
> File “/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py”, line 201, in execute  
> self.error\_handler.check\_response(response)  
> File “/usr/local/lib/python2.7/dist-packages/appium/webdriver/errorhandler.py”, line 29, in check\_response  
> raise wde  
> NoSuchElementException: Message: An element could not be located on the page using the given search parameters.

> * * *
> 
> Ran 1 test in 13.961s

> FAILED (errors=1)  
> karthik@dkarnik2-Vostro-3558:~/appiumworkspace/appium-1.4.13/submodules/sample-code/examples/python$

**Here are the screenshots of the app :**

 ![](https://discuss.appium.io/uploads/default/original/2X/5/5627ad12ce21cef61be5a84853fa17b01008fd73.png) 

 ![](https://discuss.appium.io/uploads/default/original/2X/b/b02094473b03cafc030980424f90d51b621678fb.png)

It first successfully clicks on “PLAY!” button, and in the next page it was supposed to click on “Continue…” button.  
Am not able to understand, why its giving me error message…!!! (An element could not be located on the page using the given search parameters.)  
While Button named “Continue…” is actually present in the app…  
Is it trying to find button in the first page itself ??  
Help me again…

---

<div class="post-metadata">

**Author:** ![afwang](https://discuss.appium.io/user_avatar/discuss.appium.io/afwang/32/2419_2.png) [@afwang](https://discuss.appium.io/u/afwang)\
**Post date:** [February 26, 2016, 6:55am UTC](https://discuss.appium.io/t/appium-1-4-13-released/6258/48 "2016-02-26T06:55:33Z")

</div>

I’m not too sure about the details of the app you’re testing, but it looks like the screen has to go through some sort of transition after you hit “PLAY!”.

An important aspect of Appium is that it should be treated as a tool to help you build high-level, blackbox test cases. Unlike the Android Espresso framework, it will not perform any synchronization with the application under test, so if the application under test is going through a screen transition or some other operation where UI elements will not be immediately available, there will be a period of time where certain UI elements will not appear.

In your code, after you click on the PLAY! button, you immediately ask Appium to look for an element named “Continue…”. However, note that at this point, the device you’re testing on might not have finished transitioning the screen over and updated the UI hierarchy with the new layout. In this case, Appium rightfully throws a NoSuchElementException, because it did not find a Continue button while the screen is transitioning.

The solution is to add in a wait between clicking on the PLAY button and before searching for the continue button. There are a few methods of waiting when it comes to Selenium tests, but my personal favorite is to use a [WebDriverWait](https://selenium-python.readthedocs.org/waits.html?highlight=webdriverwait). You can use WebDriverWait to check for a certain condition to be true before continuing on. I’m not too well-versed in Python, but there are some common condition checks that are already prepared. They should be listed [here](https://seleniumhq.github.io/selenium/docs/api/py/webdriver_support/selenium.webdriver.support.expected_conditions.html); their names should be self-explanatory.

---

<div class="post-metadata">

**Author:** ![Karthik\_Uppoor](https://discuss.appium.io/user_avatar/discuss.appium.io/karthik_uppoor/32/1857_2.png) [@Karthik\_Uppoor](https://discuss.appium.io/u/Karthik_Uppoor)\
**Post date:** [February 26, 2016, 7:26am UTC](https://discuss.appium.io/t/appium-1-4-13-released/6258/49 "2016-02-26T07:26:28Z")

</div>

Am using this app :

[http://www.apkhotel.com/apk/844/](http://www.apkhotel.com/apk/844/)

I tried doing this :

> ```
> def test_single_player_mode1(self):
> "Test the Single Player mode launches correctly"
> element = self.driver.find_element_by_name("PLAY!")
> element.click()
> 
> ```
> 
> element = WebDriverWait(self.driver, 15).until(EC.presence\_of\_element\_located((By.NAME, “Continue…”)))  
> element.click()

I am getting this now :

> karthik@dkarnik2-Vostro-3558:~/appiumworkspace/appium-1.4.13/submodules/sample-code/examples/python$ python android\_chess.py  
> test\_single\_player\_mode1 ( **main**.ChessAndroidTests)  
> Test the Single Player mode launches correctly … ERROR

> ## ====================================================================== ERROR: test\_single\_player\_mode1 ( **main**.ChessAndroidTests) Test the Single Player mode launches correctly
> 
> Traceback (most recent call last):  
> File “android\_chess.py”, line 32, in test\_single\_player\_mode1  
> element = WebDriverWait(self.driver, 15).until(EC.presence\_of\_element\_located((By.NAME, “Continue…”)))  
> File “/usr/local/lib/python2.7/dist-packages/selenium/webdriver/support/wait.py”, line 80, in until  
> raise TimeoutException(message, screen, stacktrace)  
> TimeoutException: Message:

> * * *
> 
> Ran 1 test in 27.586s

> FAILED (errors=1)  
> karthik@dkarnik2-Vostro-3558:~/appiumworkspace/appium-1.4.13/submodules/sample-code/examples/python$

Can you please try and get the solution for this ??

---

<div class="post-metadata">

**Author:** ![Karthik\_Uppoor](https://discuss.appium.io/user_avatar/discuss.appium.io/karthik_uppoor/32/1857_2.png) [@Karthik\_Uppoor](https://discuss.appium.io/u/Karthik_Uppoor)\
**Post date:** [February 26, 2016, 10:31am UTC](https://discuss.appium.io/t/appium-1-4-13-released/6258/50 "2016-02-26T10:31:55Z")

</div>

@afwang  
I got it to work… Thanks… Those links which you sent, helped me… Thanks a lot…

---

<div class="post-metadata">

**Author:** ![Venkatesh](https://discuss.appium.io/user_avatar/discuss.appium.io/venkatesh/32/5358_2.png) [@Venkatesh](https://discuss.appium.io/u/Venkatesh)\
**Post date:** [March 9, 2016, 2:45pm UTC](https://discuss.appium.io/t/appium-1-4-13-released/6258/51 "2016-03-09T14:45:19Z")

</div>

resetApp() does not works for iOS ☹

[Previous page](https://discuss.appium.io/t/appium-1-4-13-released/6258.md?page=2)
