Selenium - What will happen behind the scenes when running client code
分享一个大牛的人工智能教程。零基础!通俗易懂!风趣幽默!希望你也加入到人工智能的队伍中来!请点击http://www.captainbed.net
We know there is a Selenium Server (Selenium RC Server), Selenium Client driver (driver specific to languages such as C#, Java etc) and we use them in our IDE for writing code.
Once we start running a code from IDE the following stuffs will happen behind the scenes.
1. The Client driver will first establishes a connection with Selenium server.
2. Selenium Server will do following:
a. It will create a session for that particular request
b. It will launch the desired browser (Specified in the code IE,FF,Chrome etc)
c. Loads the Selenium cores Javascript file into the specified browser (So as selenium server will have handle with the webpage for performing Selenese action)
3. Now the Client driver will send the program that we have written in IDE as selenese (by making conversion) and send it to Selenium server.
4. Selenium server is intelligent enough to understand the selenese command and triggers the corresponding javascript execution in the web browser.
5. Here Selenium Server act as a “Proxy Server” between the AUT (Application Under Test) and actual browser, due to the restriction of “Same origin policy” selenium server performs “Proxy Injection”. Being a proxy gives Selenium Server the capability of “lying” about the AUT’s real URL.
6. Now Selenium server requests the actual webserver for the page open request and then it receives the page and sends it to the browser.
7. Now any operation or request which the browser makes will eventually passes through Selenium RC server to actual webserver and vice verse.
Well we can see the same behind the scenes operation by our own. Let us see how we can do that.
Step 1
Open the selenium server 3.141.59 from command prompt using the following command.
java -jar selenium-server-standalone-3.141.59.jar
Step 2
Now navigate to the URL http://127.0.0.1:4444/wd/hub, which is nothing but the default URL in which selenium server start. Now our browser will have a page.
Step 3
Lets create a session by clicking on the Create Session button in the browser we have, now this will ask us to select the browser. Select a browser and click “OK” button, which will eventually create a session for us and launches a browser with empty page (Since we have not supplied any command to Selenium server at this point to open any URL or to perform any operations).
Here we have three more buttons with rest of steps we are going to perform.
That's it!
Selenium - What will happen behind the scenes when running client code相关推荐
- 语义分割--Full-Resolution Residual Networks for Semantic Segmentation in Street Scenes
Full-Resolution Residual Networks for Semantic Segmentation in Street Scenes CVPR2017 Theano/Lasagne ...
- Selenium Web 自动化 - Selenium常用API
Selenium Web 自动化 - Selenium常用API 2016-08-01 目录 1 对浏览器操作 1.1 用webdriver打开一个浏览器 1.2 最大化浏览器&关闭浏 ...
- 激活手表显示无法登陆服务器,在Firefox中使用Nightwatch运行测试无法连接到Selenium服务器...
我正在尝试使用Nightwatch.js对网站进行自动测试,而我正在使用macOS High Sierra . 所以我开始使用文档中所述的Selenium Standalone Server进行测试 ...
- selenium等待定位标签加载完再执行
遇到的问题描述 我们经常会碰到用selenium操作页面上某个元素的时候, 需要等待页面加载完成后, 才能操作. 否则页面上的元素不存在,会抛出异常. 比如: 一个动态网页使用了ajax的异步加载, ...
- selenium打开Firefox、IE、Chrome浏览器【python】
selenium打开不同浏览器的脚本. 1.Firefox from selenium import webdriver driver=webdriver.Firefox() driver.get(& ...
- Selenium WebDriver架构
什么是Selenium? (What is Selenium?) Selenium is an Opensource Automation testing tool which is only mea ...
- selenium工作原理详解
selenium简介 Selenium是一个用于Web应用程序自动化测试工具.Selenium测试直接运行在浏览器中,就像真正的用户在操作一样.支持的浏览器包括IE(7, 8, 9, 10, 11), ...
- 4.Mac上搭建Selenium+WebDriver环境chromedriver移动到 /usr/local/bin/
换电脑了...Windows搭建测试环境很顺利,但是用Mac踩了不少坑,主要是放置chromedriver的位置不对,导致报错,记录下过程,希望能帮到遇到同样问题的小伙伴. 1.如果chromedri ...
- java操作selenium(一)
参考:http://www.testclass.net/selenium_java/ 一共分为二十个部分:环境安装之Java.环境安装之IntelliJ IDEA.环境安装之selenium.sele ...
- 详解介绍Selenium常用API的使用--Java语言(史无前例的完整)
一共分为二十个部分:环境安装之Java.环境安装之IntelliJ IDEA.环境安装之selenium.selenium3浏览器驱动.selenium元素定位.控制浏览器操作.WebDriver常用 ...
最新文章
- 项目经理应该具备的技能
- matlab中的containers.Map()
- linux TCP/IP L2层数据包接收流程,eth_rxnetif_receive_skb处理流程
- php class使用方法,php的类使用方法问题
- 常用技巧 —— 位运算 —— 异或 1 的妙处
- spring事务管理几种方式(转)
- 《设计原本—计算机科学巨匠Frederick P. Brooks的反思》一一第 3 章 理性模型有哪些缺陷...
- Flask构建微电影(一)
- 今天我的生日,纪念一下
- Flex Builder中创建的项目4种
- 清除SQL Sever 2008数据库日志
- Android EditText属性android:inputType类型介绍
- OC load 和 initialize 方法
- 思维为何会越来越原地踏步No.209
- java 生成时间戳
- 如何下载tomcat历史版本
- PHP打开word文档
- python 判断excel单元格为空_用python检测空白Excel单元格
- kissme病毒解决办法(非原创)
- 教你如何使用Java代码从网页中爬取数据到数据库中——网络爬虫精华篇