答案 0 :(得分:2)
要摆脱警告,您可以为字段添加getter和setter。
public SelenideElement getOldPassword(){
return this.oldPassword;
}
public void setOldPassword(SelenideElement oldPassword){
this.oldPassword = oldPassword;
}
答案 1 :(得分:1)
此警告是由“未使用的声明”检查产生的,该检查不知道@FindBy
批注。要进行讲授,请将文本光标放在字段名称上,键入 Alt + Enter 并调用Suppress unused warning if annotated by '@FindBy'
操作。之后,它将不再对由该注释注释的任何字段发出警告。
该操作会将意图添加到内部“标记为注释时隐式书写的标记字段”列表中。单击Annotations...
标签下的Entry points
按钮,也可以在检查设置中找到该设置。