SlideShare a Scribd company logo
1 of 102
Selenium

     PHP
•       PHP

    •

    • twitter.com/suzuki
•       PHP   Selenium

    •           :-)
•       Web

•

    •

    • Selenium
Selenium-IDE
Selenium
Selenium-IDE
Selenium-IDE
•
Web
•

    •

    •
Selenium




Web
• Selenium

 •

 •
•

    •

    • UI
Selenium-IDE
Selenium-IDE



• Selenium-IDE   →

 •
http://croogo.org/
Croogo

         http://twitter.com/fahad19


Croogo

         http://twitter.com/makies
•

    •

    • blog

    • blog

    • blog
Username   Password

Log In
“You are logged in as Admin”
blog


Blog

         Slug   Body

Submit
blog

“Blog has been saved”
blog




Submit
blog

“Blog has been saved”




          Blog
blog




Blog
blog
Demo



• Selenium-IDE

 •           Blog
TIPS
•

    •   Blog    2

•



•
•

    •

    •     <table>

    •   HTML
•

    •

    •           HTML
        <a>      <table>

    •         HTML
Demo




•
Click




ClickAndWait
Body



Body
       ...
Body

Firebug

<iframe id=”NodeBody_ifr”>

 <html>

  <head>

  <body id=”tinymce”>
Body


• Body

 • <iframe>

 •       <body>
Body



• type

• JavaScript    ...
Body


getEval
JavaScript
Body

• Firebug

document
 .getElementById('NodeBody_ifr')
  .contentWindow
    .document
     .getElementById('tinymce')
      .innerHTML = '            ';
Body
Body

• Selenium

this.page().getDocument()
 .getElementById('NodeBody_ifr')
  .contentWindow
    .document
     .getElementById('tinymce')
      .innerHTML = '            ';
Body




Body

       ...
•



•   Blog
•

•
    OK   ...

•
•   Body



•
•   ...

•
“You are logged in as Admin”
• assertTextPresent
•
blog

“Blog has been saved”
blog




• verifyTextPresent :

• ${blog_title} : store
blog

“Blog has been saved”




          Blog
blog




•   Web

• ${blog_title} / ${blog_body}
blog
blog




• assertTextNotPresent :
• assertTextPresent
• verifyTextPresent
 •

• assertTextNotPresent
• verifyTextNotPresent
 •
• assertChecked
 •



• assertElementPresent
 •
• assertTitle
 • <title>※</title>

• assertValue
 • value=”※”
• assertCookieByName
 •             Cookie

• assertMouseSpeed
 • mousemove
DEMO



•
•     link=       <a>   </a>

•

    • id=     / name=   / css=
• DOM
 • dom=

• XPath
 • xpath=//input[@value='Submit']
link=
<a href=”/croogo/admin/nodes/edit/27”>
<a href=”/croogo/admin/nodes/edit/21”>

<a href=”/croogo/admin/nodes/edit/20”>
ID
ID

•

    •

    •

    •   ID
ID



•
• user-extentions.js
 •         JavaScript
ID

•

    •

    •

    •   ID
function getIdFromContentTitle(title) {
    var id = 0;
    var doc   = selenium.page().getDocument();
    var form = doc.getElementById('NodeAddForm');
    var table = form.getElementsByTagName('table');
    var tbody = table[0].getElementsByTagName('tbody');
    var tr    = tbody[0].getElementsByTagName('tr');
for (y = 1; y < tr.length; ++y) {
        var td   = tr[y].getElementsByTagName('td');
        var text = td[2].getElementsByTagName('a')[0].innerHTML;
        if (text == title) {
            id = td[1].innerHTML;
            break;
        }
    }
    return id;
}
echo
user-extentions


function getIdFromContentTitle(title) {
    var id = 0;

    var   doc     =   selenium.page().getDocument();
    var   form    =   doc.getElementById('NodeAddForm');
    var   table   =   form.getElementsByTagName('table');
    var   tbody   =   table[0].getElementsByTagName('tbody');
    var   tr      =   tbody[0].getElementsByTagName('tr');
user-extentions




 var doc   =   selenium.page().getDocument();
selenium
this.page().getDocument()



                                document



selenium.page().getDocument()
XPath




• //input[@value=”Submit”]
 • value     Submit
   <input>
XPath




• Firebug

 • XPath
XPath




• Firebug   HTML
XPath




• XPath
XPath




•
    XPath
XPath



•
    XPath

• //input[@value=”Submit”]

    •
XPath




• XPath            Firebug

 • $x(“ XPath “)
XPath




•

    •
XPath




•
Selenium-IDE


•            Selenium-RC

•
•
PHP



function testMyTestCase() {
    //
    blog_title = "              ";
    blog_slug = "hellow_hokkaido";
    blog_body = "                    ";
}
• Selenium-IDE

•            →   ...→

    • PHP→

     •

     •
•   :-)
Selenium AES




• Selenium Auto Exec Server
 • http://www.enjoyxstudy.com/selenium/autoexec/
Selenium AES

•

    •

• Subversion

    •
• Selenium

•



•

    •        :-)
Selenium
•   Selenium
    http://wiki.openqa.org/display/SEL/Selenium+0.7+Reference+(Japanese)

•   Selenium
            XPath JavaScript
    http://d.hatena.ne.jp/language_and_engineering/20090818



•
Photograph Credits

•
    http://www.flickr.com/photos/jonbro/3356460039/
•
    http://www.flickr.com/photos/elvire-r/2451784799/
•
    http://www.flickr.com/photos/citycaucus/4260121599/
Photograph Credits


•
    http://www.flickr.com/photos/racatumba/88846892/
    http://www.flickr.com/photos/laszlo-photo/286757494/
• JEDI
  http://www.flickr.com/photos/ggunter/539625103/
•

More Related Content

What's hot

How I Learned to Stop Worrying and Love jQuery (Jan 2013)
How I Learned to Stop Worrying and Love jQuery (Jan 2013)How I Learned to Stop Worrying and Love jQuery (Jan 2013)
How I Learned to Stop Worrying and Love jQuery (Jan 2013)
David Giard
 
The go-start webframework (GTUG Vienna 27.03.2012)
The go-start webframework (GTUG Vienna 27.03.2012)The go-start webframework (GTUG Vienna 27.03.2012)
The go-start webframework (GTUG Vienna 27.03.2012)
ungerik
 

What's hot (20)

You're Doing it Wrong - WordCamp Atlanta
You're Doing it Wrong - WordCamp AtlantaYou're Doing it Wrong - WordCamp Atlanta
You're Doing it Wrong - WordCamp Atlanta
 
Learn about Eclipse e4 from Lars Vogel at SF-JUG
Learn about Eclipse e4 from Lars Vogel at SF-JUGLearn about Eclipse e4 from Lars Vogel at SF-JUG
Learn about Eclipse e4 from Lars Vogel at SF-JUG
 
jQuery Loves Developers - Oredev 2009
jQuery Loves Developers - Oredev 2009jQuery Loves Developers - Oredev 2009
jQuery Loves Developers - Oredev 2009
 
Introduction To Ruby Watir (Web Application Testing In Ruby)
Introduction To Ruby Watir (Web Application Testing In Ruby)Introduction To Ruby Watir (Web Application Testing In Ruby)
Introduction To Ruby Watir (Web Application Testing In Ruby)
 
Jquery Complete Presentation along with Javascript Basics
Jquery Complete Presentation along with Javascript BasicsJquery Complete Presentation along with Javascript Basics
Jquery Complete Presentation along with Javascript Basics
 
Associations & JavaScript
Associations & JavaScriptAssociations & JavaScript
Associations & JavaScript
 
jQuery Features to Avoid
jQuery Features to AvoidjQuery Features to Avoid
jQuery Features to Avoid
 
YQL & Yahoo! Apis
YQL & Yahoo! ApisYQL & Yahoo! Apis
YQL & Yahoo! Apis
 
What you can do In WatiR
What you can do In WatiRWhat you can do In WatiR
What you can do In WatiR
 
jQuery
jQueryjQuery
jQuery
 
How I Learned to Stop Worrying and Love jQuery (Jan 2013)
How I Learned to Stop Worrying and Love jQuery (Jan 2013)How I Learned to Stop Worrying and Love jQuery (Jan 2013)
How I Learned to Stop Worrying and Love jQuery (Jan 2013)
 
jQuery UI and Plugins
jQuery UI and PluginsjQuery UI and Plugins
jQuery UI and Plugins
 
20180517 megurocss@1th
20180517 megurocss@1th20180517 megurocss@1th
20180517 megurocss@1th
 
watir-webdriver
watir-webdriverwatir-webdriver
watir-webdriver
 
Plone Interactivity
Plone InteractivityPlone Interactivity
Plone Interactivity
 
The go-start webframework (GTUG Vienna 27.03.2012)
The go-start webframework (GTUG Vienna 27.03.2012)The go-start webframework (GTUG Vienna 27.03.2012)
The go-start webframework (GTUG Vienna 27.03.2012)
 
Watir web automated tests
Watir web automated testsWatir web automated tests
Watir web automated tests
 
Codegnitorppt
CodegnitorpptCodegnitorppt
Codegnitorppt
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuery
 
2017年のteratailでやらかした話をしたい 20171213 _#9 _teratail_meetup
2017年のteratailでやらかした話をしたい 20171213 _#9 _teratail_meetup2017年のteratailでやらかした話をしたい 20171213 _#9 _teratail_meetup
2017年のteratailでやらかした話をしたい 20171213 _#9 _teratail_meetup
 

Viewers also liked

Unit 6 my school timetable
Unit 6 my school timetableUnit 6 my school timetable
Unit 6 my school timetable
Huyen Khoi
 
NOFS_konferenssi 26_08_2015 FINAL
NOFS_konferenssi 26_08_2015 FINALNOFS_konferenssi 26_08_2015 FINAL
NOFS_konferenssi 26_08_2015 FINAL
Antti Koivula
 
Mock ups further.
Mock ups further.Mock ups further.
Mock ups further.
laurenfoxy
 
Presentacion de-materiales-compuestos-3
Presentacion de-materiales-compuestos-3Presentacion de-materiales-compuestos-3
Presentacion de-materiales-compuestos-3
Damian Jiménez
 

Viewers also liked (15)

Madeline Moore Resume
Madeline Moore ResumeMadeline Moore Resume
Madeline Moore Resume
 
x
xx
x
 
Unit 6 my school timetable
Unit 6 my school timetableUnit 6 my school timetable
Unit 6 my school timetable
 
NOFS_konferenssi 26_08_2015 FINAL
NOFS_konferenssi 26_08_2015 FINALNOFS_konferenssi 26_08_2015 FINAL
NOFS_konferenssi 26_08_2015 FINAL
 
4. proposal
4. proposal4. proposal
4. proposal
 
Рекомендований графік
Рекомендований графікРекомендований графік
Рекомендований графік
 
Letis resume
Letis resumeLetis resume
Letis resume
 
Project speech
Project speechProject speech
Project speech
 
Mock ups further.
Mock ups further.Mock ups further.
Mock ups further.
 
UpdateResume
UpdateResumeUpdateResume
UpdateResume
 
2014 Social Media Strategies Summit Presentation - June 18, 2014
2014 Social Media Strategies Summit Presentation - June 18, 20142014 Social Media Strategies Summit Presentation - June 18, 2014
2014 Social Media Strategies Summit Presentation - June 18, 2014
 
Sijoittajanvastuu pankkien ongelmatilanteissa
Sijoittajanvastuu pankkien ongelmatilanteissaSijoittajanvastuu pankkien ongelmatilanteissa
Sijoittajanvastuu pankkien ongelmatilanteissa
 
Work&amp;lifecafe uniikkiura oy_kaisavälivehmas_7.4.2016
Work&amp;lifecafe uniikkiura oy_kaisavälivehmas_7.4.2016Work&amp;lifecafe uniikkiura oy_kaisavälivehmas_7.4.2016
Work&amp;lifecafe uniikkiura oy_kaisavälivehmas_7.4.2016
 
Presentacion de-materiales-compuestos-3
Presentacion de-materiales-compuestos-3Presentacion de-materiales-compuestos-3
Presentacion de-materiales-compuestos-3
 
Ernesto C. Perez
Ernesto C. PerezErnesto C. Perez
Ernesto C. Perez
 

Similar to Selenium再入門

SharePoint & jQuery Guide - SPSNashville 2014
SharePoint & jQuery Guide - SPSNashville 2014SharePoint & jQuery Guide - SPSNashville 2014
SharePoint & jQuery Guide - SPSNashville 2014
Mark Rackley
 
Integration Test Cucumber + Webrat + Selenium
Integration Test Cucumber + Webrat + SeleniumIntegration Test Cucumber + Webrat + Selenium
Integration Test Cucumber + Webrat + Selenium
tka
 

Similar to Selenium再入門 (20)

jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
 
bcgr3-jquery
bcgr3-jquerybcgr3-jquery
bcgr3-jquery
 
bcgr3-jquery
bcgr3-jquerybcgr3-jquery
bcgr3-jquery
 
JQuery
JQueryJQuery
JQuery
 
JQuery
JQueryJQuery
JQuery
 
Breaking the limits_of_page_objects
Breaking the limits_of_page_objectsBreaking the limits_of_page_objects
Breaking the limits_of_page_objects
 
SharePoint & jQuery Guide - SPSNashville 2014
SharePoint & jQuery Guide - SPSNashville 2014SharePoint & jQuery Guide - SPSNashville 2014
SharePoint & jQuery Guide - SPSNashville 2014
 
Integration Test Cucumber + Webrat + Selenium
Integration Test Cucumber + Webrat + SeleniumIntegration Test Cucumber + Webrat + Selenium
Integration Test Cucumber + Webrat + Selenium
 
The Future of Plugin Dev
The Future of Plugin DevThe Future of Plugin Dev
The Future of Plugin Dev
 
J query module1
J query module1J query module1
J query module1
 
SPTechCon DevDays - SharePoint & jQuery
SPTechCon DevDays - SharePoint & jQuerySPTechCon DevDays - SharePoint & jQuery
SPTechCon DevDays - SharePoint & jQuery
 
DirectToWeb 2.0
DirectToWeb 2.0DirectToWeb 2.0
DirectToWeb 2.0
 
Advanced JQuery Mobile tutorial with Phonegap
Advanced JQuery Mobile tutorial with Phonegap Advanced JQuery Mobile tutorial with Phonegap
Advanced JQuery Mobile tutorial with Phonegap
 
J query
J queryJ query
J query
 
SPTechCon Boston 2015 - Utilizing jQuery in SharePoint
SPTechCon Boston 2015 - Utilizing jQuery in SharePointSPTechCon Boston 2015 - Utilizing jQuery in SharePoint
SPTechCon Boston 2015 - Utilizing jQuery in SharePoint
 
前端MVC之BackboneJS
前端MVC之BackboneJS前端MVC之BackboneJS
前端MVC之BackboneJS
 
Jquery fundamentals
Jquery fundamentalsJquery fundamentals
Jquery fundamentals
 
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD Combination
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD CombinationLotusphere 2012 Speedgeeking - jQuery & Domino, a RAD Combination
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD Combination
 
Write Less Do More
Write Less Do MoreWrite Less Do More
Write Less Do More
 
Jquery
JqueryJquery
Jquery
 

Recently uploaded

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 

Selenium再入門