vendredi 17 juillet 2020

Value selected from the dropdown list should be passed to if statement in java

I tried to solve by using its selected value and thrown result to if statement but it is throwing a Syntax error ConstructorHeadername is expected.

public void selectPolicyType() {
    Select selectByValue = new Select(policytype_drpdown);
    selectByValue.selectByValue("01");
    System.out.println("Selected Policy Type");
    if (selectByValue == 01){
        System.out.println("Auto is selected");
    } else {
        System.out.println("Homeowners is selected");
    }
}

Aucun commentaire:

Enregistrer un commentaire