+ All Categories
Transcript
Page 1: Selenium - automated browser-based testing -

Selenium- automated browser-based testing -

KOMATSU Seiji (comutt)atWare, Inc.

September 21, 2012

Page 2: Selenium - automated browser-based testing -

What is Selenium?

Automates browser

Testing feature(element assertion, etc)

Selenium IDEsupported on Firefox

Other browsers are supported for testing

Page 3: Selenium - automated browser-based testing -

UI Testing

Logic testing doesn’t cover UI

Web application’s UI is browsers

It’s not easy to testing with browsers

Page 4: Selenium - automated browser-based testing -

With Selenium

Testable with Browsers

Test cases can be written in:Java, C#, Ruby, Python, etc

Using CI,UI becomes testable continuously

Page 5: Selenium - automated browser-based testing -

Architecture

Selenium 2.0

WebDriver

A driver, which is run by a Client Driver

Client Driver

Test drivers, implemented in some languages (Java, C#, Python, etc)

Page 6: Selenium - automated browser-based testing -

Architecture

Browser

WebDriverplugin

Client Driver( library )

Selenium IDE

Drive a browser directly from a client

Page 7: Selenium - automated browser-based testing -

Architecture

Browser

WebDriverplugin

Client Driver( library )

Selenium IDE

Drive a browser from Selenium Server

SeleniumServer

( java daemon )

RemoteWebDriver

Page 8: Selenium - automated browser-based testing -

Selenium IDE

Firefox Plugin

Available at Downloads

Here

Page 9: Selenium - automated browser-based testing -

Get Selenium IDEAll plugins installed at once

Page 10: Selenium - automated browser-based testing -

Got Selenium IDE

Now you can run Selenium IDE

Page 11: Selenium - automated browser-based testing -

Recording Mode

Selenium IDE has a recording mode

Recording mode:ON

Recording mode:OFF

Page 12: Selenium - automated browser-based testing -

Be Careful

If recording mode on:

All actions recorded automatically

May be an accident,if the mode is on by mistake

Otherwise:

No actions recorded automatically

Page 13: Selenium - automated browser-based testing -

Let’s Record

To record, turn on the recording mode

You only do browsing,same as when you browse normally

Page 15: Selenium - automated browser-based testing -

To JUnit Test Case

It’s easy to convert to JUnit Test Case, or other formats.

Enable the feature,[Options]-[Options]-[Enable experimental features]

To convert,[Options]-[Format]-[What a format you want]

Page 16: Selenium - automated browser-based testing -

GotJUnit Test Case

As a result:

Page 17: Selenium - automated browser-based testing -

Other Ways

Copy directly to clipboard:[Options]-[Clipboard Format]-[What a format you want]

Export as a file:[File]-[Export Test Case As...]-[What a format you want]

Page 18: Selenium - automated browser-based testing -

Architecture Comparison

It takes about a minute to run test

As I investigated,class loading is a little slow

Browser

Client Driver( library )

WebDriverplugin

Selenium IDE

Page 19: Selenium - automated browser-based testing -

Architecture Comparison

Required that the server is ready

It takes rather a half time than without the server

Browser

WebDriverplugin

Client Driver( library )

Selenium IDE

SeleniumServer

( java daemon )

RemoteWebDriver

Page 20: Selenium - automated browser-based testing -

Conclusion

UI testing is complex,so the maintenance is not easy

Suggest that test the critical patterns

Login/Logout, and any othervery important features

Powerful to prevent the regression


Top Related