我面临一个问题,我无法从下拉列表中选择元素以继续进行。
参考网站的 URL 是“ http://www.rechargeitnow.com/needrecharge.jspx ”
我尝试了下面的代码,但没有成功。
//WebDriverWait wait = new WebDriverWait(driver, 10);
//WebElement element = wait.until(ExpectedConditions.elementToBeClickable(By.id("someid")));
WebDriverWait wait= new WebDriverWait(driver, 10);
WebElement element = wait.until(ExpectedConditions.elementToBeClickable(By.id("opId_div")));
//driver.findElement(By.cssSelector("select[id='operatorid']")).sendKeys("Airtel");;
//driver.findElement(By.linkText("mobile")).sendKeys("Airtel");
//driver.findElement(By.xpath("//*[@id='oprauto']")).click();
//driver.findElement(By.xpath("/html/body/div[2]/div/div[6]/div/div/div/div/div[2]/div/div/div/div/div[2]/select/option[5]")).findElement(By.name("Airtel"));
//operator.selectByIndex(1);
//driver.findElement(By.xpath("//*[@id='oprauto']")).sendKeys("Airtel");
driver.findElement(By.xpath("/html/body/div[2]/div/div[6]/div/div[3]/ul/li[3]/img")).click();
//Select operator=new Select(driver.findElement(By.id("operatorid")));
//operator.getOptions();
//operator.selectByVisibleText("Airtel");
driver.findElement(By.tagName(" mobile no. ")).sendKeys("9001785845");
driver.findElement(By.id("transSubscriptionNoID")).sendKeys("9001457868");
//driver.findElement(By.cssSelector("img[id='btn']")).submit();
//driver.findElement(By.id("btn")).submit();
driver.findElement(By.xpath("//*[@id='btn']"));