Why does the Selenium Firefox Driver consider my modal not displayed when the parent has overflow:hidden?

前端 未结 1 807
傲寒
傲寒 2020-12-18 05:57

EDIT: I think there is an issue open on this already: http://code.google.com/p/selenium/issues/detail?id=5717

So basically I\'m using the Firefox Driver and the div

相关标签:
1条回答
  • 2020-12-18 06:27

    According to the Selenium WebDriver source code, an element must not have overflow: hidden as a style. (ref) (UPDATE I just realized that the maintainers have updated the code in the ref I linked to, but that the original 2.33 code did include the overflow: hidden check. Its just been refactored for presumable 2.34.)

    So, it looks like unless the maintainers decide against this, you are SOL. But the first step to getting the maintainers to notice the issue is to add an Issue to the official repository, which it looks like you have done.

    One possible solution in the meantime if you can't get you developers to help you is to use Javascript to remove the overflow attribute:

    driver.executeScript("arguments[0].setAttribute('style', 'overflow: none;')", page_content_element)

    And try to run your tests from there.

    0 讨论(0)
提交回复
热议问题