How to execute Javascript code using Selenium WebDriver?

  Selenium WebDriver API provides the ability to execute JavaScript code with the browser window. This is a very useful feature where tests need to interact with the page using JavaScript. Using this API, client-side JavaScript code can also be tested using Selenium WebDriver. Selenium WebDriver provides a JavascriptExecutor interface that can be used to execute arbitrary JavaScript code within the […]

What is JSON Wire Protocol?

JavaScript Object Notation (JSON) is used to represent objects with complex data structures. It is used primarily to transfer data between a server and a client on the web. It has very much become an industry standard for various REST web services, playing a strong alternative to XML. A sample JSON file, saved as a .json file, will look […]

What is RemoteWebDriver?

RemoteWebDriver is an implementation class of the WebDriver interface that a test script developer can use to execute their test scripts via the RemoteWebDriver server on a remote machine.   There are two parts to RemoteWebDriver: a server and a client   The RemoteWebDriver server is a component that listens on a port for various requests from a RemoteWebDriver client. Once it receives the requests, it forwards them […]

How to Capture Screenshot using Selenium WebDriver?

The TakesScreenShot interface in the WebDriver library is implemented by all of the different variants of WebDriver, such as Firefox Driver, Internet Explorer Driver, Chrome Driver, and so on. The TakesScreenShot capability is enabled in all of the browsers by default. The API syntax for getScreenshotAs() is as follows: public <X> X getScreenshotAs(OutputType<X> target) Here, OutputType is another interface of the WebDriver lib. […]