I want to get Current android activity context in appium
test project. There are methods to get current activity name but how to get its context (android.content.Context
)?
Asked
Active
Viewed 1,116 times
0

Brian Tompsett - 汤莱恩
- 5,753
- 72
- 57
- 129

priyanka p
- 128
- 1
- 6
-
1check this http://stackoverflow.com/a/12321393/2811956 – W I Z A R D Feb 06 '15 at 06:20
1 Answers
-1
Use this:
Set<String> contextNames = driver.getContextHandles();
for (String contextName : contextNames) {
System.out.println(contextNames);
}
This will give you all the context names.

Gaurav
- 1,332
- 11
- 22
-
1you are right this will give me the context name(string) but I want a context object(android context object that is android.content.Context) – priyanka p Feb 10 '15 at 05:26