【Selenium】5获取属性简单操作
来源:互联网 发布:正能量软件 编辑:程序博客网 时间:2024/05/20 21:45
①网页
driver.getTitle();网页标题driver.getPageSource();源代码driver.getCurrentUrl();URL
③getText():元素文本值
password.getText();
text.contains("");是否出现文本
text.startWith("");
text.endsWith("");
④isselected():存储复选框、单选框勾选情况
boolean isSelected=checkBox.isSelected();
⑤getTagName():元素标记名称
String tagName=username.getTagName();
⑥isEnagbled():input元素可编辑状态
boolean endable=username.isEnabled();
⑦isDisplayed():元素是否存在
boolean endable=username.isDisplayed();
⑧getAttribute():属性值,CSS属性值
username.getAttribute("value");username.getCssValue
⑨单机双击
WebElement login = driver.findElement(By.linkText("登陆"));login.click();
Actions builder=new Actions(driver);builder.doubleClick(login).build().perform();
⑩submit():用于指定元素所在的form元素进行提交,只要form中的元素使用submit(),会提交整个form
WebElement username = driver.findElement(By.linkText("user"));username.sendKeys("用户名");WebElement password = driver.findElement(By.linkText("user"));password.sendKeys("用户名");password.sendKeys("123");password.submit();
阅读全文
0 0
- 【Selenium】5获取属性简单操作
- selenium 获取属性
- selenium简单操作浏览器
- Python+selenium:获取一组元素属性值
- 【转】Selenium WebDriver的简单操作说明
- Selenium WebDriver的简单操作说明
- Selenium WebDriver的简单操作说明
- Selenium WebDriver的简单操作说明
- Selenium WebDriver的简单操作说明
- Selenium WebDriver的简单操作说明
- 【转】Selenium WebDriver的简单操作说明
- JAVA操作selenium的简单示例
- 属性动画简单操作
- 5、Selenium + Python 实现 UI 自动化测试-driver基本操作、属性
- python selenium 获取标签的属性值、内容、状态
- C# Selenium学习(三)-获取网页属性
- selenium 学习5 -- 基本操作
- selenium webdriver操作readonly属性的input框
- 使用 Swift 语言编程的优缺点
- 前端面试指南网络篇
- HDU1391 Number Steps
- DIY_DE2之DM9000A网卡调试系列例程(一)——准备工作
- 多字节与宽字节
- 【Selenium】5获取属性简单操作
- XAMPP配置虚拟主机操作
- TCP,UDP,HTTP,HTTPS(上)
- SpringMVC之“HelloWorld”起步
- c++中6种默认存在的函数
- java的设计模式
- 五子棋AI算法的实现
- UART-中断模式
- VS2010中添加lib库引用