当我执行此关键字时,会显示"没有名称的关键字"和"找到的错误".
测试此关键字
[arguments] ${YearDiff} ${MonthDiff}
Run Keyword If ${YearDiff}>=0 and ${MonthDiff}>=0 Click Element id=Left_Calendar_Icon
Run Keyword If ${YearDiff}<=0 and ${MonthDiff}<=0 Click Element id=Right_Calendar_Icon
Run Code Online (Sandbox Code Playgroud)
如果我使用了错误的语法,请纠正我.
当尝试从自定义库访问关键字时,显示错误 InvalidArgumentException
我使用下面的文件夹结构来维护我的测试脚本
Test_Scripts
TestCase
TestSuite1.robot
SupportFiles
RF_CustomLibrary.py
Run Code Online (Sandbox Code Playgroud)
TestSuite1.机器人
*** Settings ***
Library SeleniumLibrary
Library ..\\SupportFiles\\RF_CustomLibrary.py
*** Variables ***
${Browser} Chrome
*** Test cases ***
Sample Test Case
Verify Paste text functionality
*** Keywords ***
Verify Paste text functionality
Set Library Search Order RF_CustomLibrary
Open Browser https://gmail.com ${BROWSER}
Sleep 2s
Maximize Browser Window
Wait Until Keyword Succeeds 60s 2s Element Should Be Visible ${L_Login_btn}
PasteTextFunction id=identifierId Username1
Run Code Online (Sandbox Code Playgroud)
自定义库:RF_CustomLibrary.py
import os
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from SeleniumLibrary …Run Code Online (Sandbox Code Playgroud)