appWaitActivity: A new session could not be created

While exploring Appium with mobile devices I hit the following error

WebDriverException: Message: u’A new session could not be created. (Original error: atpwta.live/.activity.Main never started. Current: atpwta.live/.activity.root.TournamentList)’

activity_error

Initially, I had set desired capabilities to:

desired_caps['platformName'] = 'Android'
desired_caps['platformVersion'] = '4.4'
desired_caps['deviceName'] = 'Moto E'
desired_caps['appPackage'] = 'atpwta.live'
desired_caps['appActivity'] = '.activity.Main'

After reading the appium docs I solved the issue by adding the following line.

desired_caps['appWaitActivity']= '.activity.root.TournamentList'

This time the test run was successful.
activity_run

So why did appWaitActivity help?

A simplified (but technically incorrect) way of understanding this error is that Appium was waiting for a screen name .activity.Main and timed out. The error helpfully tells you the current active screen is .activity.root.TournamentList. The desired capability appWaitActivity tells Appium what Android activity it should wait for. If you see a similar error, set your appWaitActivity to match the current activity in the error message.


Vrushali Toshniwal
My journey as a tester started at Sun Microsystems (now Oracle). I was part of the testing and sustaining team for the Portal Server and Identity Management products. My first assignment was to test the Rewriter module. I enjoyed understanding the big picture, writing test cases, finding bugs and sometimes suggesting the fix too! I was hooked onto testing. Testing felt natural and intuitive to me. I am technically inclined and can write automation in Java, C++, Perl and Python. I am well versed with SilkTest, Selenium, Appium and Selendroid. I am a Computer Science graduate from BITS-Pilani. I love travelling and listening to music.

© 2013-2017, Vrushali Toshniwal. All rights reserved.

One Comment

  1. Uma Senthil said:

    Thanks for the blog! Your tip helped to solve my problem.
    -Uma

    November 19, 2014
    Reply

Leave a Reply

Your email address will not be published.