android / android/android-test

webClick with onWebView API not working for a anchor tag element

Ouverte
#802 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Java
Étoiles
1.2k
Forks
342
Merge moyen
11 h 29 min
PR mergées (30 j)
2

Description

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

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
android, java
Domaine
mobile, testing
Type d'issue
Bug
Difficulté
3/5
Temps estimé
1-2 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.