Appium 2.0 - deeplink not working

Aperta
#1,955 6 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
30/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
android, java
Ambito
mobile

Direzione di ricerca

Inizia con il percorso di esecuzione mobile: deepLink e confrontalo con mobile: shell e con gli approcci diretti tramite ADB descritti nell’issue. Riproduci il problema su Android 12 con Appium 2.0.0-rc.3 e Java client 8.5.1, utilizzando i log forniti per identificare il problema. Il lavoro è completato quando il deep link porta alla schermata prevista oppure l’issue è stata ricondotta a una limitazione documentata della piattaforma o del driver.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Description

Not Able to navigate to deeplink, where the same code was working proper in Appium1.x
I am using mobile command mobile: deepLink for deepLink navigation and below is the code

Environment

  • Java client build version: 8.5.1
  • Appium Version: 2.0.0-rc.3
  • Node.js version: v14.18.0
  • Mobile platform/version: Android 12
  • Real device: Moto G20 Fusion

Details

Also tried below two approaches, with these also not able to navigate to the screen.

Approach - 2
  protected void navigateToScreenUsingDeepLink_2(final String argsDeepLink, final String argsPkgName) {
	Map<String, Object> args = new HashMap<>();
        args.put("command", "am");
        args.put("args", "start -W -a android.intent.action.VIEW -d \"" + argsDeepLink + "\" " + argsPkgName + "");
        args.put("timeout", 30000);
        args.put("includeStderr", true);
        Map<String, Object> result = (Map<String, Object>) getBaseDriver().executeScript("mobile: shell", args);
        log.info("DEEP-LINK STATUS " + result);
 }

### Approach - 3

protected void navigateToScreenUsingDeepLink_2(final String argsDeepLink, final String argsPkgName) {
	try {
            Process process = Runtime.getRuntime().exec("cmd /c adb shell am start -W -a android.intent.action.VIEW -d \"" + argsDeepLink + "\" " + argsPkgName + "");
            int processComplete = process.waitFor();
            if (processComplete != 0) {
                BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(process.getErrorStream()));
                String strError;
                while ((strError = bufferedReader.readLine()) != null) {
                    log.error("Error: " + strError);
                }
            }
	} catch (IOException | InterruptedException e) {
		throw new RuntimeException(e);
	}
 }

Code To Reproduce Issue [ Good To Have ]

 protected void navigateToScreenUsingDeepLink_1(final String argsDeepLink, final String argsPkgName) {
	HashMap<String, Object> map = new HashMap<>();
	map.put("url", argsDeepLink);
	map.put("package", argsPkgName);
	map.put("waitForLaunch", true);
	Map<String, Object> result = (Map<String, Object>) getBaseDriver().executeScript("mobile: deepLink", map);
	log.info("DEEP LINK RESULT " + result);
 }

Exception Stacktraces

2023-06-30 08:56:46:077 [HTTP] {"script":"mobile: deepLink","args":[{"url":"https://rblDemo.page.link/qL6j","waitForLaunch":true,"package":"com.app.demo.uat"}]}
2023-06-30 08:56:46:078 [AndroidUiautomator2Driver@f92c (e7aed20b)] Calling AppiumDriver.execute() with args: ["mobile: deepLink",[{"url":"https://rblDemo.page.link/qL6j","waitForLaunch":true,"package":"com.app.demo.uat"}],"e7aed20b-2a49-48b7-9481-1bb0914b53d4"]
2023-06-30 08:56:46:078 [AppiumDriver@e57e] Plugins which can handle cmd 'execute': images
2023-06-30 08:56:46:078 [AppiumDriver@e57e] Plugin images is now handling cmd 'execute'
2023-06-30 08:56:46:079 [AppiumDriver@e57e] Executing default handling behavior for command 'execute'
2023-06-30 08:56:46:079 [AndroidUiautomator2Driver@f92c (e7aed20b)] Executing native command 'mobile: deepLink'
2023-06-30 08:56:46:080 [ADB] Running 'D:\Software_Installed\Android\Sdk\platform-tools\adb.exe -P 5037 -s ZD2222ZKDN shell am start -W -a android.intent.action.VIEW -d https://rblDemo.page.link/qL6j com.app.demo.uat'
2023-06-30 08:56:46:631 [AndroidUiautomator2Driver@f92c (e7aed20b)] Responding to client with driver.execute() result: null
2023-06-30 08:56:46:632 [HTTP] <-- POST /wd/hub/session/e7aed20b-2a49-48b7-9481-1bb0914b53d4/execute/sync 200 555 ms - 14

Link To Appium Logs

Detailed Log: https://gist.github.com/dipakkumar1225/850f4334ce61cda6a5fbc68fb8972fd6

Lingua principale
Java
Stelle
1.3k
Fork
752
Merge medio
6g 21h
PR unite (30g)
8

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di appium/java-client

Tutte le issue di appium/java-client

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.