Atitit Webdriver Technical Specification principles and concepts

Source: Internet
Author: User

Atitit Webdriver principles and concepts of technical specifications

1. book haosyo ma1

2. webdriver is A standard for the consortium, chaired by Selenium . 1

3. How Webdriver works (zhuan)1

1. Book Haosyo ma2.webdriver is a standard for the Selenium , presided over by the

w3c browser test and tool (Browser testing and tools) Workgroup released webdriver The working draft. The specification defines the application programming interface for the webdriver. Webdriver is a platform and language-neutral provider that allows applications or scripts to get the status of a Web browser and control the behavior of the browser. The Webdriver API is currently used primarily by developers to write test scripts and to implement browser-based automated testing through a separate control process, which in the future may also allow script programs running in the browser to control browser behavior.

The specification also includes a The serialization recommendations for JSON-based input and output parameters may help the browser provider when API calls and responses are available.

author::  Nickname :Old Wow's claws( Full Name::AttilaxAkbar Al Rapanui Attilaksachanui) 

Kanji Name: Etila ( Ayron) , email:[email protected]

reprint Please indicate source: http://www.cnblogs.com/attilax/

3. How Webdriver works (Zhuan)

webdriver is a standard for the Selenium , presided over by the

the specific protocol standard can be viewed from http://code.google.com/p/selenium/wiki/JsonWireProtocol#Command_Reference .

from this agreement we can see that Webdriver is able to interact with the browser because the browser implements these protocols. This protocol is transmitted via HTTP using Josn .

It is implemented using a classic Client-server mode. The client sends a requset, and the server returns a response.

We define several concepts.

Client

called Webdriverapi 's machine.

Server

the machine running the browser. the Firefox browser directly implements the webdriver communication protocol, while Chrome and IE are implemented by Chromedriver and internetexplorerdriver .

Session

The server side needs to maintain the browser Session, from the client sent the request header contains the session information, the server side will execute the corresponding browser page.

Webelement

This is an object in the Webdriverapi that represents a DOM element.

As A practical example, the following code is " command " Firefox to jump to the Google page:


       // instantiate a driver
 
        driver.get ("http://www.google.com");

When executing the code fordriver.get ("http://www.google.com"),theclient, which isour test code , is to the remote The server sends the following request:

Postsession/285b12e4-2b8a-4fe6-90e1-c35cba245956/url post_data{"url": "Http://google.com"}

through Post localhost:port/hub/session/session_id/url address, request the browser to complete jump url the operation.

If the above request is acceptable, or if remote server implements this interface, remote server jumps to the post data containing the URL, and return the following Response

{"Name": "Get", "SessionId": "285b12e4-2b8a-4fe6-90e1-c35cba245956", "status": 0, "Value": "}

The response contains the following information

name: The name of the remote server -side implementation method, here is get, which represents a jump to the specified url;

sessionId: Current the ID of the session;

Status: The state code of the request execution, non- 0 means not executed correctly, here is 0, say everything OK don't worry;

Value: The return value of the request, where the return value is null if client calls the title interface, the value should be the title of the current page ;

If the client sends a request that locates a particular page element, the the return value of the response may be this:

{"Name": "Findelement", "sessionId": "285b12e4-2b8a-4fe6-90e1-c35cba245956", "status": 0, "value": {"ELEMENT": "{ 2192893e-f260-44c4-bdf6-7aad3c919739} "}}

Name,sessionid, The status is similar to the above example, the difference is that the return value of the request is element:{2192893e-f260-44c4-bdf6-7aad3c919739}, which indicates that the element is anchored to the ID, through which theclient can send requests such as click and server side to interact.

IE11 started to support the Webdriver standard,IE webdriver Tool for Internet Explorerone by one:

4. webdriver API Description

https://www.w3.org/TR/webdriver/#commands

Conformance: Consistency

2. Terminology

3. Interface

4. Protocol

5. Capabilities

6. Sessions

7. Navigation

8. Command Contexts

9. Elements

Element Retrieval

One. Element state

Element Interaction

Document Handling

. Cookies

. Actions

User Prompts

. Screen Capture

5. References

Webdriver How to work (Zhuan)-allback- Blog Park . html

Webdriver API submission Standardization · linuxtoy.html

Microsoft: Win10 new Edge Browser supports webdriver testing -Edge browser , Win10 Systems - home of IT . html

A Tiend

Atitit Webdriver Technical Specification principles and concepts

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.