Search code examples
javaappiumselendroid

Is there any way to open url in appium driver , instead of selendroid driver while running in local android device?


  1. I am testing mobile app using appium and language as java.

  2. I will set certain parameter for app to enable advertisement using particular url, I need to load that url in local android device.

    3.So, I have loaded that url and performed click operation to enable the add.

  3. The actual behaviour of the url is, after enabling the advertisement,the url redirects to the app page.So, in that home page of an app, I will test whether the advertisement is appeared or not.

    5.From the above explained test case, I need to switch over from webdriver to appium driver.

  4. I have loaded url using web driver and I have opened app using appium driver.

  5. I have pasted the coding for reference.

  6. Is there any method in the appium to load url using android native browser, instead of using the selendroid server.

if (device.equalsIgnoreCase("android")) { DesiredCapabilities caps = DesiredCapabilities.android(); URL selendroidServerURL = new URL( "http://localhost:4444/wd/hub");

          driver = new SelendroidDriver(selendroidServerURL, caps);

Solution

  • I think you cannot use appium with android stock browser on real device. You have to use chrome. Many people have reported this issue in appium forums before. Apparently on emulator it works but not on real devices. I haven't tried it myself on stock browser using emulators. For reference check this - [https://discuss.appium.io/t/appium-starts-chrome-instead-of-stock-browser/3165/7][1]