devops -selenium
devops -selenium
OF ENGINEERING AND
TECHNOLOGY
DEVOPS LAB PRESENTATION
HALL.NO : 22L51A05C8
BRANCH :CSE-C
SELENIU
M
Selenium is a widely used tool for testing web-based applications that
checks if they are doing as expected. It is a prominent preference
amongst testers for cross-browser testing and is viewed as one of the
most reliable systems for web application automation evaluation.
Selenium is also platform-independent, so it can provide distributed
testing using the Selenium Network. Selenium is a powerful tool for
controlling web browsers through programs and performing browser
automation. It is functional for all browsers, works on all major OS and its
scripts are written in various languages.
EXPERIMENT NO.: 10. Install and Explore
Selenium for automated testing
DESCRIPTION:
To install and explore Selenium for automated testing,
you can follow these steps:
Install Java Development Kit (JDK):
• Selenium is written in Java, so you'll need to install
JDK in order to run it. You can download and install JDK
from the official Oracle website.
Install the Selenium WebDriver:
• You can download the latest version of the Selenium
WebDriver from the Selenium website. You'll also need
to download the appropriate driver for your web
browser of choice (e.g. Chrome Driver for Google
Chrome).
Install an Integrated Development Environment
(IDE):
IntelliJ IDEA, and Visual Studio Code.
Write a simple test:
• Once you have your IDE set up, you can write a simple test using
the Selenium WebDriver.
Here's an example in Java:
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class Main { public static void main(String[] args)
{ System.setProperty("webdriver.chrome.driver",
"path/to/chromedriver");
WebDriver driver = new ChromeDriver();
driver.get("https://www.google.com");
System.out.println(driver.getTitle());
driver.quit();
}
}
• Run the test: Run the test using your IDE or from the command
line using the following command:
$ javac Main.java
$ java Main
Applications