Even i have the same issue,For me Appium gives Native as well as Webview on Emulator,But on Real device it gives just Native view.(Android device 4.4.2)
The issue happens with me, but not persistently. It happens from time to time, but I can see webviews using Appium newest release.
Not sure what is causing that inconsistent behavior though ???
I have the same issue as Mayuresh_Shirodkar, I can see the WEBVIEW on an ANDROID emulator but when I try to run the same test against a real device with the same software level and app, only the NATIVE context is found. (Android 4.4.2)
Hmm. Do you try to access the WEBVIEW context right away? Try adding a couple-second delay before requesting the webview.
Hi jonahss, Thanks for the suggestion. Yes, I have tried adding a ten second delay between opening the app and trying to access the webview but unfortunately that didn’t help. As I said, this works without any issues on an emulator running the same version of the app and the same API and software level as the real device.
I also tried upgrading to the latest version of appium (1.3 beta), I might try going to an older version and see if that helps.
I’m running into a similar issue, except I never change context because I’ve never had it work (chromedriver never connects and there’s nothing useful in the debug log). I’m stumped as to why I can still navigate and manipulate webview elements without ever changing context on nexus 5 running 4.4.2. The nexus is unlocked (I saw some info on forums claiming this “should” fix chromedriver issues, but it didn’t help me. Is this an actual requirement?)
See:
I strongly suggest against going to an older version! You’ll end up needing to update for newer features anyways.
Hey Johnass,Even I have tried adding a ten second delay between opening the app and trying to access the webview,Din’t work for me too.
Anything else that can be tried?
@Mayuresh_Shirodkar @Steve_Thompson @Tim @NDL @Antony_Barnabas @Quality_Analyst
I ran across the same issue on a real device and after trying to run Appium from the last master build, the webview was visible and it worked. Please do give it a try to run from master and let me know if it works for you too.
And please make sure that your webview is visible by assuring that:
And also try to inspect that it’s visible by seeing if Chrome remote debugger sees it.
I just tried appium 1.2.4 on a nexus 5 running both 4.4.2 and 4.4.4. The app does have the webview visible (verified by chrome remote debugger). Still no luck.
Even I am also facing same issue on 4.4.2 android device.
Has anyone got solution for this ?
Can you please tell me the procedure to run appium from master build ?
I tried with command line and went to bin folder and given command node appium. But could not able to open.
@Hassan_Radi,
Please have a look this error. I am trying on windows machine. all path and all I set but still I am getting this issue.
@Hassan_Radi,
I could able to start latest appium from source but still I am not able to see web view from here as well. Any idea ?
It is android 4.4.2
Hi, i am trying to automate Google search from device nexus 7 with 4.4.4. Below are the prerequisite.
Real device: Nexus 7 with 4.4.4
Browser: Chrome
Appium: 1.2.4.1 version
Java 1.7
Java-client 1.6.0
OS: Windows 8.1
I have written a code which open chrome, but when i am trying to switch to webview, it leads to no success. It only showing me context as “NATIVE_APP”. Whatever suggestion given in this post i have already tried, but no success. Please help me out to resolve this. Below is my code.
Code:
WebDriver driver;
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(CapabilityType.BROWSER_NAME, "Android");
capabilities.setCapability(CapabilityType.VERSION, "4.4.2");
capabilities.setCapability("platformName", "Android");
capabilities.setCapability("automationName", "Appium");
//capabilities.setCapability("appium-version", "1.2.4.1");
capabilities.setCapability("deviceName", "015d2994cc4c0618");
capabilities.setCapability("appPackage", "com.android.chrome"); // This is package name of your app (you can get it from apk info app)
capabilities.setCapability("appActivity", "com.android.chrome.Main"); // This is Launcher activity of your app (you can get it from apk info app)
driver = new AppiumDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
//here is WebElement instantiation
PageFactory.initElements(new AppiumFieldDecorator(driver), capabilities);
System.out.println(((AppiumDriver) driver).getOrientation());
//((AppiumDriver) driver).openNotifications();
System.out.println("done");
Thread.sleep(50000L);
Set<String> contextNames = ((AppiumDriver) driver).getContextHandles();
for (String contextName : contextNames) {
System.out.println(contextName);
((AppiumDriver) driver).context(contextName);
// System.out.println("it worked "+ driver.getTitle());
if (contextName.contains("WEBVIEW")){
((AppiumDriver) driver).context(contextName);
Thread.sleep(10000);
driver.findElement(By.id("sfdiv")).sendKeys("Appium");
String Text1 = driver.findElement(By.cssSelector(".module_operation_title")).getText();
System.out.println(Text1);
Thread.sleep(10000);
driver.findElement(By.cssSelector(".form_details")).click();
Thread.sleep(5000);
}
Are you sure you are using a debug version of the application?? Are you also sure you have enabled webview debugging in your app’s code like this.
Yes, I am just trying to open google site on android chrome browser, but not able to switch to google site page.
Please paste Appium log so that we can help you…