Appium problems encountered

Source: Internet
Author: User

Learning Appium, encountering a new session could not being created. Problem


Paste_image.png Question one:

The first Test application for the mobile phone system comes with the calculator application, the test encountered the above problems, found a lot of information, and finally found that the problem lies:

 @BeforeClass public void Setup () throws Exception {desiredcapabilities cap = new Desiredcapabilities (); Cap.setcapability (Capabilitytype.browser_name, ""); Cap.setcapability ("PlatformName", "Android"); Cap.setcapability ("DeviceName", "71mbblg26r76"); Cap.setcapability ("Platformversion", "5.1"); This specifies the package name and the specific activity cap.setcapability ("Apppackage", "Com.meizu.flyme.calculator"); Cap.setcapability ("Appactivity", "Com.meizu.flyme.calculator.Calculator"); #重点所在 (Resolve session Cannot create problem)//////////////////////////////////////////////////////////////////cap.setcapability ( "Appwaitactivity", "Com.meizu.flyme.calculator.Calculator"); You want to wait for the startup activity name Cap.setcapability ("Sessionoverride", true); Overwrite session at each boot, otherwise the second run will be an error. Cannot create a new session///////////////////////////////////////////////////////////////////// Driver = new Androiddriver (New URL ("Http://127.0.0.1:4723/wd/hub"), cap); }
Solution One:

We just need to add the two lines of code listed above when we configure the APK to solve the problem.

Question two:

The above test object is the mobile phone system with the application, but I do not know that some of the application of the page is not to be used by other applications, testing again I fell out of the hole again-the above problem, A new session could not be created.

Solution Two:

Programme says:
is related to the Androidmanifest.xml configuration file, immediately Baidu this configuration file exactly what the role is. Finally, find the Android developer in the Androidmanifest.xml profile, added at main activity and intent entrance: android:exported= "true"


Paste_image.png

Problem solved immediately, finally can launch the app!

I am a small white, if there is a problem, a lot of advice.



by Xiao Jie
Links: http://www.jianshu.com/p/9f8a7d5b5166
Source: Pinterest
Copyright belongs to the author. Commercial reprint please contact the author for authorization, non-commercial reprint please specify the source.

Appium problems encountered

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.