2

我的意图是通过在关键字中给出多个 URL 作为参数并将其称为测试用例。它应该是多个测试用例的一部分。请帮助我更正代码。

*** settings ***
Library  Selenium2Library
Test Template     My Logging


*** Variables ***   
${Google}              https://www.google.co.in/
${Facebook}            https://www.facebook.com/



*** Test Cases *** 
Login to Google     
   My Logging     ${Google}
   My Logging     ${Facebook}

Login to Google website
    Login to Google



*** Keywords ***
My Logging
  [Arguments]     ${url}
  Open Browser     ${url}     Chrome
  Capture Page Screenshot
  Close Browser

Login to google
    Open Browser     ${Google}      Chrome
    Close Browser

提示错误

Login to Google website                                               | FAIL |
WebDriverException: Message: unknown error: unhandled inspector error: {"code":-32603,"message":"Cannot navigate to invalid U
RL"}
4

1 回答 1

4

您不能Test Template与非数据驱动测试一起使用。删除这一行:

Test Template     My Logging
于 2016-05-31T14:16:06.403 回答