Showing posts with label Selenium 2. Show all posts
Showing posts with label Selenium 2. Show all posts

Part 5

21 : Explain System.out.println();

Answer :
  • System : is a final class in  java.lang package.
  • out : is a static member of system class. It is an instance of This stream is already open and ready to accept output data.
  • println : is a method of .It is an overloaded method.

Part 4

16 : Can we overload static methods? 

Answer : Yes.. There is not any restriction to overload static methods. We can overload static and non static methods in java. VIEW MORE on overloading in java.

Part 3

11 : Why main method is static?

Answer : As we know, We can access static stuff without creating object of class. Because of static keyword with main method, Java virtual machine can directly call it without creating object of class. This way it will provide kind of root to start execution of program.

12 : What is method overloading?

Answer : Method overloading is ability to create multiple methods with same in same class but with different signatures (different input parameters and types). Method names will be same but parameters will be different for all overloaded methods.

Part 2

Core java interview questions for selenium automation testing

6 : What is the difference between static and not static variable?

Answer : Main differences are as bellow.
  • Static variables are preceded by static keyword. For non-static variable, there is not any preceding keyword.
  • Memory is allocated for static variables at the time of class loading. Memory is allocated to non- static variables whenever an object is created.
  • Memory is allocated only once to static variables on class loading. Memory is allocated multiple time whenever a new object is created to non-static variables.
  • Static variable example : Collage name of students, Company name of employees..
READ MORE about static and non-static stuff.

7 : What is the difference between static and not static(Instance) method?

Answer : Difference between static and non static method is as bellow.
  • Method declared with static keyword is static method. If Method declared without static keyword then it is instance method.
  • No need of object to call static methods. Object needed to call instance method.
  • Can not access non static stuff inside static methods directly. Opposite to it, We can access static and non static stuff directly inside instance method.
READ MORE detail on static and non-static stuff.


1 : What is object in java?

Answer : Object Is an Instance of class and it has its own state and behavior. In real world we can say, Dog is object of Animal class which have different state like breed, color, name, hungry, etc and behavior  like wagging tail, fetching, barking etc.

2 : What is class?

Answer : A class is the blueprint or we can say template from which individual objects are created.

By default, Chrome driver browser instance opens with fresh profile when webdriver launch it. So your installed extensions in google chrome browser will not display in google chrome driver browser instance when you run test in chrome driver. Now supposing there is an extension(any xyz extension) which i wants to load with google chrome driver when run your test using selenium webdriver. Is is possible? How to load google chrome driver browser instance with extension? Yes we can do it.. You need to follow bellow given steps to load chrome driver with extension.

Earlier we already learnt how to execute selenium WebDriver test In different browsers like Mozilla Firefox (VIEW THIS POST), Google Chrome (VIEW THIS POST) and IE (VIEW THIS POST) browsers. Sometimes you also need to know browser and OS name and version where your selenium WebDriver tests are running. Supposing you are running your tests on cloud then you

Tool tips are very common elements of web page and visible on mouse hover of element. It can be on text box, link or anywhere else on the page. Sometimes we need to capture tool tip text In Selenium WebDriver to verify If text Is correct or not. Let's learn how to read tool tip text In selenium WebDriver test and then verify It.

If you site Is large then full page can take more time to get loaded completely. In such sites, Single action (like click on link on home page) can take more time as page takes more time to get fully loaded because WebDriver will wait for page get loaded successfully. Can we avoid or neglect this page loading to perform click action even page loading Is In process? Yes we can do It In Firefox driver.

Earlier we learnt many examples on how to create Firefox custom profile for selenium web driver test on run time to Download Different FilesHandle SSL CertificateDisable JavaScript,etc. We will use same concept here to avoid page loading to click on button.

Today most of the applications are using Java Scripts for client side processing like client side validations, etc. So It Is very Important to that If any error related to Javascript Is not present any page of application which can disturb application functionality or user experience In any browser.

What is JSON?
"JavaScript Object Notation" is full form of JSON and it is best way to store information in an organized, easy-to-access and easy to read and understand manner. Here we can use it to store selenium grid config parameters.

Earlier we learnt, How to start single node on one machine as described in THIS POST. Now our next question is "can we run multiple selenium grid nodes on same machine?". Answer is yes. Selenium grid allows us to run multiple nodes on same machine. In general, It is not required to run multiple nodes on same machine as we can control number of browsers as described in THIS POST and number of browser sessions in THIS POST. So it is easy to configure one node on one machine and run test on it as per requirements. But still let's see an example of running multiple nodes on same machine.

Selenium tutorial for beginner is basic requirement of any selenium learner to learn selenium perfectly if it's free and complete. Selenium is very strong and open-source web application automation testing tool so selenium testing tool is booming now a days in software testing industry.

Selenium has different projects like selenium IDE, selenium RC, selenium Webdriver, Appium and selenium Grid. Please note here, I am saying them different projects of selenium not a versions because each selenium project has it's own features and developed for different purpose.

Selenium Tutorial

I have created tutorial series for different selenium projects with examples to support online selenium learner community. My selenium tutorial for beginners with examples will helps you to learn selenium testing very fast. All bellow given selenium project's tutorials will take you from basic to advanced level step by step and you will be master at the end of series. Trust Me !! Selenium RC is officially deprecated now so i have not created tutorial series for RC. Just start with selenium IDE tutorial series and end on selenium grid tutorial series.

Selenium Tutorial

Bellow is selenium java tutorial series of different selenium projects.

1. Selenium IDE tutorial

Selenium IDE is first project of selenium. It is basic record and playback add-on of firefox browser. You can use selenium IDE if your application is not more complex to test. My Selenium IDE tutorial series will helps you to learn selenium IDE.

2. Selenium WebDriver tutorial

Selenium Webdriver is latest project of selenium which is interface and designed to automate web applications. It is designed to overcome limitations of selenium RC(which is deprecated now.) so it is successor of selenium RC. I have created online Selenium Tutorial for beginner tips expert level selenium learners. Also i have created series of selenium interview questions with 110+ interview questions. It will helps you to face selenium testing tool interview.

3. Appium tutorial

Appium is mobile native, web and hybrid application test automation testing framework. You can automate ios and android apps using appium. Appium Tutorial series is created to describe how appium works with examples.

4. Selenium Grid tutorial

Selenium grid helps you to run your selenium automation tests in parallel on different machines and browsers to speedup your test execution. So you can run your tests on different machines which are running different browsers on different operating systems. Selenium Grid Tutorial series which is created to show you how actually grid can helps you to speed-up your test execution process.

All above selenium tutorial series are created with practical examples and detailed description on each topic. Start selenium learning today to put your step in selenium automation testing industry and also share your new ideas with others.

5. Selenium Video Tutorial

Also you can subscribe for selenium video tutorial if you can pay some bucks for learning. As per my view, investment in education/learning is best investment.

"timeout" is node configuration parameter using which you can set timeout for selenium grid node browser session. If you set "-timeout 20000" and run test, If node browser not receiving any command and stay ideal for 20 seconds then it will be closed automatically by -timeout parameter. That means it tells node browser -> "wait max 20 seconds to receive any command else close browser and clear session". Lets take practical example to understand "timeout" clearly.

We learnt about "maxInstances" in my PREVIOUS POST. "maxSession" is another configuration parameter which helps to set max allowed sessions to run at a time on that specific node. Here session means number of concurrent browsers in terms of all browser. It will not allow that specific node to open browser more than value of "maxSession". Let's understand with very simple example scenario.

"maxInstances" is configuration parameter which is used during selenium grid 2 node configuration. Using "maxInstances" in selenium grid 2, We can set "how many max number of same browser instances are allowed to open and run software test at same time". "maxInstances" tells node machine to not allow more than allowed instances on that specific machine at the same time. Lets discuss one example to cleat your doubts.

In my previous post, We learnt how to execute selenium WebDriver single software automation test in multiple browsers in parallel using Selenium Grid 2. We had used "parameter" tag in testng.xml file to feed browser name in which your software automation test needs to run in parallel. Instead of using @Parameters, We can use @DataProvider annotation method to feed browser names and run selenium WebDriver test in parallel using selenium Grid 2.

Main advantage of selenium grid is we can run webdriver software test cases in parallel using selenium grid 2 environment to reduce software test execution time as described in THIS POST. Also It helps us to perform compatibility testing as it is supporting multiple browsers too. Earlier we have configured selenium grid 2 hub in THIS POST and selenium grid nodes in THIS POST in just single machine. Now lets try to use this environment to execute webdriver software automation test cases in parallel.

As described In my EARLIER POST, Selenium grid 2 Is useful to execute webdriver software tests on multiple nodes In parallel. So we need to set up selenium grid 2 nodes for webdriver software test execution. But before that, Your selenium grid hub should be configured and in running mode as described in my PREVIOUS POST. Now lets configure selenium grid 2 single node to execute webdriver software automation tests in parallel in selenium grid.

This selenium grid 2 tutorial will guide you how to use selenium grid 2 to perform distributed software test automation in order to speedup software test execution process. Using selenium grid 2, You can execute your software automation test in different OS, different versions of browser and execute software automation tests in parallel. Follow the tutorial links given at bellow to learn selenium grid 2 from scratch.

Selenium Grid 2 Tutorial