我尝试使用如下的简单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