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. HDU 1394 线段树求逆序对

    Minimum Inversion Number Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java ...

  2. windows安装SUSE Linux Enterprise Server 12

    一:打开“开发人员模式” 点击开始菜单按钮,选择“设置” 在设置中选择“更新和安全” 在菜单中选择“针对开发人员”,在三个选项中,选中“开发人员模式” 在弹出的警告框中点击“是” 这样开发人员模式就打 ...

  3. Docker如何部署Python项目

    Docker 部署Python项目 作者:白宁超 2019年5月24日09:09:00 导读: 软件开发最大的麻烦事之一就是环境配置,操作系统设置,各种库和组件的安装.只有它们都正确,软件才能运行.如 ...

  4. BZOJ——1720: [Usaco2006 Jan]Corral the Cows 奶牛围栏

    http://www.lydsy.com/JudgeOnline/problem.php?id=1720 Time Limit: 5 Sec  Memory Limit: 64 MBSubmit: 1 ...

  5. python3.x之print()

    1.print内容 #!/usr/bin/python print('hello world')    //print("hello world") 2.print变量 #!/us ...

  6. Codeforces 375 D Tree and Queries

    Discription You have a rooted tree consisting of n vertices. Each vertex of the tree has some color. ...

  7. hadoop+yarn+hbase+storm+kafka+spark+zookeeper)高可用集群详细配置

    配置 hadoop+yarn+hbase+storm+kafka+spark+zookeeper 高可用集群,同时安装相关组建:JDK,MySQL,Hive,Flume 文章目录 环境介绍 节点介绍 ...

  8. java集合系列之ArrayList源码分析

    java集合系列之ArrayList源码分析(基于jdk1.8) ArrayList简介 ArrayList时List接口的一个非常重要的实现子类,它的底层是通过动态数组实现的,因此它具备查询速度快, ...

  9. IntelliJ IDEA设置properties文件显示中文

    配置这里: 注意:上面是Default Settings,还需要在Settings中设置成上面一样的.

  10. HDU1800 Flying to the Mars 【贪心】

    Flying to the Mars Time Limit: 5000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Other ...