Selenium 2 is a powerful browser emulator which enables you to automate frontend testing (especially JavaScript heavy pages). It can be used with Behat as well for BDD testing. I prefer using Goutte headless driver to test basic functionality and flow of the application but sometimes there are critical parts of the app that rely heavily on client side technologies like JavaScript. Only way to test
某所某日 お客様「この画面遷移が〜(延々)」俺「はい…」お客様「あっ、そういえばこの画面でこれ追加」俺「はい…」 … 俺「これ画面遷移マジ複雑だし、仕様変更の量半端ないし、これは後でエンバグするやろ…。自動テストしたい…、でもTwitter連携あるからなー。PHPだし…ちゃんとしたMechanizeみたいなのないし*1…seleniumしかないか…」 Seleniumやる前のイメージ ・なんかすごい面倒くさい ・なんか色々面倒くさい ・なんかめっちゃ面倒くさい ↓ ・しかたない、もうPerlでテスト書こうかな… やった後のイメージ ・複雑なことしなければ超カンタンじゃねーか!だまされた ・PHPで十分や!!! 手順 ・SeleniumServerをいれる ・PHPUnitで動くSeleniumのライブラリ入れる ・Seleniumのテストケースを生成するツールをいれる ・テストケース作る
FirefoxはSelenium2のドライバがデフォルトで同梱されているので、Google ChromeやIEのように別途ドライバをダウンロードしてくる必要がない。なので、Selenium Server Standaloneの起動は、-browser オプションを指定するだけですぐに使えるようになる。 $ java -jar selenium-server-standalone-2.42.2.jar -browser browserName=firefox,version=30,platform=MAC,maxInstances=2 しかし、Homebrew CaskでFirefoxをインストールした環境では、このコマンドではSeleniumのセッションを作ろうとすると、Firefoxのバイナリが見つからないという例外が発生してしまう。 例外の抜粋: java.util.concurren
Selenium-RCとは JUnit や TestNG などから Selenium によるインテグレーションテストを実行できる。本家は以下。 http://seleniumhq.org/ Selenium Server Selenium Server はテストコードなどから Selenium コマンドを受け、コマンドを実行し、結果を返却する。Selenium Server には Selenium Core のJavaScriptがバンドルされており、このサーバを通してブラウザ操作をエミュレートするテストが実施できる。 Client Libraries Client Libraries は Selenium コマンドをテストコードから実行できるようにするライブラリ。Javaや.Net Ruby など多くのプラットフォームがサポートされている。 インストール ダウンロードページ(http:/
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く