我們通過google找到解決方案但未能成功,我們如何將已記錄的腳本添加到新腳本中。Selenium IDE:將測試腳本包含到新測試腳本中
3
A
回答
3
Selenium-Core有一個擴展:「include」,它可以將另一個測試的內容添加到當前測試中。 以下是OpenQA wiki上的頁面:http://wiki.openqa.org/display/SEL/include,但不幸的是目前無法訪問。 我曾經在過去使用它,但最終放棄了ROLLUP RULES。
但是,如果您正在尋找一種在多個測試用例中重用腳本的方法,我強烈建議您使用匯總規則。這是Selenium IDE的許多用戶功能非常強大和低估的。
使用匯總規則的詳細信息寫在Selenium IDE的幫助頁面上:菜單幫助 - UI元素文檔,然後按關鍵字「彙總」進行搜索。
0
我最終使用了Yevgen建議的Rollups。我花了一些時間來找到實現這一點的正確方法。基本思想是編寫一個JavaScript文件,並將其添加到Selenium IDE的Selenium Core Extensions設置下的options/options下。您需要編寫的JavaScript文件才能構建「可重用的命令堆棧」,這將允許您使用內置彙總命令,並將目標設置爲您分配給一組命令的標籤。
我寫了一篇關於Selenium IDE Includes AKA Rollups的文章,可能是一個有用的資源。
一個例子彙總腳本:
/**
* For use in Selenium IDE.
*
* You will need to add this to Selenium under Options/Options in the Selenium Menu.
* Put this under Selenium Core Extensions:
* ~/selenium-ide-for-slp/sideflow.js , ~/selenium-ide-for-slp/slp_rollups.js
*
*
*/
var manager = new RollupManager();
/**
* check_for_syntax_errors
*
* This rollup tests for php syntax errors, warnings, and notices.
*/
manager.addRollupRule({
name: 'check_for_syntax_errors',
description: 'Check for PHP syntax errors, notices, warnings.',
args: [],
commandMatchers: [],
getExpandedCommands: function(args) {
var commands = [];
commands.push({
command: 'assertNotText',
target: '//body',
value: '*Notice: Undefined*'
});
commands.push({
command: 'assertNotText',
target: '//body',
value: '**Notice: Trying to get*'
});
commands.push({
command: 'assertNotText',
target: '//body',
value: '*Notice: Use of*'
});
commands.push({
command: 'assertNotText',
target: '//body',
value: '*Fatal error:*'
});
return commands;
}
});
希望有所幫助。
相關問題
- 1. 試圖運行Selenium IDE Python腳本作爲測試套件
- 2. 如何編寫包含多個測試用例的Python Selenium測試腳本?
- 3. 用於Python的IDE:測試腳本
- 4. from selenium測試腳本返回selenese
- 5. 測試ruby腳本
- 6. Shell腳本測試
- 7. 測試Python腳本
- 8. 測試腳本描述框
- 9. Selenium IDE:在測試中執行測試
- 10. 如何從另一個測試腳本調用測試腳本?
- 11. 硒Android的測試腳本
- 12. PHP(版本5.5到5.6),測試腳本
- 13. MSBuild腳本中的硒測試
- 14. 測試bash shell腳本
- 15. Python測試整個腳本
- 16. 單元測試PHP腳本
- 17. 自動測試shell腳本
- 18. Shell腳本測試命令
- 19. 什麼是測試腳本?
- 20. 在線測試腳本
- 21. 測試幻像JS腳本
- 22. J-Meter - Moodle測試腳本
- 23. 如何測試豬腳本
- 24. 貢獻R測試腳本
- 25. Gatling負載測試腳本
- 26. RSpec的測試Ruby腳本
- 27. 測試批量更新腳本
- 28. 如何從watir webdriver中的另一個測試腳本調用測試腳本
- 29. 測試貝哈特腳本在Googlechrome
- 30. 從Selenium Java測試腳本連接到MySQL數據庫失敗
謝謝,我會盡力的。 – Faiyaz