提高 Selenium1 中 IE 驱动程序的性能
我最近发现 Selenium1 使用 XPath 与 Firefox 配合得很好,但是 使用 IE 非常非常慢。 有什么解决方案可以提高 Selenium1 的 IE 性能吗?
我发现人们在 Selenium 中使用 JQuery 元素定位器。 我喜欢这个主意,我想询问一下优点和缺点。使用 JQuery 选择器而不是 XPath 选择器的缺点。 比如说在 IE 中,它们更“灵活”还是更快?
实际上问题仅在使用 Selenium1 时与 IE 相关,所以我想使用 JQuery 定位器而不是 XPath,但我不知道使用 JQuery 定位器是否像 XPath 一样易于使用?
有没有任何插件可以让我获得像 XPather 这样的 JQuery 定位器? 有没有办法将现有的 XPath 转换为 JQuery 定位器?
因为我已经实施了大约数千个测试在 Firefox Selenium1 上运行良好现在需要让它们在 IE Selenium1 上运行良好。我正在拼命寻找解决方案。
任何问题的建议。 我正在拼命寻找解决方案。
谢谢。
I recently experienced that Selenium1 works very good with Firefox using XPath but
its very very slow with IE.
Is there any solution to increase performance in IE of Selenium1 ?
I've found out that people use JQuery element-locators in Selenium.
I like the idea and I'd like to ask about pros & cons of using JQuery selectors instead of XPath ones.
Are they more "flexible" or fast, let's say in IE ?
Actually Problem is with IE only while using Selenium1, So I am thinking to use JQuery locators instead of XPath but i dont know whether using JQuery locator would be as easy to use as XPath ?
Is there any plugin by which I can get JQuery locator like XPather ?
Is there any way to convert existing XPath into JQuery locator ?
Because i have around thounsands of test already implemented & running fine with Firefox Selenium1 now need to make all of them running fine with IE Selenium1. I am desperately looking for solution.
Any suggestion for issue.
I am desperately looking for solution.
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不,它们并不更快,xpath 通常更灵活,但是如果您已经在 JavaScript 中编写了 JQuery 选择器,那么您不妨在测试中使用它们,因为这样您就不必编写额外的选择器。
Selenium 在 IE 中速度很慢,因为 IE 中的 JavaScript 引擎非常糟糕,在我的上一个项目中,我的构建在 Firefox 中运行了大约一个小时(在 Chrome 中更快),但在 IE 中花了 6 个多小时。
您可能还想查看在java中检测seleniumRC网页上的元素的最佳方法
No they are not faster, xpath is generally more flexible, but if you already have the JQuery selectors written in your JavaScript then you might as well use them in your tests as it saves you having to write the extra selector.
Selenium is slow in IE because the JavaScript engine in IE is unbelievably bad, on my last project I had a build that took about an hour to run in Firefox (faster in Chrome) but took over 6 hours in IE.
You may also like to look at best way to detect an element on a web page for seleniumRC in java
您可以尝试内置的其他 XPath 实现之一。默认设置如下:
尝试切换到:
这应该会更快一些。
You could try one of the other XPath implementations built in. By default the following is set:
try switching to:
This should be a bit faster.