浏览器交互
获取浏览器信息
获取标题
从浏览器中读取当前页面的标题:
String title = driver.getTitle();
title = driver.title
driver.Title;
current_title = driver.title
let title = await driver.getTitle();
driver.title
获取当前 URL
您可以从浏览器的地址栏读取当前的 URL,使用:
String url = driver.getCurrentUrl();
url = driver.current_url
driver.Url;
current_url = driver.current_url
let currentUrl = await driver.getCurrentUrl();
driver.currentUrl