American Golf Shopping Cart | Selenium Forum
A
Anjali C Posted on 14/12/2019

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.


A
Ashish Thakur Replied on 16/12/2019

Use a different locator

or locator startergy

you can try xpath or alternate css selector


A
Anjali C Replied on 17/12/2019

Please let me know if the attached code is good, or is there a better way?


A
Ashish Replied on 18/12/2019

Code looks to be good.. Try diff locator or xpath to get the exact element.. 


A
Ashish Thakur Replied on 17/01/2020

Is the issue resolved?


A
Anjali C Replied on 17/01/2020

I am in some other module. You could close it. I will raise a request again if needed.


Related Posts