SELENIUM INTERVIEW QUESTIONS AND ANSWERS (PART 01)
1. What is Selenium?
Selenium is an open-source automated testing framework used for web applications
across different browsers and platforms. It allows testers to write test scripts in various
programming languages like Java, Python, C#, etc.
2. What are the components of Selenium?
The main components are:
- Selenium IDE (Integrated Development Environment)
- Selenium RC (Remote Control) – Deprecated
- Selenium WebDriver
- Selenium Grid
3. What is WebDriver?
WebDriver is a component of Selenium that provides a platform to automate web
application testing by interacting directly with the browser. It uses browser-specific
drivers to run tests and doesn’t rely on a JavaScript engine, unlike Selenium RC.
4. What are the Advantages & Disadvantages of Selenium WebDriver?
Advantages:
- Supports multiple browsers (Chrome, Firefox, etc.)
- Supports multiple programming languages
- No need for a specific server to execute tests
Disadvantages:
- No built-in reporting feature
- Limited support for handling images, CAPTCHA, etc.
- Doesn’t support desktop applications, only web-based.
5. WebDriver Architecture in Selenium 3 & Selenium 4?
In Selenium 3, WebDriver interacts directly with the browser using browser-specific
drivers, making HTTP requests. In Selenium 4, the WebDriver follows the W3C
Standard, improving browser interaction by reducing compatibility issues and relying
on native browser support.
, SELENIUM INTERVIEW QUESTIONS AND ANSWERS (PART 01)
6. Communication between the WebDriver and Browser
The WebDriver sends commands (like opening a URL or finding an element) to the
browser through the browser's driver, which converts the commands into HTTP
requests. The browser processes these requests and sends back the results.
7. What is the architecture of Selenium WebDriver?
WebDriver has a layered architecture where the client library sends commands to the
WebDriver API. These commands are converted into HTTP requests and sent to the
browser driver, which communicates with the actual browser.
8. How to Launch Browsers in WebDriver?
Example to launch Chrome browser:
WebDriver driver = new ChromeDriver();
9. How to Open URL?
Example to open a URL:
driver.get("https://example.com");
10. How to capture the Title of the page?
Example:
String title = driver.getTitle();
11. How to capture the URL of the page?
Example:
String currentUrl = driver.getCurrentUrl();
12. How to capture the page source of the Page?
Example:
String pageSource = driver.getPageSource();
1. What is Selenium?
Selenium is an open-source automated testing framework used for web applications
across different browsers and platforms. It allows testers to write test scripts in various
programming languages like Java, Python, C#, etc.
2. What are the components of Selenium?
The main components are:
- Selenium IDE (Integrated Development Environment)
- Selenium RC (Remote Control) – Deprecated
- Selenium WebDriver
- Selenium Grid
3. What is WebDriver?
WebDriver is a component of Selenium that provides a platform to automate web
application testing by interacting directly with the browser. It uses browser-specific
drivers to run tests and doesn’t rely on a JavaScript engine, unlike Selenium RC.
4. What are the Advantages & Disadvantages of Selenium WebDriver?
Advantages:
- Supports multiple browsers (Chrome, Firefox, etc.)
- Supports multiple programming languages
- No need for a specific server to execute tests
Disadvantages:
- No built-in reporting feature
- Limited support for handling images, CAPTCHA, etc.
- Doesn’t support desktop applications, only web-based.
5. WebDriver Architecture in Selenium 3 & Selenium 4?
In Selenium 3, WebDriver interacts directly with the browser using browser-specific
drivers, making HTTP requests. In Selenium 4, the WebDriver follows the W3C
Standard, improving browser interaction by reducing compatibility issues and relying
on native browser support.
, SELENIUM INTERVIEW QUESTIONS AND ANSWERS (PART 01)
6. Communication between the WebDriver and Browser
The WebDriver sends commands (like opening a URL or finding an element) to the
browser through the browser's driver, which converts the commands into HTTP
requests. The browser processes these requests and sends back the results.
7. What is the architecture of Selenium WebDriver?
WebDriver has a layered architecture where the client library sends commands to the
WebDriver API. These commands are converted into HTTP requests and sent to the
browser driver, which communicates with the actual browser.
8. How to Launch Browsers in WebDriver?
Example to launch Chrome browser:
WebDriver driver = new ChromeDriver();
9. How to Open URL?
Example to open a URL:
driver.get("https://example.com");
10. How to capture the Title of the page?
Example:
String title = driver.getTitle();
11. How to capture the URL of the page?
Example:
String currentUrl = driver.getCurrentUrl();
12. How to capture the page source of the Page?
Example:
String pageSource = driver.getPageSource();