I want to pass an integer variable to web element using Sendkey function and i'm getting that integer vaiable from another class and passing through a method and calling in sendkey funciton but getting type casting error. I'm very new to selenium. Please help me to improve my selenium knowledge wider. Attached screen shot for your better understand.
public static WebElement setQuantityPage(WebDriver driver,int **individual_units**,int noOFCaseUnit, int noOfBox)
{
Select packType = new Select(driver.findElement(By.xpath(".//*[@id='fba-core-view-meta-data-pkg-type']/**strong text**dl/dd[1]")));
packType.selectByVisibleText("Individual products");
String type=packType.toString();
if(type.equalsIgnoreCase("Individual products"))
{
driver.findElement(By.xpath(".//*[@id='batch-update-number-cases']")).sendKeys(**individual_units**);
}
I'm asking for above bold letters.
else
{
}
return element;
}