用Selenium 自动填写Jenkins上面一个文本输入框,通过css定位很容易,但是输入文字的时候会报错

ElementNotVisibleException: Message: Element is not currently visible and so may not be interacted with

后来发现这个textarea 用CodeMirror了, google 结果如下

css_panel = driver.find_element_by_id("panel_css")

code_mirror_element = css_panel.find_element_by_css_selector(".CodeMirror")
driver.execute_script("arguments[0].CodeMirror.setValue(arguments[1]);",
code_mirror_element,
"test")

http://initcode.info/elementnotvisibleexception_message_element_is_not_currently_visiblehellip_selenium_python

http://stackoverflow.com/questions/21844574/programmatically-edit-codemirror-contents-without-access-to-object

04-16 15:17