Description: Find out the DDL in Treegrid, but cannot click on it.Because the element is under a hidden element. Have tried all below solutions: 1) theDDL.click(); 2) SeleniumUtil.jsClick(driver, theDDL); 3) Actions action = new Actions(driver); acti…
btnLogin.click();     //Click element SeleniumUtil.jsClick(driver, saveButtonEl);     //If click()  is not applicable ,try this one txtEmail.clear();     //Clear text box before send keys to it txtEmail.sendKeys(“jenny.zhang@morningstar.com”);     //…
有时候循环点击一列链接,只能点到第一个,第二个就失败了 原因是第二个已经是新页面,当然找不到之前页面的元素.就算是后退回来的,页面也是不一样的 页面长的一样不一定是同一张页面,就像两个人长的一样不一定是同一个人,他们的身份证号不同,页面,甚至页面上的元素都是有自己的身份证号(id)的 from selenium import webdriver driver = webdriver.Chrome() driver.get('http://www.baidu.com') print(driver.…
抓取网页代码后,由于是在同一个li标签下,所以使用一次性抓取,所有的a标签,然后循环做不同的操作,但是抛出找不到元素异常. def office_page(_chrome: Chrome): sn = '官网首页' _xpath = '//li[@class="scNav_Item"]/a' sc_nav_list = _chrome.driver.find_elements_by_xpath('//li[@class="scNav_Item"]/a') print…
org.openqa.selenium.NoSuchElementException: no such element: Unable to locate element(识别不到想要的元素) 想获取到收件箱中包含坚果云的字段  此处遇见的问题,网页中想要识别的元素在iframe框中,于是不能直接: driver.findElement(By.id("img_out_995536807")).click();需要先识别frame,然后再找元素: driver.switchTo().fr…
用到了 select2 组件来多选收件人,用搜狗浏览器(6.2版高速模式)在执行到如下这句时报错(Uncaught InvalidStateError: Failed to read the 'selectionDirection' property from 'HTMLInputElement': The input element's type ('hidden') does not support selection.),6.3版高速和兼容模式都没问题. var recipients =…
定位网页上某个按钮时,总是报错元素定位不到,具体如下:NoSuchElementException: Message: no such element: Unable to locate element 改了好几种写法,最终直接用 xpath helper 里获取的内容填充进去,还是报错,瞬间领悟了,原来不是 xpath 的问题,是因为脚本执行到这一行代码时,对应页面上的元素还没加载完成, 导致定位不到,需要设置等待时间,举个简单的例子: #coding:utf-8from selenium i…
记录在使用selenium过程中踩的坑------ 在使用selenium时,用click点击网站弹出的文件上传框的"上传文件"按钮不生效,报错selenium.common.exceptions.InvalidArgumentException log如下: test_xxxxxx.py::test_xxxxxxx FAILED [100%]Traceback (most recent call last): File "F:\xxxxxxxx\page\BasePage.…
之前使用selenium-webdriver来写UI的自动化脚本,发现有一个元素一直无法定位,查看其源码,如下 利用xpathChecker验证了xpath语句的是正确的,但是控制台一直报错: no such element: Unable to locate element: {"method":"xpath","selector":"xpath"} 后面仔细看了一下,我定位的页面重新开了一个iframe,所以在百度上查找了…
IE8报错误: 用户代理: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET4.0C; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0E)时间戳: Mon, 13 Oct 2014 00:54:55 UTC 消息: HTML P…