2015-04-03 45 views
1

我使用的是Selenium IDE,我只能使用該工具。 我有這種情況:我有檢查,如果我的郵箱它包含消息或沒有。 唯一的方法是檢查頁面上是否有特定的字符串。Selenium IDE - 如何獲取verifyNotText的結果並執行正確的操作

我已經應用了

Command: verifyNotText 
Target: //form[@id='messages']/table/tbody/tr/td[5] 
Value: "on behalf of:.*" 

我如何檢查此命令的結果? 我的意思是:如果結果爲真,測試將繼續執行命令列表 ,而不是執行其他命令。

我想用這樣的:

Command: gotoif 
Target: previous command 
Value: goAhead 

你有什麼建議嗎?

預先感謝您! C

回答

0

嘗試使用storeTextPresent。如果你想使用gotoIf函數,你需要一個變量。

storeTextPresent on behalf of:.* text //text is a variable name 
gotoIf ${text}==on behalf of:.* Yes //Yes and No are labels 
gotoIf ${text}!=on behalf of:.* No 
label Yes 
//instructions if text present equals "on behalf of:.*" 
goto End 
label No 
//instructions if text present not equals "on behalf of:.*" 

另一個有用的東西可能是使用goto函數。如果你想跳到特定的步驟,你可以用這個功能「驅動」你的測試。 例如:

goto End //jump to label End 
label End 

希望它有幫助! 如果有什麼不明,請發表評論

+0

謝謝拉法爾,正是我所需要的:) – ClaudioM 2015-04-09 09:58:39

相關問題