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. golang sort包 排序

    []float64: ls := sort.Float64Slice{ 1.1, 4.4, 5.5, 3.3, 2.2, } fmt.Println(ls) //[1.1 4.4 5.5 3.3 2. ...

  2. fmt 包中的函数和方法

    / Fprintf 将参数列表 a 填写到格式字符串 format 的占位符中// 并将填写后的结果写入 w 中,返回写入的字节数func Fprintf(w io.Writer, format st ...

  3. 2017-10-28-afternoon-清北模拟赛

    T1 水题(water) Time Limit:1000ms   Memory Limit:128MB 题目描述 LYK出了道水题. 这个水题是这样的:有两副牌,每副牌都有n张. 对于第一副牌的每张牌 ...

  4. 关于get请求的乱码问题

    1.使用getBytes() 页面跳转时,参数中含有中文,特殊符号,tomcat的默认编码为ios-8859-1,后台接受中文编码时,使用如下转码 //获取参数 String bname = requ ...

  5. 转:Linux字符编码方式

    首先,解释一下字符集: 汉字编码: * GB2312字集是简体字集,全称为GB2312(80)字集,共包括国标简体汉字6763个. * BIG5字集是台湾繁体字集,共包括国标繁体汉字13053个. * ...

  6. Free web scraping | Data extraction | Web Crawler | Octoparse, Free web scraping

    Free web scraping | Data extraction | Web Crawler | Octoparse, Free web scraping 人才知了

  7. [WASM] Access WebAssembly Memory Directly from JavaScript

    While JavaScript has a garbage-collected heap, WebAssembly has a linear memory space. Nevertheless u ...

  8. 生活娱乐 Wifi机器人的制作流程

    思路简单,但是创意无限~~ 动手能力超强 牛人教你做Wifi机器人(图) 一.前言 Wifi机器人(Wifi Robot):其实是一辆能通过互联网,或500米以外的笔记本无线设施来远程控制的遥控汽车. ...

  9. Solidworks如何创建投影曲线

    画好草图之后(草图是在上视基准面上画的)然后点击曲线,投影曲线   面选择要投影的曲面,然后就得到了平面曲线在曲面上的投影得到的空间曲线   注意这种方法对于开环轮廓也是可以用的,比如下面,我定义一个 ...

  10. 用rsync命令删除大文件夹

    删除大文件夹 rsync 命令做同步文件用的命令 我们可以借助其快速的运行 来对大文件夹删除:原来就是 新建一个空文件夹 然后把这个空文件夹同步到一个大文件夹下面: 这样会删除大文件夹下面的内容 是高 ...