【问题标题】:Error in file: on line 4: Importing test library 'Selenium2library' failed: ModuleNotFoundEr ror: No module named 'Selenium2library'文件错误:第 4 行:导入测试库“Selenium2library”失败:ModuleNotFoundEr 错误:没有名为“Selenium2library”的模块
【发布时间】:2021-06-04 11:45:51
【问题描述】:

我是 RobotFrameWork 的新手,我目前正在我的机器上设置所有东西,以便能够在我的一些测试场景中使用这个工具。

我遇到的问题如下:

(venv) C:\Users\aharo\PycharmProjects\Automation>robot Salesforce/Login.robot
[ ERROR ] Error in file 'C:\Users\aharo\PycharmProjects\Automation\Salesforce\Login.robot' on line 4: Importing test library 'Selenium2library' failed: ModuleNotFoundEr
ror: No module named 'Selenium2library'
Traceback (most recent call last):
  None

我当前的机器人文件是这样设置的:



*** Settings ***
Library  Selenium2library

*** Variables ***

*** Test Cases ***
LoginTest
    open browser                https://test.salesforce.com/    chrome
    input text  id:username [my_username]
    input text  id:password [my_password]
    click element   xpath: //input[@id='Login']
    clsoe browser


*** Keywords ***


但是,我不确定我在哪里犯了错误。我目前使用的是 Windows 10,并且我已经安装了插件和正确的软件包。

我还应该做什么?

【问题讨论】:

    标签: python automation robotframework ui-automation


    【解决方案1】:

    Selenium2library 的大小写错误 - 它被命名为 Selenium2Library(大写“L”)。此外,该库非常旧且不受支持。你应该升级到SeleniumLibrary

    【讨论】:

      猜你喜欢
      • 2015-12-06
      • 2018-01-15
      • 2017-03-30
      • 2019-11-27
      • 2020-02-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多