SlideShare a Scribd company logo
1 of 18
Download to read offline
Selenium for OPS
Admins Anonymous meetup #5
Lukasz Proszek
lukasz@proszek.info
2014-06-17
Background
You’re a BOFH at GlobalFskcup Ltd.
Everyday you deal with numerous incidends.
You have to seek approval and/or log every change made.
The Head of IT has his favorite tool for that
MacroHard PointShare form
Rich editor filled form, with sparkling format choosers.
Bells and whistles included
The soft problem
Filling the form takes 5-20 minutes each time
No PFY available to do the job
Keeping templates in a text document... sooooo 1990
Browser plugins - does not recognize all of provided inputs
curl - yeah right, like I have time for that
Selenium - basics
1 from selenium import webdriver
2 driver = webdriver.Firefox ()
3 driver.get("http :// google.com")
4 driver. find_element_by_id ("...")
how to identify element → inspect element
Selenium - interact with webelement
1 from selenium import webdriver
2 driver = webdriver.Firefox ()
3 driver.get("http :// google.com")
4 fld=driver. find_element_by_id (’gbqfq ’)
5 fld.send_keys(’Anonimowi Admini ’)
badumm tsss
Something more complicated
Show me the code
What the fsck?
Problem? HTML injection
the id is a hash of something... different everytime
Let’s get the RichEditor’s class
1 e = "table.ms -formtable > tbody >
2 tr:nth -of -type (7) > td.ms -formbody >
3 span[dir=’none ’] > div >
4 div:nth -of -type (2)"
5 c=driver. find_element_by_css_selector (e)
6 .get_attribute("class")
Problem? HTML injection
We can not use webdriver.send keys() on that... it’s
inside the html code
We have to inject HTML with javascript
1 JS="document. getElementsByClassName ({0})[{1}]
2 .innerHTML =’{2}’".format(
3 CLASS_NAME , INDEX ,
4 "<marquee > WTF </marquee >"
5 )
6 driver.execute_script(JS)
Clicking a radio button
1 driver. find_element_by_css_selector (
2 "input[type=’radio ’][ value =’{0}’]".format(
3 "Approved by the CEO"
4 )
5 ). click ()
Selecting a dropdown option
1 driver. find_element_by_css_selector (
2 "option[value =’{0}’]".format(value)
3 ). click ()
Sending the form
1 driver. find_elements_by_css_selector (
2 "input[value=’Save ’][type=’button ’]"
3 ). click ()
Many python, such win
208 lines of Python
virtualenv
selenium for browser automation (pip install selenium)
click for easy commandline (pip install click)
path.py just because (pip install path.py)
YAML for templates (pip instal pyYaML)
keepass for credentials (pip install keepass)
outcome, further plans, other uses
Outcome
It took 3hrs to write
It eared it’s keep after one day
Further plans
webdriver.PhantomJS() for headless operation
ansible integration
Other uses
e.g. testing how long it takes the user to perform some action
Thank You
wiki2beamer - latex-beamer made easy
impressive - pdf presentations with sugar added
http://github.com/frogu/presentations

More Related Content

What's hot

Intro Open Social and Dashboards
Intro Open Social and DashboardsIntro Open Social and Dashboards
Intro Open Social and DashboardsAtlassian
 
关于 Html5 那点事
关于 Html5 那点事关于 Html5 那点事
关于 Html5 那点事Sofish Lin
 
Usability in the GeoWeb
Usability in the GeoWebUsability in the GeoWeb
Usability in the GeoWebDave Bouwman
 
#3 HTML & CSS [know-how]
#3 HTML & CSS [know-how]#3 HTML & CSS [know-how]
#3 HTML & CSS [know-how]Dalibor Gogic
 
Node.js Authentication and Data Security
Node.js Authentication and Data SecurityNode.js Authentication and Data Security
Node.js Authentication and Data SecurityTim Messerschmidt
 
Front End Development: The Important Parts
Front End Development: The Important PartsFront End Development: The Important Parts
Front End Development: The Important PartsSergey Bolshchikov
 
Accessibility - A feature you can build
Accessibility - A feature you can buildAccessibility - A feature you can build
Accessibility - A feature you can buildMonika Piotrowicz
 
&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />tutorialsruby
 
HTML5 and the web of tomorrow!
HTML5  and the  web of tomorrow!HTML5  and the  web of tomorrow!
HTML5 and the web of tomorrow!Christian Heilmann
 
計算機概論20161205
計算機概論20161205計算機概論20161205
計算機概論20161205志宇 許
 
Html5的应用与推行
Html5的应用与推行Html5的应用与推行
Html5的应用与推行Sofish Lin
 
Web Standards: Fueling Innovation [Web Design World Boston '08]
Web Standards: Fueling Innovation [Web Design World Boston '08]Web Standards: Fueling Innovation [Web Design World Boston '08]
Web Standards: Fueling Innovation [Web Design World Boston '08]Aaron Gustafson
 
計算機概論20161212
計算機概論20161212計算機概論20161212
計算機概論20161212志宇 許
 

What's hot (20)

Intro Open Social and Dashboards
Intro Open Social and DashboardsIntro Open Social and Dashboards
Intro Open Social and Dashboards
 
HTML5 Essentials
HTML5 EssentialsHTML5 Essentials
HTML5 Essentials
 
关于 Html5 那点事
关于 Html5 那点事关于 Html5 那点事
关于 Html5 那点事
 
Intro to html 5
Intro to html 5Intro to html 5
Intro to html 5
 
Api
ApiApi
Api
 
Usability in the GeoWeb
Usability in the GeoWebUsability in the GeoWeb
Usability in the GeoWeb
 
#3 HTML & CSS [know-how]
#3 HTML & CSS [know-how]#3 HTML & CSS [know-how]
#3 HTML & CSS [know-how]
 
Node.js Authentication and Data Security
Node.js Authentication and Data SecurityNode.js Authentication and Data Security
Node.js Authentication and Data Security
 
Css, xhtml, javascript
Css, xhtml, javascriptCss, xhtml, javascript
Css, xhtml, javascript
 
Front End Development: The Important Parts
Front End Development: The Important PartsFront End Development: The Important Parts
Front End Development: The Important Parts
 
Accessibility - A feature you can build
Accessibility - A feature you can buildAccessibility - A feature you can build
Accessibility - A feature you can build
 
&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />
 
HTML5 and the web of tomorrow!
HTML5  and the  web of tomorrow!HTML5  and the  web of tomorrow!
HTML5 and the web of tomorrow!
 
Introduction to HTML5 & CSS3
Introduction to HTML5 & CSS3Introduction to HTML5 & CSS3
Introduction to HTML5 & CSS3
 
計算機概論20161205
計算機概論20161205計算機概論20161205
計算機概論20161205
 
Html5的应用与推行
Html5的应用与推行Html5的应用与推行
Html5的应用与推行
 
tut0000021-hevery
tut0000021-heverytut0000021-hevery
tut0000021-hevery
 
Web Component
Web ComponentWeb Component
Web Component
 
Web Standards: Fueling Innovation [Web Design World Boston '08]
Web Standards: Fueling Innovation [Web Design World Boston '08]Web Standards: Fueling Innovation [Web Design World Boston '08]
Web Standards: Fueling Innovation [Web Design World Boston '08]
 
計算機概論20161212
計算機概論20161212計算機概論20161212
計算機概論20161212
 

Viewers also liked

DevOps meetup - Ansible and Docker for your VPS
DevOps meetup - Ansible and Docker for your VPSDevOps meetup - Ansible and Docker for your VPS
DevOps meetup - Ansible and Docker for your VPSŁukasz Proszek
 
Application Deployment Using Ansible
Application Deployment Using AnsibleApplication Deployment Using Ansible
Application Deployment Using AnsibleCliffano Subagio
 
Jak tworzyć bezpieczne aplikacje?
Jak tworzyć bezpieczne aplikacje?Jak tworzyć bezpieczne aplikacje?
Jak tworzyć bezpieczne aplikacje?SecuRing
 
Mindtree IMS Offerings
Mindtree IMS OfferingsMindtree IMS Offerings
Mindtree IMS OfferingsKoushik Ramani
 
Southeast Asia Technology Investment Landscape
Southeast Asia Technology Investment LandscapeSoutheast Asia Technology Investment Landscape
Southeast Asia Technology Investment LandscapeWarren Leow
 
Presentation on Talent Development
Presentation on Talent DevelopmentPresentation on Talent Development
Presentation on Talent DevelopmentTim Weyland
 
e-conomy SEA by Google and Temasek
e-conomy SEA by Google and Temaseke-conomy SEA by Google and Temasek
e-conomy SEA by Google and TemasekeconomySEA
 
Great Talks Start with Great Proposals: An IA Summit Virtual Webinar
Great Talks Start with Great Proposals: An IA Summit Virtual WebinarGreat Talks Start with Great Proposals: An IA Summit Virtual Webinar
Great Talks Start with Great Proposals: An IA Summit Virtual WebinarRuss U
 
Designing a Culture of Design
Designing a Culture of DesignDesigning a Culture of Design
Designing a Culture of DesignChris Avore
 
Mobile Trends 2012 - MDAYS by Torsten Schollmayer, SapientNitro
Mobile Trends 2012 - MDAYS by Torsten Schollmayer, SapientNitroMobile Trends 2012 - MDAYS by Torsten Schollmayer, SapientNitro
Mobile Trends 2012 - MDAYS by Torsten Schollmayer, SapientNitroTorsten Schollmayer
 
Entrepreneurshit. The Truth About Building Starutps
Entrepreneurshit. The Truth About Building StarutpsEntrepreneurshit. The Truth About Building Starutps
Entrepreneurshit. The Truth About Building StarutpsMark Suster
 
Subscribed 2015: CEO's Keynote
Subscribed 2015: CEO's KeynoteSubscribed 2015: CEO's Keynote
Subscribed 2015: CEO's KeynoteZuora, Inc.
 
Does Living Near An NFL Stadium Boost Your Home Value?
Does Living Near An NFL Stadium Boost Your Home Value?Does Living Near An NFL Stadium Boost Your Home Value?
Does Living Near An NFL Stadium Boost Your Home Value?Trulia
 
Just a Room Full of Stuff? Why Libraries are Great / Katie Birkwood
Just a Room Full of Stuff? Why Libraries are Great / Katie BirkwoodJust a Room Full of Stuff? Why Libraries are Great / Katie Birkwood
Just a Room Full of Stuff? Why Libraries are Great / Katie BirkwoodKatie Birkwood
 
Bcg Consultants Love Life
Bcg  Consultants Love LifeBcg  Consultants Love Life
Bcg Consultants Love Lifenitinagarwalin
 
College Disrupted - Ryan Craig
College Disrupted - Ryan CraigCollege Disrupted - Ryan Craig
College Disrupted - Ryan CraigLinkedIn
 

Viewers also liked (19)

DevOps meetup - Ansible and Docker for your VPS
DevOps meetup - Ansible and Docker for your VPSDevOps meetup - Ansible and Docker for your VPS
DevOps meetup - Ansible and Docker for your VPS
 
Application Deployment Using Ansible
Application Deployment Using AnsibleApplication Deployment Using Ansible
Application Deployment Using Ansible
 
Jak tworzyć bezpieczne aplikacje?
Jak tworzyć bezpieczne aplikacje?Jak tworzyć bezpieczne aplikacje?
Jak tworzyć bezpieczne aplikacje?
 
Fluent integration-tests
Fluent integration-testsFluent integration-tests
Fluent integration-tests
 
Mindtree IMS Offerings
Mindtree IMS OfferingsMindtree IMS Offerings
Mindtree IMS Offerings
 
Southeast Asia Technology Investment Landscape
Southeast Asia Technology Investment LandscapeSoutheast Asia Technology Investment Landscape
Southeast Asia Technology Investment Landscape
 
Presentation on Talent Development
Presentation on Talent DevelopmentPresentation on Talent Development
Presentation on Talent Development
 
e-conomy SEA by Google and Temasek
e-conomy SEA by Google and Temaseke-conomy SEA by Google and Temasek
e-conomy SEA by Google and Temasek
 
Quantum computing
Quantum computingQuantum computing
Quantum computing
 
Great Talks Start with Great Proposals: An IA Summit Virtual Webinar
Great Talks Start with Great Proposals: An IA Summit Virtual WebinarGreat Talks Start with Great Proposals: An IA Summit Virtual Webinar
Great Talks Start with Great Proposals: An IA Summit Virtual Webinar
 
Designing a Culture of Design
Designing a Culture of DesignDesigning a Culture of Design
Designing a Culture of Design
 
Mobile Trends 2012 - MDAYS by Torsten Schollmayer, SapientNitro
Mobile Trends 2012 - MDAYS by Torsten Schollmayer, SapientNitroMobile Trends 2012 - MDAYS by Torsten Schollmayer, SapientNitro
Mobile Trends 2012 - MDAYS by Torsten Schollmayer, SapientNitro
 
Entrepreneurshit. The Truth About Building Starutps
Entrepreneurshit. The Truth About Building StarutpsEntrepreneurshit. The Truth About Building Starutps
Entrepreneurshit. The Truth About Building Starutps
 
Subscribed 2015: CEO's Keynote
Subscribed 2015: CEO's KeynoteSubscribed 2015: CEO's Keynote
Subscribed 2015: CEO's Keynote
 
Does Living Near An NFL Stadium Boost Your Home Value?
Does Living Near An NFL Stadium Boost Your Home Value?Does Living Near An NFL Stadium Boost Your Home Value?
Does Living Near An NFL Stadium Boost Your Home Value?
 
Docker.io
Docker.ioDocker.io
Docker.io
 
Just a Room Full of Stuff? Why Libraries are Great / Katie Birkwood
Just a Room Full of Stuff? Why Libraries are Great / Katie BirkwoodJust a Room Full of Stuff? Why Libraries are Great / Katie Birkwood
Just a Room Full of Stuff? Why Libraries are Great / Katie Birkwood
 
Bcg Consultants Love Life
Bcg  Consultants Love LifeBcg  Consultants Love Life
Bcg Consultants Love Life
 
College Disrupted - Ryan Craig
College Disrupted - Ryan CraigCollege Disrupted - Ryan Craig
College Disrupted - Ryan Craig
 

Similar to Selenium for-ops

HTML5 e CSS3 (slides della sessione tenuta al DIMI di Udine)
HTML5 e CSS3 (slides della sessione tenuta al DIMI di Udine) HTML5 e CSS3 (slides della sessione tenuta al DIMI di Udine)
HTML5 e CSS3 (slides della sessione tenuta al DIMI di Udine) Gabriele Gigliotti
 
Developing new feature in Joomla - Joomladay UK 2016
Developing new feature in Joomla - Joomladay UK 2016Developing new feature in Joomla - Joomladay UK 2016
Developing new feature in Joomla - Joomladay UK 2016Peter Martin
 
Working With The Symfony Admin Generator
Working With The Symfony Admin GeneratorWorking With The Symfony Admin Generator
Working With The Symfony Admin GeneratorJohn Cleveley
 
JavaScript DOM - Dynamic interactive Code
JavaScript DOM - Dynamic interactive CodeJavaScript DOM - Dynamic interactive Code
JavaScript DOM - Dynamic interactive CodeLaurence Svekis ✔
 
The why and how of moving to php 5.4
The why and how of moving to php 5.4The why and how of moving to php 5.4
The why and how of moving to php 5.4Wim Godden
 
Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...
Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...
Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...Ondřej Machulda
 
Top100summit 谷歌-scott-improve your automated web application testing
Top100summit  谷歌-scott-improve your automated web application testingTop100summit  谷歌-scott-improve your automated web application testing
Top100summit 谷歌-scott-improve your automated web application testingdrewz lin
 
WordPress basic fundamental of plugin development and creating shortcode
WordPress basic fundamental of plugin development and creating shortcodeWordPress basic fundamental of plugin development and creating shortcode
WordPress basic fundamental of plugin development and creating shortcodeRakesh Kushwaha
 
Selenium Introduction by Sandeep Sharda
Selenium Introduction by Sandeep ShardaSelenium Introduction by Sandeep Sharda
Selenium Introduction by Sandeep ShardaEr. Sndp Srda
 
Advanced Web Scraping or How To Make Internet Your Database #seoplus2018
Advanced Web Scraping or How To Make Internet Your Database #seoplus2018Advanced Web Scraping or How To Make Internet Your Database #seoplus2018
Advanced Web Scraping or How To Make Internet Your Database #seoplus2018Esteve Castells
 
Salesforce Admin's guide : the data loader from the command line
Salesforce Admin's guide : the data loader from the command lineSalesforce Admin's guide : the data loader from the command line
Salesforce Admin's guide : the data loader from the command lineCyrille Coeurjoly
 
Simplify your professional web development with symfony
Simplify your professional web development with symfonySimplify your professional web development with symfony
Simplify your professional web development with symfonyFrancois Zaninotto
 
Workshop quality assurance for php projects tek12
Workshop quality assurance for php projects tek12Workshop quality assurance for php projects tek12
Workshop quality assurance for php projects tek12Michelangelo van Dam
 
Practical JavaScript Programming - Session 4/8
Practical JavaScript Programming - Session 4/8Practical JavaScript Programming - Session 4/8
Practical JavaScript Programming - Session 4/8Wilson Su
 
Step 8_7_ 6_5_4_3_2_ 1 in one_Tutorial for Begineer on Selenium Web Driver-Te...
Step 8_7_ 6_5_4_3_2_ 1 in one_Tutorial for Begineer on Selenium Web Driver-Te...Step 8_7_ 6_5_4_3_2_ 1 in one_Tutorial for Begineer on Selenium Web Driver-Te...
Step 8_7_ 6_5_4_3_2_ 1 in one_Tutorial for Begineer on Selenium Web Driver-Te...Rashedul Islam
 
Rapid application development using Akeeba FOF and Joomla 3.2
Rapid application development using Akeeba FOF and Joomla 3.2Rapid application development using Akeeba FOF and Joomla 3.2
Rapid application development using Akeeba FOF and Joomla 3.2Tim Plummer
 
Rapid application development using Akeeba FOF and Joomla 3.2
Rapid application development using Akeeba FOF and Joomla 3.2Rapid application development using Akeeba FOF and Joomla 3.2
Rapid application development using Akeeba FOF and Joomla 3.2JoomlaDay Australia
 

Similar to Selenium for-ops (20)

HTML5 e CSS3 (slides della sessione tenuta al DIMI di Udine)
HTML5 e CSS3 (slides della sessione tenuta al DIMI di Udine) HTML5 e CSS3 (slides della sessione tenuta al DIMI di Udine)
HTML5 e CSS3 (slides della sessione tenuta al DIMI di Udine)
 
Developing new feature in Joomla - Joomladay UK 2016
Developing new feature in Joomla - Joomladay UK 2016Developing new feature in Joomla - Joomladay UK 2016
Developing new feature in Joomla - Joomladay UK 2016
 
Working With The Symfony Admin Generator
Working With The Symfony Admin GeneratorWorking With The Symfony Admin Generator
Working With The Symfony Admin Generator
 
JavaScript DOM - Dynamic interactive Code
JavaScript DOM - Dynamic interactive CodeJavaScript DOM - Dynamic interactive Code
JavaScript DOM - Dynamic interactive Code
 
The why and how of moving to php 5.4
The why and how of moving to php 5.4The why and how of moving to php 5.4
The why and how of moving to php 5.4
 
Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...
Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...
Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...
 
Top100summit 谷歌-scott-improve your automated web application testing
Top100summit  谷歌-scott-improve your automated web application testingTop100summit  谷歌-scott-improve your automated web application testing
Top100summit 谷歌-scott-improve your automated web application testing
 
WordPress basic fundamental of plugin development and creating shortcode
WordPress basic fundamental of plugin development and creating shortcodeWordPress basic fundamental of plugin development and creating shortcode
WordPress basic fundamental of plugin development and creating shortcode
 
Selenium Introduction by Sandeep Sharda
Selenium Introduction by Sandeep ShardaSelenium Introduction by Sandeep Sharda
Selenium Introduction by Sandeep Sharda
 
Advanced Web Scraping or How To Make Internet Your Database #seoplus2018
Advanced Web Scraping or How To Make Internet Your Database #seoplus2018Advanced Web Scraping or How To Make Internet Your Database #seoplus2018
Advanced Web Scraping or How To Make Internet Your Database #seoplus2018
 
Salesforce Admin's guide : the data loader from the command line
Salesforce Admin's guide : the data loader from the command lineSalesforce Admin's guide : the data loader from the command line
Salesforce Admin's guide : the data loader from the command line
 
Android Data Binding
Android Data BindingAndroid Data Binding
Android Data Binding
 
Simplify your professional web development with symfony
Simplify your professional web development with symfonySimplify your professional web development with symfony
Simplify your professional web development with symfony
 
End-to-end testing with geb
End-to-end testing with gebEnd-to-end testing with geb
End-to-end testing with geb
 
Workshop quality assurance for php projects tek12
Workshop quality assurance for php projects tek12Workshop quality assurance for php projects tek12
Workshop quality assurance for php projects tek12
 
Practical JavaScript Programming - Session 4/8
Practical JavaScript Programming - Session 4/8Practical JavaScript Programming - Session 4/8
Practical JavaScript Programming - Session 4/8
 
Step 8_7_ 6_5_4_3_2_ 1 in one_Tutorial for Begineer on Selenium Web Driver-Te...
Step 8_7_ 6_5_4_3_2_ 1 in one_Tutorial for Begineer on Selenium Web Driver-Te...Step 8_7_ 6_5_4_3_2_ 1 in one_Tutorial for Begineer on Selenium Web Driver-Te...
Step 8_7_ 6_5_4_3_2_ 1 in one_Tutorial for Begineer on Selenium Web Driver-Te...
 
Rapid application development using Akeeba FOF and Joomla 3.2
Rapid application development using Akeeba FOF and Joomla 3.2Rapid application development using Akeeba FOF and Joomla 3.2
Rapid application development using Akeeba FOF and Joomla 3.2
 
Rapid application development using Akeeba FOF and Joomla 3.2
Rapid application development using Akeeba FOF and Joomla 3.2Rapid application development using Akeeba FOF and Joomla 3.2
Rapid application development using Akeeba FOF and Joomla 3.2
 
Untangling7
Untangling7Untangling7
Untangling7
 

Recently uploaded

Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 

Recently uploaded (20)

Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 

Selenium for-ops

  • 1. Selenium for OPS Admins Anonymous meetup #5 Lukasz Proszek lukasz@proszek.info 2014-06-17
  • 2. Background You’re a BOFH at GlobalFskcup Ltd. Everyday you deal with numerous incidends. You have to seek approval and/or log every change made. The Head of IT has his favorite tool for that MacroHard PointShare form Rich editor filled form, with sparkling format choosers. Bells and whistles included
  • 3. The soft problem Filling the form takes 5-20 minutes each time No PFY available to do the job Keeping templates in a text document... sooooo 1990 Browser plugins - does not recognize all of provided inputs curl - yeah right, like I have time for that
  • 4. Selenium - basics 1 from selenium import webdriver 2 driver = webdriver.Firefox () 3 driver.get("http :// google.com") 4 driver. find_element_by_id ("...")
  • 5. how to identify element → inspect element
  • 6. Selenium - interact with webelement 1 from selenium import webdriver 2 driver = webdriver.Firefox () 3 driver.get("http :// google.com") 4 fld=driver. find_element_by_id (’gbqfq ’) 5 fld.send_keys(’Anonimowi Admini ’)
  • 9. Show me the code
  • 11. Problem? HTML injection the id is a hash of something... different everytime Let’s get the RichEditor’s class 1 e = "table.ms -formtable > tbody > 2 tr:nth -of -type (7) > td.ms -formbody > 3 span[dir=’none ’] > div > 4 div:nth -of -type (2)" 5 c=driver. find_element_by_css_selector (e) 6 .get_attribute("class")
  • 12. Problem? HTML injection We can not use webdriver.send keys() on that... it’s inside the html code We have to inject HTML with javascript 1 JS="document. getElementsByClassName ({0})[{1}] 2 .innerHTML =’{2}’".format( 3 CLASS_NAME , INDEX , 4 "<marquee > WTF </marquee >" 5 ) 6 driver.execute_script(JS)
  • 13. Clicking a radio button 1 driver. find_element_by_css_selector ( 2 "input[type=’radio ’][ value =’{0}’]".format( 3 "Approved by the CEO" 4 ) 5 ). click ()
  • 14. Selecting a dropdown option 1 driver. find_element_by_css_selector ( 2 "option[value =’{0}’]".format(value) 3 ). click ()
  • 15. Sending the form 1 driver. find_elements_by_css_selector ( 2 "input[value=’Save ’][type=’button ’]" 3 ). click ()
  • 16. Many python, such win 208 lines of Python virtualenv selenium for browser automation (pip install selenium) click for easy commandline (pip install click) path.py just because (pip install path.py) YAML for templates (pip instal pyYaML) keepass for credentials (pip install keepass)
  • 17. outcome, further plans, other uses Outcome It took 3hrs to write It eared it’s keep after one day Further plans webdriver.PhantomJS() for headless operation ansible integration Other uses e.g. testing how long it takes the user to perform some action
  • 18. Thank You wiki2beamer - latex-beamer made easy impressive - pdf presentations with sugar added http://github.com/frogu/presentations