stephenwang1011 / robotium

Automatically exported from code.google.com/p/robotium
0 stars 0 forks source link

Using protected members (e.g. clicker) in Solo subclass causes "The type [...] is not visible" error #300

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

Here's an example code which reproduces this problem:

public class MySolo extends Solo {
    public MySolo(Instrumentation instrumentation, Activity activity) {
        super(instrumentation, activity);
    }

    public void clickOnSpinner(int index) {
        clicker.clickOn(Spinner.class, index);  // ERROR: The type Clicker is not visible
    }
}

What version of the product are you using? On what operating system?

robotium: 3.3

Please provide any additional information below.

This issue is related to issue 248, which suggests making some private field 
protected. In robotium 3.3, those field have been made protected, and 
subclasses can reference them. However, subclasses still can't access public 
interfaces of those type.

Similar problem was discussed in this stackoverflow question: 

http://stackoverflow.com/questions/5821546

According to it's best answer, the error is caused by using a non-public class 
in different package.
Making the class public may fix the problem.

Original issue reported on code.google.com by Frozenmo...@gmail.com on 6 Aug 2012 at 4:57

GoogleCodeExporter commented 9 years ago
Making them public is not an option. I would suggest that you download the 
source code and make your changes in there.

Original comment by renasr...@gmail.com on 7 Aug 2012 at 8:51