回放是出现以下错误:

也就是回放点击打开新的链接时出现这个错误,

这个问题说的是 点击此链接会新打开一个窗口

selenium1是不支持多窗口切换的 因此会卡在这里,也就录制不支持这个操作,但是很多书都没有写出这个缺陷,都说又这个功能,真是很坑啊,我当时找到这个

原因时一万只羊驼飘过啊

selenium2 即 selenium1+webdriver 很好的解决了这个问题

selenium1 所以装再高版本也没用

selenium2 指的是 webdriver

webdriver是没有录制功能的 全凭手写

在stackoverflow我找到了最佳大答案

即通过放慢回放速度就可以正常打开连接了

I am executing a simple recorded script in Selenium , in which i just search a page in Google and then click it , but when Run that recorded script it is giving me the "Error [error] Element link not found".

And following is the Script which i am running,any help would be very useful.

New Test

New Test open / type q Bill Gates click link=Bill Gates: Chairman click link=Bill Gates: Chairman

asked Jun 14 '11 at 19:52
mohsin

111
 

5 Answers

I got the same error message while going through the tutorials online. I found out that the scripts were running too fast for FF to load the links. If you slow down the playback by moving the green button on the Fast-Slow bar to somewhere in the middle the scripts run without any errors.

answered Nov 2 '11 at 17:27
 

I guess I know the answer. It might be bcz of any javascript error(you can see that on the status bar at the Right corner(IE)) or that link element might not be placed correctly in the box(box model). Here you can use Selenium.focus("link=text") :selenium.keyPressNative("10") . It presses the enter key.but while selenium is executing this statement Do not change the focus from your AUT (don't touch the mouse). In IDE ,just paste the above statement on click().

answered Jun 15 '11 at 5:27
 
    
I thanks , i get the solution it was due to the fact that it looks for the Google search results prior to i press the <search> button , i think there needs to add a statement to press the <search> button/ – mohsin Jun 16 '11 at 10:47

Im assuming you are using Google instant as there is no "click search button" command, the link is probably not preset because selenium is not waiting for Google instant to respond or the javascript to render the link. If you manually add in a click command to search it should solve it.

answered Jun 15 '11 at 19:41
Tnem

3,9181127
 

My solution is almost the same as Cuongs. Though I change the speed by using a command and change it back afterwards.

Before you click the link, you can set the speed to slow: Command: setSpeed Target: 3000

You can change the speed afterwards again to ~1000

answered Jan 10 '13 at 15:01
Anton

314
 

Well, I don't think you have to slow the speed down. You know the problem is caused by clicking on the link before it is available, so you could add an extra command waitForVisible (e.g. link=Bill Gates: Chairman) before the clickAndWait command.

最新文章

  1. Socket
  2. wifi共享小工具
  3. SqlServer——阻止保存要求重新创建表的更改
  4. BZOJ 4408 神秘数
  5. Java8新特性 1——利用流和Lambda表达式操作集合
  6. vector中resize和reserve的区别,代码验证
  7. Knockout应用开发指南 第八章:简单应用举例(2)
  8. [Angular Tutorial] 9 -Routing &amp; Multiple Views
  9. Oracle 12cR1 RAC 在VMware Workstation上安装(上)—OS环境配置
  10. SSM框架整合项目 :投票系统
  11. SSH网上商城---邮件发送
  12. FreeSql.DbContext 第二个版本介绍
  13. python3 实例方法、类方法和静态方法
  14. SpringCloud笔记七:Zuul
  15. tiny6410的启动参数
  16. 【洛谷4238】 多项式求逆(NTT,分治)
  17. Elasticsearch学习之深入聚合分析三---案例实战
  18. 七、django rest_framework源码之视图
  19. Spring Boot学习笔记(二)全局捕获异常处理
  20. ubuntu scrapy 开发环境搭建

热门文章

  1. js练习-控制div属性
  2. 2014 Super Training #6 G Trim the Nails --状态压缩+BFS
  3. Java开发和运行环境的搭建
  4. 第一次使用Android Studio时你应该知道的一切配置(二):新建一个属于自己的工程并安装Genymotion模拟器
  5. JavaWeb学习----JSTL标签库
  6. (copy)MVC4.0网站发布和部署到IIS7.0上的方法
  7. mysqli_stmt预处理类
  8. UICollectionView使用
  9. android实现点击背景图片不同区域实现不同事件
  10. android Camera 中如何修改缩放变焦参数