<a class="menu-item js-add-to-basket pizzaAddDefault js-change-ingredients js-add-pizza-to-basket" id="ph-add-to-basket-61504822" data-id="61504822" upsell-id="" href="/amrest-pizzahut/products#category/pizza" style="height: auto;">
<div class="ph-order-on-preview">
<button class="btn btn--primary">Zamów online</button>
</div>
<div id="ph-add-to-basket-61504822" class="box-counter ph-product-in-basket hidden" data-id="61504822">
<span class="ph-products-in-basket-number">0</span>
</div>
<div class="menu-item__content">
<h5>
<!--
<div class="ph-menu-favorite js-favourite" sec:authorize="!isAnonymous()">
<img th:src="@{/images/favourite-unchecked.png}" class="unchecked" alt="Nie ulubiona" />
</div>
-->
VEGE DELUX
</h5>
<p>
37,99 PLN
</p>
<p class="menu-item__description"></p>
</div>
<div class="menu-item__image">
<img src="https://ocs-pl.oktawave.com/v1/AUTH_876e5729-f8dd-45dd-908f-35d8bb716177/amrest-web-ordering/GRD4/GRD4590/Smaki%20Premium/Pizza_vege_medium_450x450.png" alt="VEGE DELUX">
</div>
</a>
Above there's code from my site, i need to move mouse button on this class, and next press 'zamów online' button
I have following locators for this item:
@FindBy (css="#ph-add-to-basket-61504822") WebElement firstpizza;
@FindBy (css="#ph-add-to-basket-61504822 .ph-order-on-preview button") WebElement pizzabutton;
and functions
public void clickPizzaBasket() {
Actions action = new Actions(driver);
action.moveToElement(firstpizza);
System.out.print("moved");
pizzabutton.click();
}
executing this function i get org.openqa.selenium.ElementNotVisibleException: element not visible on pizzabutton.click() line
In which way i should access to 'zamów online' buttons?
