Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in DevOps and Agile by (19.7k points)

I try to scrape this site by Selenium.

I want to click on the "Next Page" button, for this I do:

 driver.find_element_by_class_name('pagination-r').click()

it works for many pages but not for all, I got this error

WebDriverException: Message: Element is not clickable at point (918, 13). Other element would receive the click: <div class="linkAuchan"></div>

always for this page

I read this question

and I tried this

driver.implicitly_wait(10)

el = driver.find_element_by_class_name('pagination-r')

action = webdriver.common.action_chains.ActionChains(driver)

action.move_to_element_with_offset(el, 918, 13)

action.click()

action.perform()

but I got the same error

1 Answer

0 votes
by (62.9k points)

There are 3 possible solutions for this: 

1. Use Actions() method

WebElement element = driver.findElement(By("element_path"));

Actions actions = new Actions(driver);

actions.moveToElement(element).click().perform();

2. Before the click is performed let the page load completely using Waits 

driver.manage().timeouts().implicitlywait(15 TimeUnit.seconds)

3. Because of a Spinner/Overlay on top of it, the element is not clickable:

By loadingImage = By.id("loading image ID");

WebDriverWait wait = new WebDriverWait(driver, timeOutInSeconds);

wait.until(ExpectedConditions.invisibilityOfElementLocated(loadingImage));

Hope this helps!

If you are interested to learn Selenium on a much deeper level and want to become a professional in the testing domain, check out Intellipaat’s online automation testing training!

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...