机器人框架问题:AttributeError:无法设置属性

问题描述 投票:0回答:1

我的机器人框架有一些问题。只是尝试在 gitlab 上执行我的代码,但失败了。您能检查一下我的问题吗?

*** Variables ***
${URL}      https://opensource-demo.orangehrmlive.com/web/index.php/auth/login
${Browser}   headlesschrome
@{Credentials}  Admin   admin123
&{LoginData}    username=Admin  password=admin123
*** Test Cases ***
Testing_login
    sleep    3
    open browser    ${URL}     ${Browser}
    set browser implicit wait    3
    LoginKeyword
    log    das pw ist @{Credentials}    console=true
    click button  xpath=//*[@id="app"]/div[1]/div/div[1]/div/div[2]/div[2]/form/div[3]/button
    click element   class=oxd-userdropdown-name
    click element   link=Logout

    sleep    3
    close browser
MySecondTest
    [Tags]    smoke
    Log     I am inside the first test
*** Keywords ***
LoginKeyword
    input text    name=username    @{Credentials}
    sleep    3
    input password    name=password    admin123

Logs-Screen

尝试打开 headless-chrome-browser(或 firefox)进行登录,但失败。

python selenium-webdriver selenium-chromedriver robotframework
1个回答
0
投票

将“selenium”包降级到与本地计算机相同的版本。

问题是 SeleniumLibrary 正在使用旧机制使 Chrome 成为“无头”,并且应该修复 SL 中的代码以支持新的实现方式 - 此处对此进行了描述; https://www.selenium.dev/blog/2023/headless-is-going-away/

© www.soinside.com 2019 - 2024. All rights reserved.