0

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)?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
priyanka p
  • 128
  • 1
  • 6

1 Answers1

-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
  • 1
    you 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