我试图将字符串从webelement转换为整数。无法将字符串值从Web元素转换为双倍
不过,我得到以下错误parseInt
public String getLoanAmount() {
return loanAmount.getText();
int i = Integer.parseInt(driver.findElement(By.id("00N28000001bbuD_ileinner"))).getText();
double d = i;
if ((d < 15000) || (d > 35000)) {
System.out.println("Error: Loan Amount should not be NULL and should be between 5000 to 35000 AUD.");
}
else {
System.out.println("Entered value in the Loan Amount field is within appropriate range.");
}
}
任何人都可以协助在这个问题上?首先这可能吗?并且是实现它的正确步骤?
该错误信息是明确的:你试图将字符串转换成该整数,它不能完成,很可能是因为字符串不是数字的表示。 –
@TimBiegeleisen你从哪里得到这些信息? – shmosel