求知 文章 文库 Lib 视频 iPerson 课程 认证 咨询 工具 讲座 Model Center   模型库  
会员   
 


MBSE从理论方法到工作实践
8月26-27日 北京+线上



大模型核心技术RAG、MCP与智能体实践
8月14-15日 厦门



图数据库与知识图谱
8月28-29日 北京+线上
 
 
  Selenium鏁欑▼
Selenium姒傝堪
Selenium IDE
Selenium IDE涓嬭浇
Selenium IDE 宸ュ叿鐗圭偣
Selenium IDE娴嬭瘯鍒涘缓
Selenium IDE娴嬭瘯
Selenium IDE楠岃瘉鐐
Selenium - IDE妯″紡鍖归厤
Selenium鐢ㄦ埛鎵╁睍
Selenium IDE- 涓嶅悓鐨勬祻瑙堝櫒
Selenium 鐜瀹夎璁剧疆
Selenium RC
Selenium - Selenese鍛戒护
Selenium Webdriver
Selenium瀹氫綅鍣
鏂囨湰妗嗙殑鐩镐簰浣滅敤
鍗曢夋寜閽簰鍔
澶嶉夋浜や簰
涓嬫媺妗嗕氦浜
Synchronization 鍚屾
鎷栨斁
閿洏鎿嶄綔
榧犳爣鎿嶄綔
澶氶夋嫨鎿嶄綔
鏌ユ壘鎵鏈夐摼鎺
Selenium娴嬭瘯璁捐鎶鏈
Selenium椤甸潰瀵硅薄妯″瀷
浣跨敤Excel鏁版嵁椹卞姩
log4j鏃ュ織
寮傚父澶勭悊
澶氭祻瑙堝櫒娴嬭瘯
鎹曟崏灞忓箷鎴浘
鎹曟崏瑙嗛
Selenium TestNG
Selenium缃戞牸
 
 

单选按钮互动
1325 次浏览
12次  

单选按钮互动

在本节中,我们将了解如何使用单选按钮交互。我们可以使用“click”方法,并取消选择使用相同的“click”方法选择一个单选按钮的选项。

让我们明白,如何使用单选按钮交互- http://www.calculator.net/mortgage-payoff-calculator.htmll。我们还可以检查是否选择或使能的单选按钮。

import java.util.concurrent.TimeUnit;
import org.openqa.selenium.*;
import org.openqa.selenium.firefox.FirefoxDriver;

public class webdriverdemo
{
public static void main(String[] args) throws InterruptedException
{
WebDriver driver = new FirefoxDriver();

//Puts a Implicit wait, Will wait for 10 seconds before throwing exception
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);


//Launch website
driver.navigate().to("http://www.calculator.net/mortgage-payoff-calculator.htmll");
driver.manage().window().maximize();

// Click on Radio Button
driver.findElement(By.id("cpayoff1")).click();

System.out.println("The Output of the IsSelected " + driver.findElement(By.id("cpayoff1")).isSelected());
System.out.println("The Output of the IsEnabled " + driver.findElement(By.id("cpayoff1")).isEnabled());
System.out.println("The Output of the IsDisplayed " + driver.findElement(By.id("cpayoff1")).isDisplayed());

driver.close();

//Close the Browser.
driver.close();
}
}

输出

在执行时,被选中的单选按钮和命令的输出显示在控制台中。


您可以捐助,支持我们的公益事业。

1元 10元 50元





认证码: 验证码,看不清楚?请点击刷新验证码 必填



1325 次浏览
12次
 捐助