Selenium
文章平均质量分 83
橘子日志
这个作者很懒,什么都没留下…
展开
-
selenium03
如果报1045-Access denied for user 'root'@'localhost'错误,需要打开DOS窗口,切换到C:\xampp\mysql\bin,2.如果Apache服务启动失败,修改C:\xampp\apache\conf\httpd.conf 里面的端口(默认为80,假设改为8000),刷新授权,之后重启mysql服务(win需要到任务器才能彻底关闭)7.连接mysql时,如果报1130错误,需要在C:\xampp\mysql\bin\my.ini 里面,原创 2023-10-30 20:43:06 · 23 阅读 · 0 评论 -
selenium02
引入数据(如{"name":"tom","expectCode":"0"})的所有变量名name、expectCode都要放在testCase()里面,单条数据如@ddt.data({"name":"juzi","resultCode":"0"})多条数据如@ddt.data({"name":"juzi","resultCode":"0"},# 2.使用 globals()["变量名"],如 globals()["name"] = "全局变量2"2.使用缩进表示层级关系,缩进不允许使用Tab键,只能空格。原创 2023-10-30 20:42:28 · 21 阅读 · 0 评论 -
selenium01
inputBox7 = '$("span.bg.s_ipt_wr>input:nth-of-type(1)").val("自动化测试7");' # 找到第1个input。# inputBox7 = '$("span.bg>input#kw:nth-of-type(1)").val("自动化测试7");' # 找到第1个input。2).根据元素的多个属性定位:find_element_by_xpath('//*[@name="wd" and @class="s_ipt"]')' # 找到第2个元素。原创 2023-10-30 20:41:34 · 47 阅读 · 0 评论