Selenium Web Driver & Java. Element is not clickable at point (x, y). Other element would receive the click

前端 未结 8 1488
北恋
北恋 2020-11-21 04:08

I used explicit waits and I have the warning:

org.openqa.selenium.WebDriverException: Element is not clickable at point (36, 72). Other element wou

8条回答
  •  失恋的感觉
    2020-11-21 04:56

    Scrolling the page to the near by point mentioned in the exception did the trick for me. Below is code snippet:

    $wd_host = 'http://localhost:4444/wd/hub';
    $capabilities =
        [
            \WebDriverCapabilityType::BROWSER_NAME => 'chrome',
            \WebDriverCapabilityType::PROXY => [
                'proxyType' => 'manual',
                'httpProxy' => PROXY_DOMAIN.':'.PROXY_PORT,
                'sslProxy' => PROXY_DOMAIN.':'.PROXY_PORT,
                'noProxy' =>  PROXY_EXCEPTION // to run locally
            ],
        ];
    $webDriver = \RemoteWebDriver::create($wd_host, $capabilities, 250000, 250000);
    ...........
    ...........
    // Wait for 3 seconds
    $webDriver->wait(3);
    // Scrolls the page vertically by 70 pixels 
    $webDriver->executeScript("window.scrollTo(0, 70);");
    

    NOTE: I use Facebook php webdriver

提交回复
热议问题