运行相同的代码时,Selenium IDE会给出不同的结果

时间:2012-10-16 13:13:20

标签: selenium-ide

我是Selenium的新手,只是在玩IDE。我有一个在我的机器上本地运行的网站,它有一个IFrame和一些弹出窗口。以下代码在中速模式或慢速模式下运行良好但在快速模式下运行时失败则会出错(参见下面的第15行)。尽管我试图保持等待声明以使事物同步。

另请注意,无论是慢速还是快速,第9行都会执行相同的代码。

01    open          /default.aspx
02    type          id=loginContent_txtPassword xxxx
03    clickAndWait      id=loginContent_btnSet  
04    windowFocus       
05    click         //div[@id='lBar_leftItem_4']/a  
06    waitForFrameToLoad            aframe 30000
07    selectFrame               aframe  
08    click         css=img[title="Properties"] 
09    waitForPopUp      doc              30000
10    selectWindow      name=doc    
11    close     
12    selectWindow      null    
13    selectFrame               aframe  
14    click         css=img[title="Properties"] 
15    waitForPopUp      doc                        30000   ***[error] can't access dead object**
16    selectWindow      name=doc    
17    verifyText        id=popupContent_lblOwner           XYZ*
18    close 

1 个答案:

答案 0 :(得分:0)

尝试了许多事情......但最终在导致问题的陈述解决问题之前暂停了几秒钟(几秒钟)。也许selenium请求没有同步,它会在它处理之前向浏览器发送一些请求(只是我的猜测!)

相关问题