I swear I've searched google and SE for hours and I just couldn't find anything that applies to my case.
I've located my link using:
WebElement element = driver.findElement(By.linkText("News"));
This, however, does not return the link (<a> tag) but returns the a <span> with the linkText.
Here is how the link structure looks like:
<a href="________" itemprop="url" style="height: 88px; line-height: 88px;">
<span class="avia-bullet"></span>
<span class="avia-menu-text">News</span>
<span class="avia-menu-fx">
<span class="avia-arrow-wrap">
<span class="avia-arrow"></span>
</span>
</span>
<span class="dropdown_available"></span>
</a>
So, when I do: element.click();
, the whole browser goes down with "ElementNotInteractableException". I thought this may be time-out, but I've given it a lot of time and it still fails.
I suspect I just can't click a <span>.
But how do I refer to his parent (the <a>)?
I tried:
element=element.findElement(By.xpath("parent"));
element=element.findElement(By.xpath(".."));