Question

I've an apk to be tested using Robotium. In the application I'm going to test there is a custom view(Window) on which there are some text and numeric parameters drawn using ownerDrawn and Paint. The custom view is a child of the relative layout. Since I'm not able to get the resource id of either the custom view(window) or the parameters drawn on it,I'm finding it hard to test the existance of parameters on that view. Please help me out with a solution on how would I do that.

Thanks

Custom View is as shown here:

CustomView

Was it helpful?

Solution

Sadly you are likely to continue to be out of luck. You could get hold of the custome view by casting the view above it in the heirarchy to a view group and getting the child. The custom view though is unlikely to have the information you want. Android and Robotium will not know any details about it other than its view type.

What you can do though is get developers to give you this information via tags. E.g. if it contains the text "hello world" they could also set a tag on that view which would allow you to get the text from it. This sounds like it might not be possible in your situatuion.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top