最近開発をしていて、入力フォームが沢山ある案件で、あれを修正するとあっちの画面にもこっちの画面に影響する、といった現象が連鎖してしまい、段々と影響範囲をテストできなくなってきました。これを何とかするため、ついにSelenium WebDriverを使うようになりました。 このseleniumですが、ローカルで自分のマシンで起動する分にはブラウザがインストールされているので普通に起動できます。 しかしlinux等のXウインドウを起動していないコンソールのみのサーバだと、ブラウザはインストールされていないし、そもそも画面を表示できないためseleniumは起動しません。 本当ならwindowsサーバをAWS等で導入するのが最善ですが、お金がかかるのが嫌です。そこで前述のlinuxサーバでseleniumを起動する、xvfbを使ったヘッドレス(画面が無い)にseleniumを起動する方法を調べま
はじめに 「Xvfb Firefox」あたりでググれば出るんですけどね。環境失ったときのためにまとめておきます。 ブログの記事書くときなどにWebサイトのSSがあれば便利ですよね。俺の場合「トップページ」で現時点で10枚ほど使っていたりします。 後者は見栄えを良くするために同じ画像の大きさでないといけませんし、サイトのリニューアルがあった場合、キャプチャしなおさなくちゃなりません。 でも、いちいち手動でキャプチャするのは面倒臭い。かと言ってキャプチャしてくれるAPIは反応が遅いし、希望の画像サイズにならない、そしてなにより提供側に負荷がかかります。 で、せっかくVPSを借りている(そのVPS上で今のページも動いています)ので、そこで取ればいいんじゃないですか?という話です。 なにやら調べてみると、X(の仮想フレームバッファのXvfb)上でブラウザを立ち上げて、キャプチャする方法のようで
These days, when the phrase "headless browser" is mentioned, you immediately think of PhantomJS, but - there are alternatives. In this article, I am going to introduce a nice alternative you can use on Linux which allows you to run real browsers - Firefox and Chrome, headless - using Xvfb. What's Wrong With PhantomJS? PhantomJS is great tool and is widely used by companies and developers around th
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く