-2

我正在尝试使用 Robot Framework 运行一些测试,但是当我尝试此代码时,我收到以下错误

*** Settings ***
Library    SeleniumLibrary
Suite Setup     Go to homepage
Suite Teardown     Close All Browsers

*** Variables *** 
${HOMEPAGE}          http://www.google.com
${BROWSER}           chrome

*** Test Cases ***
Google mdh and find mdh.se
           Google and check results    mdh    www.mdh.se

*** Keywords ***
Google and check results
         [Arguments]     ${accept}    ${searchkey}   ${result}
          
      
         Click Button class=RveJvd snByac   ${accept}  
         Click Button    name=btnK   ${searchkey}
         Wait Until Page Contains    ${result}

Go to homepage
       Open Browser           ${HOMEPAGE}          ${BROWSER}

关键字“谷歌和检查结果”预期 3 个参数,得到 2 个。

4

2 回答 2

0

错误很明显,您没有传递${result}参数。

于 2020-11-28T19:36:50.177 回答
0

您需要向关键字“Google and check results”再传递一个参数。它总共需要 3 个,这里缺少 ${result} 参数。

于 2020-11-30T07:57:32.737 回答