2014-07-04 57 views
0

我無法找到waitForAllLinks操作的具體描述。不幸的是,硒核心參考文獻對這個問題沒有多說。waitForAllLinks是什麼意思,是否有任何webdriver的替代?

藉此例如:

<tr> 
     <td>open</td> 
     <td>http://www.google.com/</td> 
     <td></td> 
</tr> 
<tr> 
     <td>sendKeys</td> 
     <td>id=gbqfq</td> 
     <td>testing</td> 
</tr> 
<tr> 
     <td>waitForAllLinks</td> 
     <td></td> 
     <td>10000</td> 
</tr> 

究竟正在等待呢?

而在相關說明中,是否有任何WebDriver替代方案?

回答

0

在深入研究IDE源代碼和selenium引用後,waitForAllLinks 似乎執行以下操作:重複嘗試獲取頁面中的所有鏈接,直到檢索到的ID列表與提供的模式匹配。

以上來自互聯網的例子似乎是錯誤的。 waitForAllLinks只接受第一個參數 - 要匹配的模式。第二個參數被忽略。因此,該示例中的10000僅被忽略,並且僅當頁面包含NO鏈接時,waitForAllLinks纔會成功。

0

我從來沒有使用過這個命令,但是在Selenium IDE中,當你輸入任何命令時,在工具底部有一個Reference選項卡。對於waitForAllLinks此選項卡說:

waitForAllLinks(模式)

從getAllLinks()產生

Returns: 
    the IDs of all links on the page 

Returns the IDs of all links on the page. 

If a given link has no ID, it will appear as "" in this array. 

你可以看一下getAllLinks()the API。這是一個全班,但恐怕API文檔不是非常有用。

希望這足以讓你開始。