• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Selenium再入門
 

Selenium再入門

on

  • 3,105 views

「Selenium-IDEを知って、すげーと思って、自分の操作 を記録して再生したら、あれ?うまくいかないぞ? ...

「Selenium-IDEを知って、すげーと思って、自分の操作 を記録して再生したら、あれ?うまくいかないぞ? でも今は調べている時間がないから、後で時間が あったら使ってみようと思ってそのままになっている人」向けの資料

Statistics

Views

Total Views
3,105
Views on SlideShare
3,083
Embed Views
22

Actions

Likes
4
Downloads
0
Comments
0

3 Embeds 22

http://coderwall.com 17
https://twitter.com 3
http://paper.li 2

Accessibility

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Selenium再入門 Selenium再入門 Presentation Transcript

    • Selenium PHP
    • • PHP • • twitter.com/suzuki
    • • PHP Selenium • :-)
    • • Web• • • Selenium
    • Selenium-IDE
    • SeleniumSelenium-IDESelenium-IDE
    • Web
    • • • •
    • SeleniumWeb
    • • Selenium • •
    • • • • UI
    • Selenium-IDE
    • Selenium-IDE• Selenium-IDE → •
    • http://croogo.org/
    • Croogo http://twitter.com/fahad19Croogo http://twitter.com/makies
    • • • • blog • blog • blog
    • Username PasswordLog In
    • “You are logged in as Admin”
    • blogBlog Slug BodySubmit
    • blog“Blog has been saved”
    • blogSubmit
    • blog“Blog has been saved” Blog
    • blogBlog
    • blog
    • Demo• Selenium-IDE • Blog
    • TIPS• • Blog 2••
    • • • • <table> • HTML
    • • • • HTML <a> <table> • HTML
    • Demo•
    • ClickClickAndWait
    • BodyBody ...
    • BodyFirebug<iframe id=”NodeBody_ifr”> <html> <head> <body id=”tinymce”>
    • Body• Body • <iframe> • <body>
    • Body• type• JavaScript ...
    • BodygetEvalJavaScript
    • Body• Firebugdocument .getElementById(NodeBody_ifr) .contentWindow .document .getElementById(tinymce) .innerHTML = ;
    • Body
    • Body• Seleniumthis.page().getDocument() .getElementById(NodeBody_ifr) .contentWindow .document .getElementById(tinymce) .innerHTML = ;
    • BodyBody ...
    • •• 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-extentionsfunction 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();
    • seleniumthis.page().getDocument() documentselenium.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•
    • PHPfunction 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/