2

我正在尝试使用如下简单的 Java 函数并将这个库调用到 Robotframework 中。它使我陷入错误。博客中的相关问题并非特定于 RF。有人请帮助我如何处理这个问题。

import org.openqa.selenium.WebElement;

public class GoForward {
public static final String ROBOT_LIBRARY_SCOPE = "GLOBAL";
public WebElement moveForward(WebElement element){
    element.click();
    return element;
}
}

机器人框架代码:

 *** Settings ***
Library  Selenium2Library
Library  keywords.Storetexts
Library  keywords.GoForward
*** Keyword ***
Click Forward Button
  move forward  ${forward_button}
  sleep  2s

错误:

TypeError: moveForward(): 1st arg can't be coerced to org.openqa.selenium.WebElement
4

0 回答 0