Book Image

Selenium Essentials

By : Prashanth Sams
Book Image

Selenium Essentials

By: Prashanth Sams

Overview of this book

Table of Contents (12 chapters)

Switching user agents


Earlier, cryptic commands and texts were used to retrieve data from the Internet, which would act as a user agent; now, web browsers are used as user agents. To put it simply, a user agent is a tool to browse the Internet by faking another browser. In general, websites are being rendered differently on different browsers with different platforms (for example, Chrome browser on Windows 7). However, the user agents cannot render a web page similar to the selected one. The user can track their own user agent string from http://whatsmyuseragent.com/.

For example, Mozilla Firefox 5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.143 Safari/537.36.

Here, Mozilla/5.0 is an application name and Chrome/36.0.1985.143 is the browser type, with version. Whenever the user enters a URL in the web browser, a request will be sent to the web server to identify the user agent; it provides the relevant data as response. Selenium WebDriver has extended its features...