تست وب اپ ها با سلنیوم - علیرضا عظیم زاده میلانی

23
Alireza Azimzadeh Milani Author of “Practical Guide on Python Programming” and “Practical Guide on Pentesting with Kali Linux” . Penetration-Tester, RHCE, LPIC-2, CEH, PWK, WiFu, … 3 rd Python Conference, Iran, 2016

Upload: irpycon

Post on 14-Jan-2017

274 views

Category:

Technology


4 download

TRANSCRIPT

Page 1: تست وب اپ ها با سلنیوم - علیرضا عظیم زاده میلانی

Alireza Azimzadeh Milani

Author of “Practical Guide on Python Programming” and “Practical Guide on Pentesting with Kali Linux”.

Penetration-Tester, RHCE, LPIC-2, CEH, PWK, WiFu, …

3rd Python Conference, Iran, 2016

Page 2: تست وب اپ ها با سلنیوم - علیرضا عظیم زاده میلانی

SeleniumLevel Audience: Intermediate

Page 3: تست وب اپ ها با سلنیوم - علیرضا عظیم زاده میلانی

Concepts: What is Selenium (Se.)

Selenium Applications

Tools for Automating Interactions

Job Opportunities in The World

A demo(Tut)

Page 1

Page 4: تست وب اپ ها با سلنیوم - علیرضا عظیم زاده میلانی

So, What is Selenium (Se.) ? Se is a browser automation framework

like as Django web framework.

Se is a set of tools for automating browsers

Se supports browsers including Firefox, Internet-Explorer, Google-Chrome, Safari, and Opera.

Page 2

Page 5: تست وب اپ ها با سلنیوم - علیرضا عظیم زاده میلانی

Page 3

BIO:

Page 6: تست وب اپ ها با سلنیوم - علیرضا عظیم زاده میلانی

Selenium Applications: Largely used for testing & validating applications

Automating repetitive tasks in browser

Reduce financial costs and time because teams don’t have time or money to invest in

large test teams to make sure that applications work as they are expected.

Page 4

Page 7: تست وب اپ ها با سلنیوم - علیرضا عظیم زاده میلانی

Selenium Applications (Cont’d):

For WEB Penetration-Testing Testing logical vulnerabilities:

for Ex: authentication, access control, input validation.

Testing technical vulnerabilities: for Ex: XSS, …

Using in Web-Scraping

Page 5

Page 8: تست وب اپ ها با سلنیوم - علیرضا عظیم زاده میلانی

Selenium Applications (Cont’d): For WEB Penetration-Testing

Hacking a logical vulnerability: BUG BOUNTY for bypassing CAPTCHA puzzle pattern:

Page 6

Thanks to:BugCrowd.comHackerONE.com

Page 9: تست وب اپ ها با سلنیوم - علیرضا عظیم زاده میلانی

Selenium Applications (Cont’d): For WEB Penetration-Testing

Hacking a technical vulnerability: BUG BOUNTY for discovering a XSS vulnerability:

Page 7

Page 10: تست وب اپ ها با سلنیوم - علیرضا عظیم زاده میلانی

Tools for Automating Interactions:

1. Selenium IDE:

this is a Firefox add-on

Disadvantages: - it can only be used with FF

- also, all selenium tools don’t support RIA technologies such as: Silverlight, JavaFx, and Flex/Flash.

Page 8

Page 11: تست وب اپ ها با سلنیوم - علیرضا عظیم زاده میلانی

Tools Automating Interactions (Cont’d):

1. Selenium IDE:

Page 9

Page 12: تست وب اپ ها با سلنیوم - علیرضا عظیم زاده میلانی

Tools Automating Interactions (Cont’d):

2. Selenium WebDriver: Is a programming interface for developing advanced

scripts using different programming languages.

We can run tests on multiple browsers that is so-called: Cross-Browser; And on multiple OS that is so-called: Cross-Platform (IOS, Android, Linux, Win, Mac, …).

Se.WebDriver offers many libraries for writing test scripts in various languages, including Java, C#, Python, Ruby, PHP, Perl, and JavaScript.

Page 10

Page 13: تست وب اپ ها با سلنیوم - علیرضا عظیم زاده میلانی

Tools Automating Interactions (Cont’d):

2. Selenium WebDriver:

Page 11

Page 14: تست وب اپ ها با سلنیوم - علیرضا عظیم زاده میلانی

Tools Automating Interactions (Cont’d):

3. Selenium Standalone Server:

known as “Se.Grid” and that distributes test-scripts on machines

For Se.Grid, need a Java Runtime Environment (JRE); then:

1) nohup java -jar selenium-server-standalone-2.53.jar > /root/milani/selenium.log &

2) java -jar selenium-server-standalone-2.53.jar -host 10.1.10.14 -port 4444 -role hub

Page 12

Page 15: تست وب اپ ها با سلنیوم - علیرضا عظیم زاده میلانی

Tools Automating Interactions (Cont’d):

3. Selenium Standalone Server:

Hub: be understood as server which acts as the central point

Node: are Se.instances that are attached to the Hub which execute the tests.

Note «Se.Grid includes Hub, WebDriver, and Se.RC to execute the scripts in the Grid.

Page 13

Page 16: تست وب اپ ها با سلنیوم - علیرضا عظیم زاده میلانی

Tools Automating Interactions (Cont’d):3. Selenium Standalone Server:

Page 14

Page 17: تست وب اپ ها با سلنیوم - علیرضا عظیم زاده میلانی

Selenium Jobs:www.indeed.com/q-Selenium-jobs.htmlwww.naukri.com/selenium-jobs #Special for India.www.careerbuilder.com/jobs-seleniumwww.upwork.com/o/jobs/browse/skill/selenium

An example of upwork.com:Selenium script for downloading files. Hourly - Entry Level ($) - Est. Time: Less than 1 month, 10-30 hrs/week - Posted 2 days ago.

Environment: Java-based platform, Selenium/TestNG framework.

Purpose: develop a script to automate the downloading of files from different web portals. ... Each web portal (Java-based) has a completely different structure. We have ~20 user test casesusing Selenium; means: you should write a script for executing ~20 test cases.

Number of freelancers needed: 3

Page 15

Page 18: تست وب اپ ها با سلنیوم - علیرضا عظیم زاده میلانی

Selenium Jobs (Cont’d):

Country: United States

Currency: USD

Updated: 3 April 2016

Page 16

Page 19: تست وب اپ ها با سلنیوم - علیرضا عظیم زاده میلانی

A Practical Python Book:

Page 17

Author:Alireza Azimzadeh Milani

Publication:PendarePars

Year:2016

Link:www.pendarepars.com/Home/Search/Python

Page 20: تست وب اپ ها با سلنیوم - علیرضا عظیم زاده میلانی

Selenium 2 Testing Tools By: David Burns, © 2012

Selenium Testing Tools Starter By: Unmesh Gundecha, © 2013

Learning Selenium Testing Tools with Python By: Unmesh Gundecha, © 2014

Selenium Testing Tools Cookbook, 2nd Edition By: Unmesh Gundecha, © 2015-----------------------------------------------------------------------------------------------------------------------------------

www.amazon.com/s/ref=nb_sb_noss_2?url=search-alias%3Dstripbooks&field-keywords=selenium

References:

Page 18

Page 21: تست وب اپ ها با سلنیوم - علیرضا عظیم زاده میلانی

www.slideshare.net/videotuition/selendroid-vs-appium-mobile-test-automation-frameworks-selenium-web-driver-automation-32158263

www.installationpage.com/selenium/how-to-run-selenium-headless-firefox-in-ubuntu

www.gridlastic.com/python-code-example.html

http://testdroid.com/tech AND http://testdroid.com/testdroid

http://simeonvisser.com/posts/running-tests-in-python-with-selenium-2-and-webdriver.html

www.ibm.com/developerworks/library/wa-seleniumgrid

www.toolsqa.com/selenium-video-tutorial

Additional Training Links:

Page 19

Page 22: تست وب اپ ها با سلنیوم - علیرضا عظیم زاده میلانی

[email protected]

AliAzimzadeh.Blogfa.com

IrSecTeam.org (Iran Security Team)

Any Question … ?

linkedin.com/in/alireza-azimzadeh-milani-34874079

Page 23: تست وب اپ ها با سلنیوم - علیرضا عظیم زاده میلانی

The End of Everything is To Start Learning New Things.