RobotFramework / Java - 第一个arg无法被强制转换为org.openqa.selenium.WebElement

时间:2017-03-19 20:54:44

标签: java robotframework selenium2library

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

0 个答案:

没有答案