Tutorial by Examples

Prerequisites: Java is installed Selenium is extracted in a folder (Contains 2 files, and 1 folder) Follow these steps to set up IntelliJ Idea for Selenium. Click On "New Project". Choose Java < "Hello World" Application Type the name of the Project, and create it....
Prerequisites : ChromeDriver is downloaded Copy the following code into your class. public static void main(String[] args) { System.setProperty("webdriver.chrome.driver", "path of the exe file\\chromedriver.exe"); } If you're using linux, give the path to the ChromeDri...
We use the get method to go to a website. For Example, this would open google public static void main(String[] args) throws InterruptedException { System.setProperty("webdriver.chrome.driver", "path of the exe file\\chromedriver.exe"); WebDriver driver = new ChromeDriv...
Every Html-Element in Selenium is called a WebElement. For example, a p tag would be a WebElement, an a tag would be a WebElement, etc. Consider the following html Structure: <a id="link1" href="https://www.google.com">google</a> <p class="p1"> This...
Now that we know the basics of Selenium, we can make our own project. For this example, we'll be making a program, which finds the Newest questions on stack-overflow. We start easy, lets open stack-overflow. public static void main(String[] args) throws InterruptedException { System.setProper...
To get the attribute of a WebElement, we use getAttribute on that WebElement. For example, consider the following html tag <a id="click" href="https://www.google.com"> We can find the Element's href attribute by WebElement e = driver.findElement(By.id("click&quot...

Page 1 of 1