今天在用python写平台页面自动化测试代码的时候,因为textarea使用的UEditor文本框,不同于一般的输入操作,直接根据element的相关属性名找到对应元素进行用户输入模拟,为了将值通过程序模拟的方式填入UEditor中,我在官方文档中找到了这段代码:UE.getEditor('editor').execCommand('insertHtml', '页面自动化测试')'
然后用Python执行这段代码,代码示例如下:driver.execute_script('UE.getEditor(\'editor\').execCommand(\'insertHtml\', \'页面自动化测试\')')
,完美的将值填入UEditor中,但是这样执行JS使得element.submit()这句无法提交UEditor中的value。但是通过手动点击提交按钮的操作却可以提交。所以我就想用python模拟提交按钮点击提交。然后写了如下代码:
submitBtn = driver.find_element_by_class_name("anniuchengse") #审查元素password的name
submitBtn.click()
发现程序报错:selenium python Message: unknown error: Element is not clickable at point(XXX,XXX)
百思不得其解,在google上搜到了