android / android/android-test

webClick with onWebView API not working for a anchor tag element

Offen
#802 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Java
Sterne
1.2k
Forks
342
Ø Merge
11 Std. 29 Min.
Gemergte PRs (30 T.)
2

Beschreibung

### 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

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
android, java
Bereich
mobile, testing
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.