Using Espresso to click on a webview with href

Viewed 436

I have an html webpage which has a link something as follows.

<a id='click_link' href='path_to_page.html' target='_blank'>Click</a>

Using espresso I want to check if the link works from the Android webview. I used all the following method and also the XPATH link to click it from Android Espresso. Nothing works.

onWebView().withElement(findElement(Locator.LINK_TEXT,"Click")).perform(webScrollIntoView());

onWebView().withElement(findElement(Locator.ID,"click_link")).perform(webClick());

But if I remove the target='_blank', then it works. Is there any way to fix it from Espresso. I want the target='_blank' there.

0 Answers
Related