selenium webdriver使用过程中出现Element is not currently visible and so may not be interacted with的处理方法
参考文章:
http://blog.csdn.net/passionboyxie/article/details/28661107
http://www.spasvo.com/ceshi/open/kygncsgj/Selenium/2014324160758.html
因为我遇到的问题是下拉菜单的遇到的,因此第二篇文章是关于下拉菜单的,问题的原因是下拉菜单的属性style="display:none;"解决办法是参照第一篇文章,使用javascript修改这个属性为block,然后再操作这个元素就可以了,修改属性的代码如下:
IJavaScriptExecutor javaScriptExecutor = (IJavaScriptExecutor) driver;
javaScriptExecutor.ExecuteScript("document.getElementById('jq-company-dropdown').style.display='block';");
操作元素的代码如下:主要是选中下拉菜单中的一个选项
driver.FindElement(By.Id("jq-company-dropdown")).FindElement(By.XPath("//option[@value='1']")).Click();
selenium webdriver使用过程中出现Element is not currently visible and so may not be interacted with的处理方法的更多相关文章
- Java中通过Selenium WebDriver定位iframe中的元素
转载请注明出自天外归云的博客园:http://www.cnblogs.com/LanTianYou/ 问题:有一些元素,无论是通过id或是xpath等等,怎么都定位不到. 分析:这很可能是因为你要定位 ...
- [Selenium] WebDriver 操作 HTML5 中的 drag/drop
以 jQuery UI 官方网站元素测试,地址:http://jqueryui.com/draggable/ 示例: package com.learningselenium.html5; impor ...
- 安装SQL Server 2012过程中出现“启用windows功能NetFx3时出错”(错误原因、详细分析及解决方法)以及在Windows Server2012上安装.NET Framework 3.5的详细分析及安装过程
问题:在服务器(操作系统为Windows server 2012)上安装SQL Server 2012的过程中,安装停留在下图所示的界面上,显示”正在启用操作系统功能NetFx3”随后出 ...
- webDriver运行过程中遇到的问题
1.org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 705 ...
- [Selenium] WebDriver 操作 HTML5 中的 video
测试播放,停止播放 http://www.videojs.com/ 示例: package com.learningselenium.html5; import static org.junit.As ...
- cnpm安装过程中提示optional install error: Package require os(darwin) not compatible with your platform(win32)解决方法
运行cnpm install后,出现 虽然提示不适合Windows,但是问题好像是sass loader出问题的.所以只要执行下面命令即可: 方案一: cnpm rebuild node-sass # ...
- Element is not currently visible and so may not be interacted with错误
用selenium定位时,碰到这种错误的原因: 此种问题的关键是在于用className和id都不唯一所以找不到对象 所以,碰到这种问题就换一种定位方式
- Selenium WebDriver 工作原理
WebDriver与之前Selenium的js注入实现不同:Selenium通过JS来定位元素处理元素(基本上所有元素都可以定位到)WebDriver通过WebDriver API定位处理元素:通过浏 ...
- selenium webdriver (python) 第一版PDF
前言 如果你是一位有python语言基础的同学,又想通过python+ selenium去实施自动化,那么你非常幸运的找到了这份文档,我也非常荣幸能为你的自动化学习之路带来一丝帮助. 其实,我在sel ...
随机推荐
- 屌炸天实战 MySQL 系列教程(二) 史上最屌、你不知道的数据库操作
此篇写MySQL中最基础,也是最重要的操作! 第一篇:屌炸天实战 MySQL 系列教程(一) 生产标准线上环境安装配置案例及棘手问题解决 第二篇:屌炸天实战 MySQL 系列教程(二) 史上最屌.你不 ...
- Absolute sort
Absolute sort Let's try some sorting. Here is an array with the specific rules. The array (a tuple) ...
- mac OSX上eclipse adb无法识别(调试)小米的解决方案
最近在Mac上开发安卓,用小米2a作为开发机,连上电脑后发现idea和eclipse真机调试的时候都提示USB device not found.经过一番google和百度,终于找到了解决方案,在这里 ...
- bzoj1734 [Usaco2005 feb]Aggressive cows 愤怒的牛
Description Farmer John has built a new long barn, with N (2 <= N <= 100,000) stalls. The stal ...
- Node.js 和Socket.IO 实现chat WEBIM
socket官方: http://socket.io/ 需求:实现WEB IM功能,数据从服务器PUSH 不是PULL websocket是基于HTML5的新特性,不兼容IE6,7,8 .. ...
- pyqt 托盘例子学习
# -*- coding: utf-8 -*- # python:2.x __author__ = 'Administrator' from PyQt4.QtGui import * from PyQ ...
- go - 复合类型 array, slice, map
Go 语言支持复合类型: 数组:array 切片:slice 指针:pointer 字典:map 通道:chan 结构体:struct 接口:interface 1. array 同一类型数据的集 ...
- Maxiee的Vim入门日记(4)——安装windows下的Cscope
Maxiee今天又学到了一个插件——Cscope.Cscope 是一款用于查看大型工程中的代码的软件.它使用方便,支持快速查找 C Symbol.function 等在工程中所有出现的位置,而不用自己 ...
- Weblogic的Admin server进程将CPU消耗尽问题解决
1.serverCPU被耗尽,持续100% 以下附nmon图 2.两个weblogicadmin server进程将CPU耗尽 问题:24298进程,占用百分之四千多的CPU资源 23529进程,占用 ...
- 打印log 保存log
using UnityEngine; using System.Collections; using System.IO; using System; using System.Text; names ...