RELATEED CONSULTING
相关咨询
选择下列产品马上在线沟通
服务时间:8:30-17:00
你可能遇到了下面的问题
关闭右侧工具栏

新闻中心

这里有您想知道的互联网营销解决方案
Se(9)---下拉框处理

package test;

创新互联公司IDC提供业务:成都机柜租用,成都服务器租用,成都机柜租用,重庆服务器租用等四川省内主机托管与主机租用业务;数据中心含:双线机房,BGP机房,电信机房,移动机房,联通机房。

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("每页显示20条");

//dr.quit();

}

}


当前文章:Se(9)---下拉框处理
链接地址:http://sczitong.cn/article/gcjsoh.html