我正在组织中进行概念验证,使用机器人框架以及seleniumlibrary和cumulusci来自动化我们基于salesforce的平台。这是我到目前为止设置的内容:
注意:此时,我能够在纯粹基于seleniumlibrary的Ui上识别和单击元素,但是我还需要能够利用cci功能。
当我尝试使用时:
*** Test Cases ***
TestSample
Salesforce.Click Object Button <mybuttonstitle>
我得到:找不到名为'Salesforce.Click模态按钮'的关键字。
我的推荐:https://cumulusci.readthedocs.io/en/latest/robotframework.html https://cumulusci.readthedocs.io/en/latest/_downloads/Keywords.html
寻找有关cci设置,访问关键字或任何其他方面的帮助,你们觉得我在cci-rfw前面缺少了。
谢谢。
我相信,你错过了Salesforce
库的导入,
*** Settings ***
Resource cumulusci/robotframework/Salesforce.robot
另外,请确保已经安装了Python包。
感谢你的帮助Bryan和KJ。实际问题是我创建的文件夹结构不正确。当我对其进行排序时,我的cumulusci关键字开始工作。这就是我所说的:https://groups.google.com/forum/#!topic/robotframework-users/iaeUZU_htk4
*** Keywords ***
Call all python libraries and resources
import library SeleniumLibrary timeout=20
import library OperatingSystem
import resource C:/Python37/Lib/site-packages/cumulusci/robotframework/Keywords/CommonKeywords.robot
import resource C:/Python37/Lib/site-packages/cumulusci/robotframework/Salesforce.robot
import resource C:/Python37/Lib/site-packages/cumulusci/robotframework/CommonVariables.robot
*** Settings ***
Resource C:/Python37/Lib/site-packages/cumulusci/robotframework/CommonEnvironment.robot
Suite Setup Call all python libraries and resources
Test Setup Setup Browser
Test Teardown End Session
*** Test Cases ***
Verify so and so
Login to Salesforce
Launch My App
*** Keywords ***
Login to Salesforce
Wait Until Page Contains Element ${signOn_username}
Input Text ${signOn_username} ${Username}
Wait Until Page Contains Element ${signOn_password}
Input Text ${signOn_password} ${Password}
Click Element ${loginButton}
${Pass}= RUN KEYWORD AND RETURN STATUS Wait Until Page Contains Element' ${MostRecentlyViewed}
run keyword if '${Pass}'=='True' Log "SF Home page loaded successfully"
... ELSE Fail "SF Home page did not load successfully"
Launch My App
Open App Launcher # this is the cumulusci keyword - and it works well now!
Select App Launcher App MyApp
...