Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can Solo work when using in external class #124

Closed
renas opened this issue Aug 19, 2015 · 4 comments
Closed

How can Solo work when using in external class #124

renas opened this issue Aug 19, 2015 · 4 comments

Comments

@renas
Copy link
Contributor

renas commented Aug 19, 2015

From entrang2...@gmail.com on December 14, 2010 01:59:01

Create a common class such as "common.java" with using solo to do something.

In the test case class there is a test case with call a method which using solo from the "common.java" class.

However, it does not work when running this test because it's does not recognize the solo.

Please help me to solve this problem.
It's appreciate if there is any example.

Thank so much.
Hakuen

Original issue: http://code.google.com/p/robotium/issues/detail?id=45

@renas
Copy link
Contributor Author

renas commented Aug 19, 2015

From renasr...@gmail.com on December 14, 2010 02:02:18

Owner: renasreda
Labels: -Type-Defect Type-Other

@renas
Copy link
Contributor Author

renas commented Aug 19, 2015

From anandpai...@gmail.com on December 14, 2010 03:41:37

u should pass the solo object or u have to create solo object in your Common.java

Example:

tescase.java has your test method

msolo = Solo(getInstrumentation(), getActivity());

test1() {
Common.clickontext(solo,text);
}

Common.java should contain.

public static void clickontext(Solo solo,String text) {
solo.clickOnText(text);
}

@renas
Copy link
Contributor Author

renas commented Aug 19, 2015

From renasr...@gmail.com on December 16, 2010 07:53:59

Please see above answer.

Status: Done

@renas
Copy link
Contributor Author

renas commented Aug 19, 2015

From kpsrika...@gmail.com on November 24, 2011 02:17:20

I did write my tests as suggested by Anand. In the above scenario let's say I have created a bunch of methods in Common.java and also I created multiple classes similar to Common.java which provide different reusable functionality.
Each time I invoke a method in Common.java or other classes I am passing solo object(from testcase.java), instead is there a way to create a solo object in Common.java.
Anand did mention that this can be done but an example/suggestion would be great.

@renas renas closed this as completed Aug 19, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant