码迷,mamicode.com
首页 > 其他好文 > 详细

Test Automation With Selenium Using Page Object Design

时间:2014-06-07 07:14:40      阅读:290      评论:0      收藏:0      [点我收藏+]

标签:des   c   class   code   java   a   

WebDriver Introduction
A different way of automating the browser.
. Create a browser-specific driver to control the browser directly and have to do this for each browser
. Object oriented API
. Doesn‘t need a real browser
. No JavaScript limitations
. No need for a server

A Page Object is a object oriented class that serves as an interface to a page of you AUT(Application Under Test). If UI changes, test don‘t need to be change, only the code within the page object need to be changed.

How does it work?
. Each page is defined as it‘s own class.
. Actions (including navigation) are representing as functions for a class
. Each function returns a new Page object, signifying what page the actions stops on.
. Tests only talk to the page objects
. Page objects only talk to the driver
. Elements on the page are stored as variables for the page object
. Class inheritance can be used to define functionality to a set of pages.


1. Define a class for the Page Object model by creating a Python script with the name of the page.
The Page Object model can be implemented by creating classes, defining methods and properties, and only exposing the functionality from the application page that needed it for testing.

Test Automation With Selenium Using Page Object Design,布布扣,bubuko.com

Test Automation With Selenium Using Page Object Design

标签:des   c   class   code   java   a   

原文地址:http://www.cnblogs.com/bluescorpio/p/3770531.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!