How Much Java is needed to learn for writing Selenium Script

Selenium is a web automation tool which enables us to automate the web browsers. Selenium Webdriver supports different languages like Java, python, c#, Ruby or other. So we can choose any language to write our script. If we want to learn Selenium, we need to have basic knowledge about one programming language – don’t have to be an expert.

Here I have listed down some of the Java essentials which we need to learn before jumping to Selenium Scripting

  • OOPS concept – Class, Objects, Abstraction, Polymorphism, Inheritance and Encapsulation
  • Programming essentials – Object Instances, variables, method overloading/overriding concepts and packages, Constructors,Abstract Class, Interface etc..
  • Control Statements – If statements, While, do-While, Switch – This will help us in writing the scripts for multiple scenario statements and decision making scenarios.
  • Looping statements – This can be used to execute the same statements multiple times for ex; iterating through a large table to find a record and logging into 5 different accounts using same method.
  • Arrays Concepts – We don’t want to keep writing variables all over our test scripts. For that we need to create a placeholder for similar type of variables. So, concept of Array allows us to string related variables together into one single variable that’s easy to use.
  • Threads and Multithreading Concepts – Multithreaded program contains multiple activities that can run concurrently and each part can handle different task at the same time making optimal use of the available resources. That will help us in achieving better performance.
  • Java Collections Framework – This framework is provided in the java.util package. Objects can be stored, retrieved, and manipulated as elements of collections. Collections can be used in various scenarios like Storing phone numbers, Employee names database etc. They are basically used to group multiple elements into a single unit.
  • File Streams – This will be helpful in externalization of data through CSV, Excel or Java Properties file.
  • Exception Handling – When an error occurs in a Java program it usually results in an exception being thrown. Java exception handling enables the Java applications to handle the errors. Exception handling is a very important aspect of writing robust Java applications or components.

There are many things in Java. But we need these basic things before jumping to Selenium scripting.

Regards,
Pratima Rout
QA Engg., Mindfire Solutions

Leave a comment