Selenium is an open-source automation testing framework used to automate web applications.
It allows testers to write test scripts in multiple programming languages like Java, Python, and C#
and execute them across different browsers and operating systems.
Q2. What are the components of Selenium?
Selenium has four main components: Selenium IDE for record and playback, Selenium WebDriver for browser automation, Selenium Grid for parallel execution, and Selenium RC which is now deprecated.
Q3. What is Selenium WebDriver?
Selenium WebDriver is a browser automation tool that directly communicates with browsers using browser-specific drivers. It does not depend on a server and provides better control, speed, and stability compared to older Selenium tools.
Q4. What are the differences between Selenium 1 and Selenium 2?
Selenium 1 used Selenium RC which required a server to interact with browsers, while Selenium 2 introduced WebDriver that communicates directly with browsers, making it faster and more reliable.
Q5. What is the difference between Selenium RC and WebDriver?
Selenium RC requires a server and injects JavaScript into the browser, whereas WebDriver interacts directly with the browser using native drivers, providing better performance and accuracy.
Q6. Name the different types of WebDriver.
Common WebDrivers include ChromeDriver, FirefoxDriver, EdgeDriver, SafariDriver, and InternetExplorerDriver.
Q7. What are the major advantages of using Selenium WebDriver?
Selenium WebDriver supports multiple browsers, programming languages, and platforms.
It is fast, reliable, open-source, and integrates easily with testing frameworks like TestNG and JUnit.
Q8. Can Selenium handle window-based pop-ups?
Selenium cannot handle window-based pop-ups directly. External tools like AutoIT or Robot class are used to manage such pop-ups.
Q9. How do you launch a browser using WebDriver?
A browser is launched by creating an instance of the specific WebDriver class, such as ChromeDriver or FirefoxDriver.
Q10. What is the get() method used for in WebDriver?
The get() method is used to open a specific URL in the browser and wait until the page loads completely.