如何用Selenium 向CodeMirror 编辑器输入

来源:互联网 发布:window8 ftp yum 源 编辑:程序博客网 时间:2024/05/22 10:38

问题

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

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

### 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

0 0
原创粉丝点击