Posts

Showing posts with the label Selenium Webdriver

Features and Future of Selenium Webdriver

Image
Features of Selenium Webdriver: 1. Opensource/Freeware : Selenium is free of cost. It means you do not have to buy any license like other softwares or do not have to pay to anyone for using Selenium for automation testing. 2. Web Functional Framework : Selenium can only be used for automation testing of web applications/website. It is a functional testing tool so we can only automate functional test cases. 3. Multi-Language Support : It is one of the major benefits of Webdriver. Selenium Webdriver supports many languages like Java, Python, PHP, C#, Ruby, Perl etc. So, it provides the flexibility to automation test engineers to automate test cases using any one language that they are comfortable. 4. Cross OS Support : Selenium supports multiple OS like, Windows, Linux, Unix, Mac. So if you have written webdriver automation code using windows platform, then same automation code could be used on other OS platforms like Unix, Linux, Mac. 5. Cross-Browser Compatibility Test

How to Find Broken Links on a Webpage with Selenium Webdriver

As an automation tester you get to play with links present on the website. Links are one of the most important part of the webpage. Some times we need to check which links are present on the page and some times to verify all the links are working. Luckily, Selenium Webdriver has the flexibility to do both the things. Otherwise it could be a tedious task to check manually that all the links present on a webpage are working or not. Selenium code to Get All Links from a Web page public class FindAllLinks { public static void main (String[] args) { // Initialize Webdriver Object System. setProperty ( "webdriver.chrome.driver" , "D:\\mydir\\chromedriver.exe" ); WebDriver driver = new ChromeDriver(); driver. get ( "http://techlistic.com/" ); // Store all link elements (anchor tag elements in html) in a list java. util . List links = driver. findElements (By. tagName ( "a" )); // Print no. of links stored in list Syst

Feedspot has rated Techlistic.com as "Top 10 Selenium Blogs"

Image
We are excited to spread the word that Techlistic.com has been awarded as Top Selenium Blogs  by Feedspot. We at Techlistic always serves you with best tech tutorials, blogs, practice exercises, interview material and many more. Feedspot has analysed Techlistic's Selenium Tutorial Series and find it in-depth and easy to understand. It is the recent entry to the list of 13. Our Selenium Tutorial is consists of all Selenium Commands, Example Programs, Demo Website link, Practice Exercises and TestNG Integration. This award has boost our confidence and we are more committed to deliver tutorials on Advanced Technologies like AI, ML, Blockchain and latest Automation tools in the coming time. Stay Tuned! If you are enjoying our tutorials then please share it with your friends, colleagues etc. I would like to specially thank all our viewers for supporting us! You can follow us on different social platforms to get updates on latest tutorials and posts. Subscribe

Implicit, Explicit and Fluent Wait in Selenium WebDriver

In this post, you will learn about different waits in Selenium. Waits are required to tell Selenium to wait for a specific amount for elements on the web page before throwing "No Such Element Exception". There are three types waits in Selenium Webdriver, out of which first two are the most popular. Implicit Wait Explicit Wait Fluent Wait Implicit Wait in Selenium Webdriver Implicit wait is used to set a default wait time (say 30 secs) in your automation script to wait for an  element on the page. Key Points Implicit wait should be declared in your setup method (at beginning lines of your code). Default wait time for Implicit wait is 0 secs. Once implicit wait is set, it is applicable for the whole automation script. In simple words, you can also say that implicit wait is the maximum time set between two steps/commands of the automation script. Webdriver throws "No Such Element Exception" if element is not found in specified time. Syntax: //

Top 10 Most Widely Used Automation Testing Tools

Image
In this swiftly changing world, technology and tools are changing rapidly. But still there are few tools which are in the market from so long and performing so well and are in my list. I am sharing my list  of top 10 automation testing tools with you. 1. SELENIUM WEBDRIVER Selenium automates browsers. That's it! What you do with that power is entirely up to you. Primarily, it is for automating web applications for testing purposes, but is certainly not limited to just that. Boring web-based administration tasks can (and should!) be automated as well. Features: Selenium is free of cost. Selenium only supports Web automation. Selenium requires coding skills. Selenium supports many languages like Java, Python, PHP, C#, Ruby, Perl etc. Selenium supports all platforms, Windows, Linux, Mac. Selenium supports almost every browser like Chrome, FF, Safari, Opera, IE and their versions. It gives the flexibility to integrate Java or Python modules, other automation

How to Take Screenshot with Selenium WebDriver

Image
While performing manual testing we often take screenshots of the broken pages or bugs to use them as evidence and they are very useful in convincing the developers. Similarly, in automation Selenium provides us the commands  to capture screenshots of the webpages. In this tutorial, we will learn to take full screenshot and partial screenshot of the webpage which is currently under test. We can also write some code logic to capture screenshots on every failure screen. That's a bit advance level concept. But in this post we'll learn to take screenshots whenever we want. We also have to do some file handling operations while taking and saving screenshot with Selenium Wendriver. 'TakeScreenshot' is the interface which is used to capture screenshot in Selenium Webdriver Let's discuss the code to take screenshot step by step: 1. File -  It is one of the inbuilt Java class which is used for File handling operations, like open a new file, read/write a file etc. For takin

Automate Google Search with Selenium Webdriver

Image
In this post you will learn to automate Google Search using Selenium Webdriver with Java. This is a real time example of Explicit wait command. Google search is an ajax call. We will handle this ajax call using Explicit wait command of selenium Webdriver. What is ajax? Ajax stands for Asynchronous Javascript and XML. Ajax is a new technology for creating for faster and more interactive web applications. What ajax does is: Update a web page without reloading/refresh it Read data from the server after the page is loaded When you write something into a Search Box say "app" and it shows you similar search options that is ajax. And you can automate that auto suggestion box with the help of Explicit command in Selenium Webdriver . Google search is a best example of ajax. In case of google search, you simply type any keyword in search bar and just below the search bar a suggestion box with matching suggestions appears instantly, this is ajax. We can handle ajax in Selenium

Implement code re-usability in Selenium Automation Framework

In this post, you will learn kind of coding pattern which is very helpful in maintaining our automation code. This post is written insight to help beginners. We'll learn that instead of writing a linear script, we should create page (action) methods which in general contain actions which we are going to perform on our web software. Let's say, we have a login functionality in our software and we have to automate it. In that case we'll create a method named login and write the commands like, entering username, password and click login in that method. Now we can use that method wherever we need it in other test cases as well. Benefits of using action methods are: Code Re-usability Better maintainability of code Sample Program for Re-Usable Action Methods: package com . techlistic . tute ; import org.junit.Assert ; import org.junit.Test ; import org.openqa.selenium.By ; import org.openqa.selenium.WebDriver ; import org.openqa.selenium.WebElement ; import o