URL automation test using appium Uiautomator 2 in java

I have a public URL.By click on the URL the Application will launch in the Application or browser. So how to automate that?
`package sample;

import io.appium.java_client.AppiumDriver;
import java.net.MalformedURLException;
import java.net.URL;
import java.time.Duration;

import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.support.ui.WebDriverWait;

public class Link {
static AppiumDriver driver;
public static void main(String[] args) {

try {
} catch (Exception e) {


public static void defaultLogo() throws MalformedURLException, Exception {
DesiredCapabilities cap = new DesiredCapabilities();
cap.setCapability(“deviceName”, “Galaxy A10s”);
cap.setCapability(“ubid”, “R9ANA0GCY4J”);
cap.setCapability(“platformName”, “Android”);
cap.setCapability(“platformVersion”, “11”);

  cap.setCapability("appPackage", "com.sample");
  cap.setCapability("appActivity", "com.sample.Activity");
URL url = new URL("");
WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(30));
driver = new AppiumDriver(url, cap);


You seem to be describing a ‘Deep Link’. Info here: