简体   繁体   English

在android中进行robotium测试时如何从项目中打开另一个项目

[英]How to open another project from a project while doing robotium test in android

I need to change system language on the process of robotium test.I wrote this code in my test project of target APP and want to open morelocale to change language.我在robotium测试的过程中需要更改系统语言。我在目标APP的测试项目中编写了这段代码,并想打开morelocale来更改语言。

image图片

Intent launchIntent = getActivity().getPackageManager().getLaunchIntentForPackage("jp.co.c_lis.ccl.morelocale");
getActivity().startActivity(launchIntent);
solo.clickOnText("Custom Locale");

Morelocale can be opened but i can not click any view. Morelocale 可以打开,但我无法点击任何视图。

Exception: Text not found异常:未找到文本

Can anyone help me Or have a better solution to change system language on the test process?任何人都可以帮助我或者有更好的解决方案来更改测试过程中的系统语言吗?

Thanks in advance.提前致谢。

I have solved the problem by myself.我自己解决了这个问题。

1.We don't need to open another dependensy project from one project, just need to add the dependensy project as a library into our project. 1.我们不需要从一个项目中打开另一个dependensy项目,只需要将dependensy项目作为库添加到我们的项目中即可。

2.Make the dependensy project as a jar file and add it into our project build path. 2.将dependensy项目制作成jar文件,加入到我们的项目构建路径中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM