I am trying to simulate a test case where i have to select multiple option from a multipleselect box. i can do this using select. however i am getting following error as soon as i instantiate select.
“Cannot instantiate the type Select”
my code is:
import java.awt.List;
import java.util.ArrayList;
import junit.framework.Assert;
import org.apache.bcel.generic.Select;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.ExpectedCondition;
import org.openqa.selenium.support.ui.WebDriverWait;
public class SeleniumFormTesting {
//piece of code to open the browser in firefox
Select selectBox = new Select(driver.findElement(By
.cssSelector("select#id_contact")));
//in above select statement the error comes
}
can someone please help me in getting rid of this problem
Try using the
Selectimport package. You can import it into your project using:import org.openqa.selenium.support.ui.Select;