Principles and concepts of Atitit WebDriver technical specifications, atititwebdriver
Principles and concepts of Atitit WebDriver Technical Specifications
1. Book haosyo ma1
2. WebDriver is a W3C standard hosted by Selenium. 1
3. How does WebDriver work (zhuan)1
1.
Book haosyo ma2. WebDriver is a W3C standard hosted by Selenium.
The W3C Browser Testing and Tools Working Group released a working draft of WebDriver. This specification defines the WebDriver application programming interface. WebDriver is a platform-and language-neutral access interface that allows applications or scripts to obtain the Web browser status and control browser behavior. Currently, WebDriver APIs are mainly used for developers to write test scripts and implement browser-based automatic testing through an independent control process, in the future, this specification may allow the script program running in the browser to control browser behavior.
This specification also includes a serialization suggestion for JSON-based input and output parameters based on API calls and response, which may help browser providers.
Author: nickname: old wow's paw (full name: Attilax Akbar Al Rapanui Attila Akba Arla Panui)
Chinese name: atira (iron), EMAIL: 1466519819@qq.com
Reprinted please indicate Source: http://www.cnblogs.com/attilax/
3.
How does WebDriver work (zhuan)
WebDriver is a W3C standard hosted by Selenium.
Specific protocol standards can be viewed from the http://code.google.com/p/selenium/wiki/JsonWireProtocol#Command_Reference.
From this protocol, we can see that the reason why WebDriver can interact with the browser is that the browser implements these protocols. This protocol uses JOSN for transmission over HTTP.
It uses the classic Client-Server mode. The client sends a requset and the server returns a response.
We define several concepts.
Client
The machine that calls WebDriverAPI.
Server
The machine that runs the browser. Firefox directly implements the communication protocol of WebDriver, while Chrome and IE are implemented through ChromeDriver and InternetExplorerDriver.
Session
The server needs to maintain the Session of the browser. The request header sent from the client contains the Session information, and the server executes the corresponding browser page.
WebElement
This is an object in WebDriverAPI, representing a DOM element on the page.
For example, the following code uses the "command" firefox to jump to the google homepage:
WebDriver driver = new FirefoxDriver ();
// Instantiate a Driver
Driver. get ("http://www.google.com ");
When executing the driver. get ("http://www.google.com") Code, the client, our test code, sends the following request to the remote server:
POSTsession/285b12e4-2b8a-4fe6-90e1-c35cba245956/url post_data {"url": "http://google.com "}
Request the localhost: port/hub/session/session_id/url address through post, and request the browser to complete the jump url operation.
If the above request is acceptable, or the remote server implements this interface, the remote server will jump to the url contained in the post data 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 implementation method on the remote server. get indicates that the method is redirected to the specified url;
SessionId: id of the current session;
Status: status Code of the request execution. If it is not 0, it indicates that the request is not executed correctly. If it is 0, it indicates that everything is OK;
Value: Return value of the request. The returned value is null. If the client calls the title interface, the value should be the title of the current page;
If the client sends a request to locate a specific page element, the returned value of response may be as follows:
{"Name": "findElement", "sessionId": "effect", "status": 0, "value": {"ELEMENT": "{2192893e-f260-44c4-bdf6-7aad3c919739 }"}}
Name, sessionId, and status are similar to the preceding example. The difference is that the returned value of this request is ELEMENT: {2192893e-f260-44c4-bdf6-7aad3c919739}, indicating that the ELEMENT id is located, the client can send a request such as click to interact with the server.
IE11 began to support the WebDriver standard, IE WebDriver Tool for Internet Explorer 11:
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
10. Element Retrieval
11. Element State
12. Element Interaction
13. Document Handling
14. Cookies
15. Actions
16. User Prompts
17. Screen Capture
5.
References
How does WebDriver work (zhuan)-allback-blog. html
WebDriver API submission W3C standardization · LinuxTOY.html
Microsoft: The New Win10 Edge browser supports WebDriver testing-Edge browser, Win10 system-it home .html
Atiend