-1

Used Below configuration to launch Samsung Internet browser....

DesiredCapabilities capabilities = DesiredCapabilities.android();           
capabilities.setCapability("appPackage","com.sec.android.app.sbrowser");    
capabilities.setCapability("appActivity","com.sec.android.app.sbrowser.SBrowserMainActivity");  
capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, "Android");
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "my phone");
capabilities.setCapability(MobileCapabilityType.VERSION, "8.1.0");
URL mobile_url = new URL("http://127.0.0.1:4723/wd/hub");
driver = new AndroidDriver(mobile_url, capabilities);
driver.get(url);
  1. Samsung default browser is lauching successfully, but shows Skip / Next button - these button navigates to browser page enter image description here
  2. elements not able interact (like click, sendkeys) enter image description here Please help me to solve these problems.

1 Answers1

-1

Launch the browser by adding below capability capabilities.setCapability(MobileCapabilityType.BROWSER_NAME, "Browser");

Remove appPackage and appActivity

Inspect the screen using chrome remote debugger as shown in below screenshot enter image description here

Appium docs showing when browserName is 'Browser' it will launch default browser or native browser for Android

enter image description here

Amit Jain
  • 4,389
  • 2
  • 18
  • 21
  • i want to automate samsung internet browser, not for chrome. – Manjunatha.N Sep 11 '18 at 04:25
  • MobileCapabilityType.BROWSER_NAME, "Browser" will launch default browser of the mobile which would be company browser... More over launching a browser as an app is not correct way of testing a webapp. – Amit Jain Sep 11 '18 at 06:05
  • 1
    I have used below code ... DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability(MobileCapabilityType.BROWSER_NAME, "Browser"); capabilities.setCapability(MobileCapabilityType.AUTO_WEBVIEW,"true"); capabilities.setCapability("deviceName", "Samsung");capabilities.setCapability("platformName", "Android"); capabilities.setCapability("platformVersion", "6.0.1"); AppiumDriver driver = new AppiumDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities); error: Original error: Could not find package com.android.browser on the device – Manjunatha.N Sep 11 '18 at 13:27
  • @Manjunatha.N have found the answer to your question? – eirenikos Nov 13 '18 at 11:08