selenium 报错记录
1、Element is not clickable at point (x, x). Other element would receive the click
这里是因为selenium 元素没有出现在当前页面上,一般是需要划一下滚动条就可以看见,如果元素出现在滚动条滑动到底部才能看见的位置,建议用下面的方法
调用JS 原生的API :在要点击的元素前加上driver.execute_script(“window.scrollTo(0, document.body.scrollHeight);”)语句,就没问题了
引用链接:https://www.cnblogs.com/saryli/p/4459671.html
2、生成当前时间+ 其他字符串
import time
t = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
driver.find_element_by_id(“title”).send_keys(u"这是测试标题5", t)
另外:
selenium常见异常:
1.NoSuchElementException:没有找到元素
2.NoSuchFrameException:没有找到iframe
3.NoSuchWindowException:没找到窗口句柄handle
4.NoSuchAttributeException:属性错误
5.NoAlertPresentException:没找到alert弹出框
6.lementNotVisibleException:元素不可见
7.ElementNotSelectableException:元素没有被选中
8.TimeoutException:查找元素超时