您好我已经将以下测试用例从Katalon记录器导出到Robot Framework代码。我正在尝试使用Python 2.7在PyCharm或RIDE中运行它。 PyCharm和RIDE似乎都不喜欢Resource seleniumLibrary.robot代码。
我怎么能导入这个seleniumLibrary.robot文件?它在哪里?我已经下载了Robot Framework,SeleniumLibrary,Selenium2Library,WxPython和RIDE,现在都在使用我只是想让这段代码运行。
我按照下面的说明启动并运行
*** Settings ***
Suite Setup Open Browser https://www.katalon.com/ firefox
Suite Teardown Close Browser
Resource seleniumLibrary.robot
*** Variables ***
${undefined} https://www.katalon.com/
*** Test Cases ***
Test Case
open https://abcxyz.com/catalog-portal/
click xpath=//div[5]/div/div[2]/img
selectWindow win_ser_1
selectFrame index=0
click xpath=//td[@onclick="if (warnUnfinishedPage()) return false; changePage('pc.quote.html.QuoteSummarySection','refresh'); return false;"]
click xpath=(.//*[normalize-space(text()) and normalize-space(.)='Email'])[1]/following::td[5]
type name=t1st__TBOX 603449
click xpath=(.//*[normalize-space(text()) and normalize-space(.)='All'])[2]/following::input[1]
click link=Q603449
click link=Email
addSelection id=null Doe, John ([email protected])
click xpath=(.//*[normalize-space(text()) and normalize-space(.)='Email this Quote'])[1]/following::input[2]
select name=FORMAT Text
click link=Send
close win_ser_1
selectWindow win_ser_local
close win_ser_local
设置和变量部分主要是占位符。您应该自定义这些以与您创建的开发环境兼容。
在这种情况下,需要在项目的Resources文件夹中创建资源文件seleniumLibrary.robot。
完整的新项目示例:
尝试删除代码中的该资源行并将其更改为Library Selenium2Library。我认为问题是katalon studio正在生成一个使用seleniumlibrary的代码。