【发布时间】:2021-12-08 02:40:19
【问题描述】:
使用 RobotFramework,使用“浏览器”库。
使用代码:
*** Settings ***
Library Browser enable_presenter_mode=True
Library XML
Library Collections
Library String
Library DateTime
Documentation FUTURE CHRISTMAS
*** Variables ***
${Date}= 2023-12-25 00:00:00.000000
*** Test Cases ***
Find the future christmasday
Open Browser https://obstaclecourse.tricentis.com/Obstacles/21269
sleep 3s
[Arguments] ${Date}
${Day}= Convert Date ${Date} result_format=%A
# [Return] ${Day}
#${date2}= DateTime.Get Current Date
#Log To Console ${Day}
#Log To Console ${date2}
Click id=christmasday
Fill Text id=christmasday ${Day}
Sleep 2s
# used resources :
# https://stackoverflow.com/questions/42356100/how-can-i-retrieve-the-day-of-the-week-from-date
#
它导致消息:
==============================================================================
Test5 21269 :: FUTURE CHRISTMAS
==============================================================================
[ WARN ] Open Browser is for quick experimentation and debugging only. Use New Page for production.
Find the future christmasday | PASS |
------------------------------------------------------------------------------
[ WARN ] Keyword 'Take Screenshot' could not be run on failure:
Error: Tried to take screenshot, but no page was open.
[Arguments] 2023-12-25 00:00:00.000000
[ FAIL ] Error: Tried to do playwright action, but no open page.
有一个打开的页面,我不知道错误消息来自哪里。
【问题讨论】:
-
这是实际的完整来源吗?如果是这样,您在测试用例部分中有一个
[Arguments],这是不合适的;它可能导致错误。