package test;
創(chuàng)新互聯(lián)公司IDC提供業(yè)務(wù):成都機(jī)柜租用,成都服務(wù)器租用,成都機(jī)柜租用,重慶服務(wù)器租用等四川省內(nèi)主機(jī)托管與主機(jī)租用業(yè)務(wù);數(shù)據(jù)中心含:雙線機(jī)房,BGP機(jī)房,電信機(jī)房,移動(dòng)機(jī)房,聯(lián)通機(jī)房。
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.support.ui.Select;
import org.testng.annotations.Test;
public class lesson7 {
@Test
public void test() throws InterruptedException{
System.setProperty("webdriver.chrome.driver", "D:/01 Learn WebDriver/chromedriver.exe");
WebDriver dr = new ChromeDriver();
dr.manage().window().maximize();
dr.get("http://tieba.baidu.com/f/search/adv?red_tag=o2706168053");
Thread.sleep(2000);
//下拉框處理
Select s1 = new Select(dr.findElement(By.name("rn")));
//s1.selectByIndex(1);
//s1.selectByValue("30");
s1.selectByVisibleText("每頁(yè)顯示20條");
//dr.quit();
}
}