9

I want to learn Selenium WebDriver automation using Java. I have done manual testing before and want to learn automation. I just know the basics of Core Java.

Could you please suggest me the Core topics which one would require to perform test automation using Selenium WebDriver?

What topics on which a tester must concentrate and what topics to ignore in java programming?

1
  • Is knowledge of Java even necessary? Aren't there Python bindings for Selenium?
    – Flimm
    Jan 27, 2017 at 11:28

9 Answers 9

8

Java

My experience is, that the basics of Java suffice to start developing test cases with Selenium 2 / WebDriver. Myself started developing of Selenium test cases with a basic knowledge about Java. The more test cases I wrote and solutions I had to find, the more I leaned about the programming language.

Unit Testing Framework (JUnit, TestNG)

Write some simple unit tests (without Selenium) to learn the basics of the unit testing frameworks and read the documentation. The more complicated stuff of the framework comes automatically by writing tests with Selenium 2 / WebDriver.

Apache Maven

Apache Maven is an Build Management Tool. It can manage dependencies (libraries). But it is also very useful for testing stuff. It exists plugins to create test reports, run tests in parallel or configure the test runs.

2
  • 1
    +1 for the unit testing framework section. With WebDriver in particular you'll have to get used to many of the features of these frameworks. Sep 2, 2014 at 20:21
  • +1 to the answer. I'd say the more you know about concepts of java the more comfortable you will be to write more complex tests. Usually you might be writing test frameworks for unit testing where you will require to write many complex conditions and decisions, so a good knowledge and hands-on experience of java will always be a good plus for you. Jul 10, 2015 at 16:54
1

The answer to this depends on what level of coding do you wish to do? How complex will your test script be?

To begin with you might want to learn basic/core java and then keep on improving with practice and seeking help from others to put together complex scripts to test complex software.

1

I think you will benefit if you research the following:

  1. Basics of Java (as pointed out in other answers): You may need to know some libraries/concepts like:

    • Apache POI: To read/write to excel files, in case you read test data from an excel file and pass it to your test script
    • XML Parsing: In case you pass test data from an XML file
    • TestNG: Testing framework with a reporting structure.
    • ATU Graphical Reporter (just a suggestion): This goes well with TestNG and gives great reports.
  2. XPath and Css-Selectors - Here, I mean you should be able to construct well formed XPath and CSS-Selectors.

  3. External Tools like AutoITx4Java or AutoIT - You may need to know this tool in case a part of your script deals with Windows popups.

1

The level of Java knowledge depends on what you want to do with Selenium.

You may just want to write some simple test automation scripts in which case basic Java knowledge is sufficient.

If you want to make your test automation code re-usable, then object oriented programming concepts are important.

If you want to create a framework, then learn advanced Java concepts like polymorphism, abstract classes, interfaces, etc.

See more on this topic on http://test-able.blogspot.ca/2015/08/how-much-java-do-i-need-to-learn-for-selenium.html

Disclaimer: poster is the author of the linked blog post.

0
  • Learn the basics of JAVA(any programming language) - Door step to Selenium2 automation

    Assuming you have a basic understanding of HTML, CSS

  • Learn about locators, simple selenium commands and try to automate simple functionality
  • Once you got to know how to control the browser, you can go on using the frameworks like TestNG(preferrable) or JUnit
  • Learn Javascript, which will help you in many ways, with Selenium it is more powerful

If you have done the above things well, you will go yourself by the advanced usage of selenium to automate complex functions.

So, you will go across, Different Testing frameworks, Logs, CI, Build Management and so on.

Happy automation:)

0

Important Java concepts with respect to Selenium :

  1. Condition statement and looping statement
  2. Exception Handling
  3. Methods of String class
  4. List and Set
  5. Upcasting and Runtime Polymorphism
  6. OOPs concepts with examples
1
  • 1
    As it stands, your answer doesn't add anything to the existing responses - please edit your answer to give more information for each listed item.
    – Kate Paulk
    Jun 23, 2015 at 11:04
0

For Working on Selenium WebDriver with Java , you can focus on below Java concept and other related stuff, I am just giving you bigger picture.

  • Java Basics (oops concept & programming concept)
  • Java Collection Framework
  • Java FileOperations (using apache POI or Jexcel) , ExceptionHandling , logger would be plus point.
  • Junit or TestNG to start with unit testing so you can assert your test cases.
  • Need to have knowledge of HTML basics so you can use them in selection elements using various mechanism mainly with ID , Xpath , CSS Selector which is vital for working with selenium framework ( Most Important).
  • for Day to day working efficiency need to learn Jenkins(conceptually) , Maven & repository operations.
  • There are several standard framework is used by companies so look at them and understand it , like Page object pattern, Hybrid framework , keyword Driven framework etc.

Let me know if you have any doubt in it.

0

When Automated Testing you should strongly favour the same technology stack that is used by the development team to minimise technological proliferation. In Java that would be Apache Maven, JUnit, Slf4j running under Jenkins. Technology none-proliferation.

Learn Test Driven Development using JUnit to drive your webdriver test cases. Once you have mastered those, learn Cucumber-jvm and start expressing your test cases in BDD.

-1

You should Know Object oriented Concepts by using any programmig language like: C#, Java etc.
You should know the Collection framework in C# or Java to handle the objects.
You should know the HTML.
You should know JavaScript.
you should know Excel manipulation in java or C#.
you should know how t connect database in java JDBC and in c# ADO.Net.
You should know the JUnit or NUnit Testing framework and their Annotations or Attribute.
You should know any IDE either Eclipse or Visual Studio. External tools like Point position or AutoIt v3 etc...

3
  • 1
    This list makes no sense. JDBC? really. To create Selenium test you do not need knowledge of the database and then even SQL would be more usefull. I have never used Excel while creating tests. Which IDE you use is also irrelevant. Collection framework? Never heard of it, your list contains specifics for your environments you worked with. Jun 8, 2015 at 8:27
  • 1- means that you are you are not fully aware about any Object Oriented Programming features collections. As you spoke about List what is list? it is an one type of collection. Have you ever user Set, HashTable,List,vector these are comes under collection. 2- If your are using Test driven Framework then your test data is present in Excel Sheet. Are you agree with my answer. same like that if you are accessing data from any database using SQL. Make Sense. Jun 9, 2015 at 13:52
  • Basic required programming knowledge should include: if/then/else, OO classes, property and method, variable types like ints, booleans and arrays. You specific named it "the Collection framework", when Googling I hit the JCF which I never used. Better would be best practices like the Page object model: code.google.com/p/selenium/wiki/PageObjects Jun 9, 2015 at 14:33

Not the answer you're looking for? Browse other questions tagged or ask your own question.