1. jsclick 也不管用

Actions action = new Actions(driver);
WebElement theRow = page.getInvisibleElement();
action.moveToElement(theRow).perform();
page.getInvisibleElement().click(); 或page.getInvisibleElement().click();再获取一遍theRow

2.Issue : Cannot get text of a hidden element, SeleniumUtil. scrollIntoView(element) also doesn’t work for the element

Solution :  JavaScript to get the text of hidden element.

Code :

WebElement tickerEl = el.findElement(By.cssSelector("td.auto-left"));

String tickerName = (String) ((JavascriptExecutor) driver).executeScript("return jQuery(arguments[0]).text();", tickerEl);

String tickTmp =StringUtils.trim(tickerName);

logger.info("Ticker : "+tickTmp);

3.Issue : Search function doesn't work sometime after we input the search condition, I guess it may cause by the realization method, the UI may only check the search condition each period of time,

If the input miss the check,  we need to input again

Solution : If the drop down list doesn’t display the first time after inputting search condition, clear it and input the search condition again

4.Issue : Cannot get text of the columns which doesn’t show out, we need to drag the scroll bar to make it display when do testing manually.

Solution :  Use SeleniumUtil.scrollIntoView(driver, el);

Code :

for (WebElement el : columns) {

if(!(el.isDisplayed())){

SeleniumUtil.scrollIntoView(driver, el);

}

logger.info("Column : " + el.getText());

… …

}

5.问题:元素定位方法没有错,但却定位不到元素

解决方法:发现网页有2个frame,需要定位的元素在左侧frame中,需要先跳转到左边的frame

代码:

6.问题:“确认”按钮通过class name或 css定位不到

解决方法:

通过xpath 定位,再点击

[Selenium] Selenium 疑难杂症的更多相关文章

  1. Python selenium —— selenium与自动化测试成神之路

    From: https://blog.csdn.net/huilan_same/article/details/52559711 忽然想谈谈自动化的学习路径,因为发现很多人总是急于求成,不懂该如何学习 ...

  2. ubuntu 安装 selenium selenium操作 chrome

    重装虚拟机,好多包需要重装,sele这个记得当时就找了好久的完整重装方法,这次又找了好久,,,省的下次再这样,记录下来..... ubuntu16.04 4安装seleniumsudo pip ins ...

  3. 跟浩哥学自动化测试Selenium -- Selenium简介 (1)

    Selenium 简介 Selenium 是一款开源的web自动化测试工具,用来模拟对浏览器的操作(主要是对页面元素的操作),简单来讲,其实就是一个jar包.Selenium早期的版本比如1.0市场占 ...

  4. selenium===selenium自动化添加日志(转)

    本文转自 selenium自动化添加日志 于logging日志的介绍,主要有两大功能,一个是控制台的输出,一个是保存到本地文件 先封装logging模块,保存到common文件夹命名为logger.p ...

  5. python + selenium - selenium简介

    1. 产品简介 selenium 是 基于 web网页的UI自动化测试框架. 1)支持多浏览器操作:ie.chrome.firefox.edge.safaria等 2)跨平台:windows.linu ...

  6. [Selenium] Selenium WebDriver 的下载和安装

    为配合较为广泛使用Java 语言的程序员,仅以WebDriver 的Java语言绑定进行讲解. 步骤1:下载并安装Java开发环境 1)在系统中安装JDK(Java开发工具吧,Java Develop ...

  7. [Selenium] Selenium find Element Examples

    ---> 1. By.id  以百度主页为例 <span classs = "bg s_ipt_wr"> <input type = "text& ...

  8. <selenium>selenium基础操作

    from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.c ...

  9. python + selenium - selenium常用元素定位

    1. Chrome定位工具 打开Chrome浏览器,按F12会弹出开发者工具选项,选择Elements: 1)鼠标点击最左边箭头 2)鼠标滑动到页面中你要操作的元素,单击一下 3)对应的html元素内 ...

随机推荐

  1. (7)ASP.NET WEB服务器控件

    1. <body> <form id="form1" runat="server"> <div> <asp:Label ...

  2. Paul Graham:梦寐以求的编程语言

    我的朋友曾对一位著名的操作系统专家说他想要设计一种真正优秀的编程语言.那位专家回答,这是浪费时间,优秀的语言不一定会被市场接受,很可能无人使用,因为语言的流行不取决于它本身.至少,那位专家设计的语言就 ...

  3. 洛谷P2058 仪仗队

    P2058 仪仗队 24通过 34提交 题目提供者shengmingkexue 标签数论(数学相关) 难度普及+/提高 提交该题 讨论 题解 记录 最新讨论 暂时没有讨论 题目描述 作为体育委员,C君 ...

  4. 某考试 T1 line

    状压dp+矩阵转移,据说正解是dfs出的合法状态,,但难道不是三个for就行了吗2333 #include<iostream> #include<cmath> #include ...

  5. Linux配置防火墙添加端口(Ubuntu/Debian无法使用此方法)

    注意:Ubuntu/Debian无法使用此方法 1.打开iptables vi /etc/sysconfig/iptables 2.添加防火墙规则 规则参考:http://www.cnblogs.co ...

  6. 【powerdesign】从mysql数据库导出到powerdesign,生成数据字典

    使用版本powerdesign16.5,mysql 5.5,windows 64 =========================================================== ...

  7. METEOR_PACKAGE_DIRS 无效

    windows中设置METEOR_PACKAGE_DIRS不起作用,一直提示找不到PACKAGES的原因. METEOR_PACKAGE_DIRS设置的路径太长了. 在系统属性 -->高级--& ...

  8. ScSPM

    Linear Spatial Pyramid Matching using Sparse Coding for Image Classification (CVPR'09) 稀疏编码系列: (一)-- ...

  9. 微信小程序 - 音频播放(1.2版本和1.2版本之后)

    不多说了,直接贴code // 1.2版本以后便不在维护 wx.getBackgroundAudioManager({ success:function(res){ var status =res.s ...

  10. AppCan移动应用开发平台新增9个超有用插件(内含演示样例代码)

    使用AppCan平台进行移动开发.你所须要具备的是Html5+CSS +JS前端语言基础.此外.Hybrid混合模式应用还需结合原生语言对功能模块进行封装,对于没有原生基础的开发人员,怎样实现App里 ...