Last active
February 8, 2020 17:17
-
-
Save mkht/b097ff8d6a5a0ed6b74eaf75cc6a45c8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using module PSWebDriver | |
Describe 'DuckDuckGo' { | |
BeforeAll { | |
$Browser = New-PSWebDriver 'Chrome' | |
} | |
It 'DuckDuckGoで「PowerShell」を検索' { | |
#ブラウザを起動 | |
$Browser.Start() | |
#DuckDuckGoを開く | |
$Browser.Open('https://duckduckgo.com/') | |
#検索ボックスに"PowerShell"と入力 | |
$Browser.SendKeys('id=search_form_input_homepage', 'PowerShell') | |
#検索ボタンをクリック | |
$Browser.Click('id=search_button_homepage') | |
#スクリーンショットを保存 | |
$Browser.SaveScreenShot('F:\screenshot.png') | |
} | |
AfterAll { | |
# ブラウザ終了 | |
$Browser.Quit() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment