Automated Testing with Google Chrome - WebDriver- ChromeDriver

26
http:// assertselenium.com

Transcript of Automated Testing with Google Chrome - WebDriver- ChromeDriver

Page 1: Automated Testing with Google Chrome - WebDriver- ChromeDriver

http://assertselenium.com

Page 2: Automated Testing with Google Chrome - WebDriver- ChromeDriver

About Me

http://assertselenium.com

Open source contributorDeveloper in TestEditor-in-chief AssertSelenium.com

@manoj9788

http://facebook.com/AssertSelenium

http://about.me/manoj9788

Page 3: Automated Testing with Google Chrome - WebDriver- ChromeDriver

What’s In Store ?

Testing Automated testing Selenium WebDriver WebDriver API WebDriver for Google Chrome ChromeDriver ChromeDriver Architecture ChromeDriver Implementation Demo

http://assertselenium.com

Page 4: Automated Testing with Google Chrome - WebDriver- ChromeDriver

Testing ?

Is the process of evaluating a system or its component(s) with the intent to find whether it satisfies what it needs to do.

http://assertselenium.com

Page 5: Automated Testing with Google Chrome - WebDriver- ChromeDriver

Automated Testing

Testing a system or its component(s) with an use of an automation tool is called Automation testing.

In a Robotic way

http://assertselenium.com

Page 6: Automated Testing with Google Chrome - WebDriver- ChromeDriver

Why Automation Testing ?

Automation does not require Human Intervention

Automation increases speed of test execution

Manual testing can be boring and hence error prone

Automation saves you money

http://assertselenium.com

Page 7: Automated Testing with Google Chrome - WebDriver- ChromeDriver

Automation Tool Is a Software or a package that

allows you to use high level languages or keywords to create scripts on top of a test framework to manage the build and run of scripts that communicate with the Application under test

To control execution of tests To compare actual outcomes to

expected outcomes To report the status (PASS/FAIL)

http://assertselenium.com

Page 8: Automated Testing with Google Chrome - WebDriver- ChromeDriver

Selenium WebDriver

Browser Automation Framework

It automates browser’s

http://docs.seleniumhq.org/

http://assertselenium.com

Page 9: Automated Testing with Google Chrome - WebDriver- ChromeDriver

Selenium WebDriver

Selenium is an open Source tool and its free. Supports Cross Browser Testing. The Selenium tests

can be run on multiple browsers. Allows scripting in several languages like Java, C#,

Groovy, Ruby, PHP and Python. Assertion statements provide an efficient way of

comparing expected and actual results. Different browser implementations

http://assertselenium.com

Page 10: Automated Testing with Google Chrome - WebDriver- ChromeDriver

Selenium Suite of Tools

Selenium IDE Selenium Remote Control (aka) Selenium 1.0

(Deprecated) Selenium WebDriver (aka) Selenium 2.0(aka)

WebDriver Selenium GRID

http://assertselenium.com

Page 11: Automated Testing with Google Chrome - WebDriver- ChromeDriver

Selenium IDE

The Record and Playback tool

http://assertselenium.com

Page 12: Automated Testing with Google Chrome - WebDriver- ChromeDriver

Why WebDriver ?

Because it’s a W3C Working Draft

http://assertselenium.com

Page 13: Automated Testing with Google Chrome - WebDriver- ChromeDriver

WebDriver API

How does the WebDriver API looks like ?driver.findElement(By.name("q"))

http://assertselenium.com

Page 14: Automated Testing with Google Chrome - WebDriver- ChromeDriver

UI Element Locators

We Human’s know what exactly to do on the web page, operations like click, double click…

Automation is a robotic process and we need instruct the bot to click ‘here’ by the element locators – the objects.

Different locatorsidcssxpathlinktext

http://assertselenium.com

Page 15: Automated Testing with Google Chrome - WebDriver- ChromeDriver

Transformation from Manual to a Automated Tester

http://assertselenium.com

Manual Interaction Automated WebDriver API

Human Opens a browser and loads the URL of app under test

WebDriver driver = new ChromeDriver();driver.get(http://google.com);

Human Click on a button driver.findElement(By.linkText(”Google")).click();

Human types in a name in text field

driver.findElement(By.name("firstName")).clear();driver.findElement(By.name("firstName")).sendKeys(”gdgChennai");

Human selects an option from a dropdown

new Select(driver.findElement(By.id("glsel"))).selectByVisibleText("GB");

Page 16: Automated Testing with Google Chrome - WebDriver- ChromeDriver

CHROMEDRIVER

Maintained and Developed by the Chromium Team at Google

http://assertselenium.com

Chromium

Page 17: Automated Testing with Google Chrome - WebDriver- ChromeDriver

Browser Statistics

http://assertselenium.com

Page 18: Automated Testing with Google Chrome - WebDriver- ChromeDriver

Interrogation

As a Web Developer, how can I automatically verify the critical functionality of my app works ?

As a Tester, how can I automatically verify the critical functionality of app under test performs what it supposed to do ?

http://assertselenium.com

Page 19: Automated Testing with Google Chrome - WebDriver- ChromeDriver

ChromeDriverInteroperable with WebDriver Clients

Open source and maintained by the members of Chromium project

http://assertselenium.com

Page 20: Automated Testing with Google Chrome - WebDriver- ChromeDriver

How does the test look like ?

http://assertselenium.com

Page 21: Automated Testing with Google Chrome - WebDriver- ChromeDriver

How ChromeDriver works ?

http://assertselenium.com

Page 22: Automated Testing with Google Chrome - WebDriver- ChromeDriver

ChromeDriver Implementation

Dev ToolsProvides access to internal of web app• Query and Manipulate DOM tree• Debugging JavaScript• Network Monitoring• Memory and Performance profiling

ExtensionsModify and enhance browser functionality• Window control

http://assertselenium.com

Page 23: Automated Testing with Google Chrome - WebDriver- ChromeDriver

Detailed Architecture ViewChromeDriver

http://assertselenium.com

Page 24: Automated Testing with Google Chrome - WebDriver- ChromeDriver

Chrome Extensions

Chrome Extensions can be either packed or unpacked.

Packed extensions are single file with a .crx extension Unpacked extensions are a directory containing the

extension, including a manifest.json file

http://assertselenium.com

Page 25: Automated Testing with Google Chrome - WebDriver- ChromeDriver

http://assertselenium.com

Page 26: Automated Testing with Google Chrome - WebDriver- ChromeDriver

Thank you!!

http://assertselenium.com

Email at: [email protected]