2

I am trying to understand the Architecture of Selenium Webdriver. And i was going through this : http://www.aosabook.org/en/selenium.html

The section "16.3.7. Every Call Is an RPC Call" is totally confusing me.

As far i understood, Webdriver makes OS calls which controls the browser.

Can some body please explain the section "16.3.7. Every Call Is an RPC Call". it Says "every call that is made through its API is an RPC call".

My undestanding about RPC call is that it is used to call a procedure that exists in another address space (commonly on another computer on a shared network). But in regards to Webdriver, I can run a simple webdriver script whitout being connected to any network

And also do Webdriver use REST api?

2
  • Did you read 16.3.7? If so, what specifically don't you understand? Commented Jun 8, 2016 at 18:50
  • it Says "every call that is made through its API is an RPC call". My undestanding about RPC call is that it is used to call a procedure that exists in another address space (commonly on another computer on a shared network). But in regards to Webdriver, I can run a simple webdriver script whitout being connected to any network. Commented Jun 8, 2016 at 19:03

1 Answer 1

1

I will try to keep the long story short, but (in case someone needs) full description can be found in Selenium 2 Testing Tools by David Burns.

WebDriver tries to control the browser from outside the browser. It uses accessibility API to drive the browser. The accessibility API is used by a number of applications for accessing and controlling applications when they are used by disabled users and is common to web browsers. WebDriver uses the most appropriate way to access the accessibility API. If we look at Firefox, it uses JavaScript to access the API. If we look at Internet Explorer, it uses C++. This approach means we can control browsers in the best possible way but has the downside that new browsers entering the market will not be supported straight away.

The system is made up of four different sections:

selenium sections

So after the API code enters the SPI (Stateless Programming Interface) and it is then called to a mechanism that breaks down what the element is, by using a unique ID, and then calling a command that is relevant.

do Webdriver use REST api?

From there we call the JSON Wire protocol. We still use HTTP as the main transport mechanism. We communicate to the browsers and have a simple client server transport architecture that is able to transport all the necessary elements to the code that controls it. It uses a REST like API as the way to communicate.

Last section is the Selenium server, or browser, depending on what is processing, uses the JSON Wire commands to break down the JSON object and then does what it needs to. This part of the code is dependent on which browser it is running on. As mentioned above, it could be done in the browser via C++; if it's in IE or if not available we inject Selenium.

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you @ekostadinov , I Will go through the book to understand it in more detail. But one question, I Can successfully write and execute a simple webdriver script without having to use Selenium-Server jar but using only Java Selenium Client. So in this case how does Selenium Server come into play.
Please remove the "thank you" part and leave only the question in the comment above. There is a good policy of voting/marking as best answer, so let's keep your question clean. Selenium can be executed directly into the browser as well, via its native JS support. Here you can find very good comparison between versions.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.