selenium ide 录制回放link链接报错

回放是出现以下错误:

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

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

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

 

share improve this question
 

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.

share improve this answer
 

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().

share improve this answer
 
   
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.

share improve this answer
 

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

share improve this answer
 

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.

 

转载于:https://www.cnblogs.com/my-blogs-for-everone/p/5657505.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值