无法在IE中找到元素,但在FF中,它工作正常(Unable to find element in IE but in FF it works fine)

系统教程 行业动态 更新时间:2024-06-14 17:03:54
无法在IE中找到元素,但在FF中,它工作正常(Unable to find element in IE but in FF it works fine)

编辑:

我的CSSSelector是这样的:(它在FF中工作正常)

for (int i = 1; i < _count; i++) { .................. .................. div#ctl00_ContentPlaceHolder1 table.gv tbody tr.item:nth-child(" + i + ") > td:nth-of-type(3) .................. }

编辑结束

我在FF中使用Selenium 2.29和IE(8)和FF(17.1),所有测试用例都通过了,当我在IE中运行时,大多数测试用例都失败了,这里是错误消息:

Test method threw exception: OpenQA.Selenium.WebDriverTimeoutException: Timed out after 30 seconds ---> OpenQA.Selenium.NoSuchElementException: Unable to find element with css selector ==

div#ctl00_ContentPlaceHolder1 table.gv tbody tr.item:nth-​​child(1)> td:第n个类型(3)

我正在使用CSSSelector。

我必须更改IE浏览器的CSSSelector才能正常工作吗?

EDIT:

my CSSSelector is like this: (which is working fine in FF)

for (int i = 1; i < _count; i++) { .................. .................. div#ctl00_ContentPlaceHolder1 table.gv tbody tr.item:nth-child(" + i + ") > td:nth-of-type(3) .................. }

EDIT END

I'm using Selenium 2.29 and IE (8) and FF (17.1) in FF all my test cases passed and when I run in IE majority of my test cases failed and here is the error message:

Test method threw exception: OpenQA.Selenium.WebDriverTimeoutException: Timed out after 30 seconds ---> OpenQA.Selenium.NoSuchElementException: Unable to find element with css selector ==

div#ctl00_ContentPlaceHolder1 table.gv tbody tr.item:nth-child(1) > td:nth-of-type(3)

I'm using CSSSelector.

do I have to change the CSSSelector for IE to work?

最满意答案

按照: http : //www.quirksmode.org/css/contents.html#t38

IE8及以下版本不支持:nth选择器。

As per: http://www.quirksmode.org/css/contents.html#t38

IE8 and below don't support the :nth selectors.

更多推荐

本文发布于:2023-04-24 14:23:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/dzcp/d32686767fcf8e5571eecbde0b72708b.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:但在   元素   中找到   工作   element

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!