Benjamin Ruan
Benjamin Ruan

Reputation: 81

Access link by url which is javascript using selenium

<a href="javascript:OuvrirService('S00436','F');"><span>Rechercher une entreprise au registre</span></a>

I got problem accessing links like this one the url of which is javascript. I'm using selenium InternetExplorerDriver and I've to access the link by its url because there are other links on the same page that has the same link text name and the link doesn't have any other attributes.

Does anyone know the reason of this problem? Or are there other ways to access the link?

Well the problem is that selenium can't find the link. It works correctly for links which have normal url.

Upvotes: 2

Views: 77

Answers (1)

EGHM
EGHM

Reputation: 2140

I've had similar issue, I resolved it by creating a locator to find the span in the anchor and click on that.

Upvotes: 1

Related Questions