-1

I am having trouble finding the web element on a website on Internet Explorer. The link i am trying to click shows as the following in developer tools:

<A href="..\appl\trackNTraceContainers.jsp" name=ContainerLink target=ContentPane>PO Search</A>

Also shown in the picture. Image of the developer tools

I tried:

Click Link | //a[@href="../appl/trackNTraceContainers.jsp"]

but keep getting error:

Link with locator '//a[@href="../appl/trackNTraceContainers.jsp"]' not found.

I have also tried: href=../appl/trackNTraceContainers.jsp but no luck.

Any help would be appreciated

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
Jay
  • 1
  • 1
  • It seems odd that the rendered url would start with `../`. Shouldn't the browser have resolved the relative url and translated it into whatever the actual url is? – John Gordon Jun 10 '19 at 15:31
  • I was wondering the same. It hasn't. When i double click on it, it copies as it is. – Jay Jun 11 '19 at 09:25

1 Answers1

1

It looks like you're looking for a link with an href with forward slashes, but the actual href has backslashes. Even though this looks like a filename, and on windows a forward slash and backslash are essentially the same thing, all selenium sees is characters, not filenames. \ and / are not equivalent when looking at the attribute as a string of characters.

Your code should work if you search for exactly what is in the element. You will need to escape the backslash since robot will see a single backslash as an escape character:

Click Link | //a[@href="..\\appl\\trackNTraceContainers.jsp"]
Bryan Oakley
  • 370,779
  • 53
  • 539
  • 685