I am getting "element not interactable exception" while trying to click the shopping cart link. Code below.
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
public class American_golf {
public static void main(String[] args) {
ChromeOptions opts=new ChromeOptions();
opts.addArguments("--disable--notifications");
ChromeDriver driver=new ChromeDriver(opts);
driver.get("https://www.americangolf.co.uk/");
driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);
WebElement element=driver.findElement(By.cssSelector(".header-top-right .header-minicart-link"));
element.click();
}
}
From other queries, I figured out we need to use the Options class. Not getting the output still. How do I properly use Options here?
Thanks in advance.
Instructor
Ashish Thakur Replied on 16/12/2019
Use a different locator
or locator startergy
you can try xpath or alternate css selector
Please let me know if the attached code is good, or is there a better way?
Code looks to be good.. Try diff locator or xpath to get the exact element..
Instructor
Ashish Thakur Replied on 17/01/2020
Is the issue resolved?
I am in some other module. You could close it. I will raise a request again if needed.