android / android/android-test

webClick with onWebView API not working for a anchor tag element

Aperta
#802 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Java
Stelle
1.2k
Fork
342
Merge medio
11h 29m
PR unite (30g)
2

Descrizione

### Description

- Currently working a test case which initiates a click on an anchor tag with href. Using the XPATH which points to the anchor tag and then performing the webclick. This is not working as of now. Verified the XPATH to get the text associated, which was correct as same as the text of anchor tag.
- Tried using the XPATH, CSS selector and a JavaScript(Which works on chrome console).

### Steps to Reproduce
get an HTML page which holds an Anchor tag Link To Google Try to get the XPATH. Use below code.

onWebView().withElement(findElement(Locator.XPATH, "PATH to Anchor ")).perform(webClick())
### Expected Results
- Initiate the click and open the link in web view as suggested by target
### Actual Results
- No action performed or error thrown.
### AndroidX Test and Android OS Versions
Espresso-web - 3.1.0
Android OS API 28
Espresso version - '3.3.0'
### Link to a public git repo demonstrating the problem:
https://stackoverflow.com/questions/64827652/how-can-we-click-on-html-anchor-with-href-using-android-espresso-webview-library

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Start with the provided onWebView().withElement(...).perform(webClick()) reproduction and the Espresso-web webClick API. Verify the behavior against an anchor element with an href on Android API 28, then add or update a regression test if the relevant test location can be identified. Done means the anchor click opens its target in the WebView without an error.

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

Valutazione

Stack tecnologico
android, java
Ambito
mobile, testing
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.