Why we don't need server in Selenium Webdriver?

心已入冬 提交于 2021-02-20 05:16:29

问题


  1. Selenium RC requires starting the server to kick of the execution of Selenium Automated RC test suites.
  2. The Selenium server is the inter mediator between browser and Selenium RC because Selenium RC won’t make direct call to browser.
  3. So we have to start Selenium server prior to start running Selenium RC test cases.
  4. In case of Selenium Web Driver, it does not required to start Selenium Server for executing test scripts.
  5. Selenium Web Driver makes the calls between browser & automation script.

回答1:


The Selenium server is the mediator between browser and Selenium RC because this RC won't make direct call to browser. So we must start Selenium server earlier to start running Selenium RC test cases. When you begin testing, Selenium RC Server "injects" a Javascript program called Selenium Core into the browser. Once injected, Selenium Core will start receiving instructions relayed by the RC Server from your test program.

In case of Selenium webdriver, it does not required to begin Server for executing check scripts. Whatever the commands issued in the code will be interpreted into Webservice methods (JSON Wired Protocol) and the Remote Driver will receive the HTTP request (commands) and execute them in the browser then send the response back. To give more information let say you have written test using java (binding code) against Selenium API and that binding code is going to issue commands across WebDriver wire protocol this is a rest-based web service that is able to interpret those commands. The driver server is just a little executable that runs each one of the drivers has this driver server that basically listens on a port on your local machine when you run your tests and it’s waiting for these commands to come in. And when these commands come in it interprets those commands and then automates the browser and then returns those results back.



来源:https://stackoverflow.com/questions/42562963/why-we-dont-need-server-in-selenium-webdriver

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!