Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Se (9)-drop-down box processing

2025-03-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

Package test

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", "DJV 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)

/ / drop-down box processing

Select S1 = new Select (dr.findElement (By.name ("rn")

/ / s1.selectByIndex (1)

/ / s1.selectByValue ("30")

S1.selectByVisibleText ("20 per page")

/ / dr.quit ()

}

}

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report