I'm trying to work with simple Java function as below and calling this library into Robotframework. It throws me below error. Related issues in the blogs are not specific to RF. Someone please help me how to handle this.
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;
}
}
Robot Framework Code:
*** Settings ***
Library Selenium2Library
Library keywords.Storetexts
Library keywords.GoForward
*** Keyword ***
Click Forward Button
move forward ${forward_button}
sleep 2s
Error:
TypeError: moveForward(): 1st arg can't be coerced to org.openqa.selenium.WebElement