SlideShare a Scribd company logo
1 of 18
第1回

日本Seleniumユーザコミュニティ勉強会

Jenkins × Selenium 最初の一歩

玉川紘子
@nkns165

1
自己紹介
名前:玉川 紘子(たまがわ ひろこ)
所属:株式会社SHIFT ソフトウェアテスト事業部
CI/自動テスト導入担当として活動
コミュニティ:STAR(テスト自動化研究会)
日本Jenkinsユーザ会

2
SeleniumでCI(継続的インテグレーション)
■Seleniumのテストを作成しただけでは…
•
•
•

誰かがそのテストを実行しなければいけない
テスト結果の確認、実行履歴の管理など周辺作業が残る
仕様が変わったらテストのメンテナンスが必要

→ チームの意識が高くないと、すぐにテストが陳腐化してしまう
■Jenkinsとは
•
•
•

→

フリーのCI(継続的インテグレーション)ツール
GUI中心の直観的な操作で様々な設定が可能
Seleniumを始めとした様々なテストツールと連携が可能

予めテストケースを登録しておくと、
定期的に自動実行・結果通知・レポートの出力・
履歴管理まで行ってくれる

3
実行環境のイメージ
テストコードを含む
リソースを集約

コミット
テスト
コード
自動テスト担当

テスト
指示

バージョン管理

画面
キャプチャ

メールやSkypeで
フィードバック

テスト
レポート

テスト用
クライアント

テストレポートを表示

開発担当

テスト環境

本番環境

4
Seleniumのテストを補助してくれる
様々なプラグイン
•
•
•
•
•
•
•
•
•

Selenium AES plugin(549)
Seleniumhq plugin(1712)
Selenium Builder plugin(251)
TestingBot Selenium plugin(105)
seleniumhtmlreport plugin(1404)
Selenium RC plugin(643)
Selenium plugin(1118)
Selenium Axis plugin(33)
Selenium Grails plugin(不明)

※()内は2013年12月のダウンロード数
5
何だかんだ言ってまだ現役
Selenium IDEを使っている場合
•
•
•
•
•
•
•
•
•

Selenium AES plugin(549)
Seleniumhq plugin(1712)
Selenium Builder plugin(251)
TestingBot Selenium plugin(105)
seleniumhtmlreport plugin(1404)
Selenium RC plugin(643)
Selenium plugin(1118)
Selenium Axis plugin(33)
Selenium Grails plugin(不明)

6
IDEで記録・編集したHTMLを
設定するだけでテスト実行が可能

*firefox

http://example.com
suite/01.html
result/01.html

IDEでプラグインを使っている場合は
対応するJavaScriptの設定が必要。
その他、ポートの設定など

-userExtensions userextensions.js -port 4445

7
見慣れたテスト結果に加えて、
OK/NG数の遷移も見られる
青:OK
赤:NG

8
TestSuiteが多い場合は、
seleniumhtmlreport pluginで見やすく表示

9
Selenium2(WebDriver)を使っている場合
•
•
•
•
•
•
•
•
•

Selenium AES plugin(549)
Seleniumhq plugin(1712)
Selenium Builder plugin(251)
明示的なSelenium用のプラグインは
TestingBot Selenium plugin(105)
不要
seleniumhtmlreport plugin(1404)
Selenium RC plugin(643)
Selenium plugin(1118)
Selenium Axis plugin(33)
Selenium Grails plugin(不明)

10
xUnit形式のテスト結果を生成すれば
自動的にテストレポートが出来る
 Javaの場合はAnt, Mavenなどのビルドツールから起動
 他の言語でもたいていはプラグインが存在する
 なければシェルスクリプト or Windowsバッチで代替
Mavenの場合
テスト実行

レポート生成

11
xUnit形式で出力することの利点
 「いつからそのテストが失敗しているのか」すぐに分かる
 Seleniumhq pluginでは出来ない機能
 ソースコードの変更履歴と比較すれば、どのコミットで問
題が起きたかも分かる

12
Selenium Gridを使って並列テストを実行したい
•
•
•
•
•
•
•
•
•

Selenium AES plugin(549)
Seleniumhq plugin(1712)
Selenium Builder plugin(251)
TestingBot Selenium plugin(105)
seleniumhtmlreport plugin(1404)
Selenium RC plugin(643)
Selenium plugin(1118)
Selenium Axis plugin(33)
Selenium Grails plugin(不明)

13
Jenkinsのマスタ-スレーブ機能
× Selenium Grid
たくさんのNodeを管理し、
いちいちサーバ起動するのは面倒

Node

テスト用
クライアント

テスト用
クライアント

テスト用
クライアント

Selenium Hub

テスト用
クライアント

14
Selenium pluginを使った設定
ブラウザの種類などを設定するだけで、
簡単にSelenium Gridが完成
「selenium-client」という
ラベルをつけたスレーブを
SeleniumのNodeにする

そのスレーブでは
Firefoxを3インスタンス
起動する

15
JenkinsでSeleniumのテストをするときに
気をつけること
 テスト環境はなるべく専用のものを用意する
 繰り返しテスト実行しても問題ないように、データの初期
化の仕組みを作る
 ジョブは機能のカテゴリごとに小分けにして作る
 失敗したときに修正のモチベーションが湧きやすい

 失敗の解析がしやすいよう、スクリーンショットをとる
 JUnitの場合 http://softwaretest.jp/labo/tech/labo-298/

16
まとめ

Jenkinsで、Seleniumの魅力を
最大限に活用しよう!

 Selenium IDE / WebDriverのテスト実行
 レポート表示
 Gridを使った並列テスト実行、マルチOS/
マルチブラウザテスト

17
ご清聴ありがとうございました!

18

More Related Content

More from Hiroko Tamagawa

20200516 selenium-meetup-winappdriver
20200516 selenium-meetup-winappdriver20200516 selenium-meetup-winappdriver
20200516 selenium-meetup-winappdriverHiroko Tamagawa
 
20170809 start python_selenium
20170809 start python_selenium20170809 start python_selenium
20170809 start python_seleniumHiroko Tamagawa
 
第9回Jenkins勉強会 超簡単Pipeline講座
第9回Jenkins勉強会 超簡単Pipeline講座第9回Jenkins勉強会 超簡単Pipeline講座
第9回Jenkins勉強会 超簡単Pipeline講座Hiroko Tamagawa
 
脱・独自改造! GebでWebDriverをもっとシンプルに
脱・独自改造! GebでWebDriverをもっとシンプルに脱・独自改造! GebでWebDriverをもっとシンプルに
脱・独自改造! GebでWebDriverをもっとシンプルにHiroko Tamagawa
 
20131201 テスト自動化カンファレンスLT「激しいUI変更との戦い」
20131201 テスト自動化カンファレンスLT「激しいUI変更との戦い」20131201 テスト自動化カンファレンスLT「激しいUI変更との戦い」
20131201 テスト自動化カンファレンスLT「激しいUI変更との戦い」Hiroko Tamagawa
 
20121019 jenkins勉強会lt資料
20121019 jenkins勉強会lt資料20121019 jenkins勉強会lt資料
20121019 jenkins勉強会lt資料Hiroko Tamagawa
 

More from Hiroko Tamagawa (6)

20200516 selenium-meetup-winappdriver
20200516 selenium-meetup-winappdriver20200516 selenium-meetup-winappdriver
20200516 selenium-meetup-winappdriver
 
20170809 start python_selenium
20170809 start python_selenium20170809 start python_selenium
20170809 start python_selenium
 
第9回Jenkins勉強会 超簡単Pipeline講座
第9回Jenkins勉強会 超簡単Pipeline講座第9回Jenkins勉強会 超簡単Pipeline講座
第9回Jenkins勉強会 超簡単Pipeline講座
 
脱・独自改造! GebでWebDriverをもっとシンプルに
脱・独自改造! GebでWebDriverをもっとシンプルに脱・独自改造! GebでWebDriverをもっとシンプルに
脱・独自改造! GebでWebDriverをもっとシンプルに
 
20131201 テスト自動化カンファレンスLT「激しいUI変更との戦い」
20131201 テスト自動化カンファレンスLT「激しいUI変更との戦い」20131201 テスト自動化カンファレンスLT「激しいUI変更との戦い」
20131201 テスト自動化カンファレンスLT「激しいUI変更との戦い」
 
20121019 jenkins勉強会lt資料
20121019 jenkins勉強会lt資料20121019 jenkins勉強会lt資料
20121019 jenkins勉強会lt資料
 

Recently uploaded

論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNet論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNetToru Tamaki
 
TSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdfTSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdftaisei2219
 
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介Yuma Ohgami
 
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)Hiroki Ichikura
 
論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A survey論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A surveyToru Tamaki
 
SOPを理解する 2024/04/19 の勉強会で発表されたものです
SOPを理解する       2024/04/19 の勉強会で発表されたものですSOPを理解する       2024/04/19 の勉強会で発表されたものです
SOPを理解する 2024/04/19 の勉強会で発表されたものですiPride Co., Ltd.
 
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略Ryo Sasaki
 
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...Toru Tamaki
 
スマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システムスマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システムsugiuralab
 

Recently uploaded (9)

論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNet論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNet
 
TSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdfTSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdf
 
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
 
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
 
論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A survey論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A survey
 
SOPを理解する 2024/04/19 の勉強会で発表されたものです
SOPを理解する       2024/04/19 の勉強会で発表されたものですSOPを理解する       2024/04/19 の勉強会で発表されたものです
SOPを理解する 2024/04/19 の勉強会で発表されたものです
 
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
 
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
 
スマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システムスマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システム
 

20140118 selenium勉強会 - Jenkins×Selenium 最初の一歩-