ブラウザのインタラクション

ブラウザーの情報

タイトルの取得

ブラウザーから現在のページタイトルを読むことができます。

 String title = driver.getTitle();
title = driver.title
 String title = driver.Title;
 it 'gets the current title' do
 let title = await driver.getTitle();
driver.title

現在のURLを取得

ブラウザーのアドレスバーから現在のURLを読むには、次を使用します。

 String url = driver.getCurrentUrl();
url = driver.current_url
 String url = driver.Url;
 it 'gets the current url' do
 let currentUrl = await driver.getCurrentUrl();
driver.currentUrl