Trying to select a dropdown and select an item from the list.
Here is the dom for the dropdown.
<li id="nav-galleries" class="dropdown header-dropdown hidden-xs hidden-sm">
<a class="dropdown-toggle"
href="//www.xxxx/" data-toggle="dropdown"
title="Trending Now">
<span class="nav-text"> Trending Now </span>
<b class="caret"></b>
this is the code for the 'button' or 'link' that I am trying to hit.
<a href="/xxxxxx/members/content/videos/"> Videos </a>
I have the hover part done correctly. I can show the list and the items inside of it. When i try to do a click it usually tells the Element is not visible.
This is my code to try and click inside of it. It clicks on a link but it seems to just click on the middle of the dropdown, not on a specific array.
$action->moveToElement($this->webDriver->findElement(WebDriverBy::cssSelector('#nav-galleries')))->perform();
$dropdown = $this->webDriver->findElements(WebDriverBy::cssSelector('#nav-galleries .dropdown-menu'))[0];
$dropdown->click();
When i try to change the click on the array, I'm met with Element not visible.
I've even tried some javascript to do the hover, which it does, yet i'm still met with element not visible when I try to select an option in the drop down.
$this->webDriver->executeScript("document.getElementsByClassName('dropdown-menu')[0].style.display='list-item'");
Any advice would be appreciated.