Debugging “Element is not clickable at point” error

后端 未结 30 2168
余生分开走
余生分开走 2020-11-21 23:55

I see this only in Chrome.

The full error message reads:

\"org.openqa.selenium.WebDriverException: Element is not clickable at point (411, 675

30条回答
  •  星月不相逢
    2020-11-22 00:19

    I do a kind of brute force of clicks and it works for me.

    try:
        elem.click()
    except:
        print "failed to click"
        size = elem.size
        mid_of_y = int(size["height"])/2
        stepts_to_do_to_left = int(size["width"])
        while stepts_to_do_to_left > 0:
            try:
                print stepts_to_do_to_left, mid_of_y
                action = webdriver.common.action_chains.ActionChains(driver)
                action.move_to_element_with_offset(elem, mid_of_y, stepts_to_do_to_left)
                action.click()
                action.perform()
                print "DONE CLICK"
                break
            except:
                pass
    

提交回复
热议问题