0

I ran Selenium test and it fails on step #5, step #5 states:

assert element present: xpath=(//span[text()='France'])

But there is <span> element on the page and it contains "France" as it's content/text.

When I click on "Find target in page" (img #1) it actually highlights the element on the page, but for some reason the test case fails when I run it.

What could be the cause ?

img #1 ("Find target in page" button):

enter image description here

I'm using Selenium version 3.2.5 and firefox-dist-de-60.1.0.ESR-windows.

HTML part related to the span element looks like this:

<span id="application_label">Deutsch</span>

whatamidoingwithmylife
  • 1,119
  • 1
  • 16
  • 35

1 Answers1

1
  1. Check if element is not inside an iframe. If so, use switchTo(). How to handle iframe in Selenium WebDriver using java
  2. Page could not be loaded yet, so selenium could not detect this element. Try to use Thread.sleep(10000) just to make sure it loaded completely and then put assertion. Hope it helps!
Deryl
  • 66
  • 5