There are two class suppose Class A and Class B.
both the classes have the
    same methods. class B extends class A We create the object of class B inside
    class B. Then which method will be called.
    Childclass method.
    ParentClass obj = new ParentClass(); obj.method – calls parentclass method
    ChildClass obj = new ChildClass(); obj.method – calls child class method
    ParentClass obj = new ChildClass(); obj.method – calls only overridden
    methods of child class
    ChildClass obj = new ParentClass(); Error
    Parent class cannot access child class methods.
   Write a program to remove the duplicate character from a string
    Using LinkedHashSet
   Write a java program to reverse the string
    Use StringBuffer and StringBuilder class
   Write the java program to count the occurrence of character from a string
   There is a variable declared inside the Interface. Can we change the value of
    the variable?
    you cannot change the variables declared in interface because by default, they are
    public, static and final.
   String is immutable or mutable.
    In java, string objects are immutable. Immutable simply means unmodifiable or
    unchangeable. Once string object is created its data or state can't be changed but a new
    string object is created.
   What is the difference between : WebDriver driver=new ChromeDriver();
    ChromeDriver driver=new ChromeDriver()?
   WebDriver is Interface or class? If it is an Interface then the methods which
    we are using is written under which class?
   What is the difference between List and Set?
   What are the two different files used in Cucumber?
   What is the difference between Agile Scrum and KANBAN? Explain with a
    practical example.
   How to click on all the links on a webpage
   Why do we use Protractor and how is it different from Selenium?
   Questions on Framework, explain the framework you are using in your
    current company.
   Difference between explicit and implicit waits?
   How will you handle alerts?
   How will go from one application to another like mainframe and all(I am not
    sure)
   WAP to print occurrence of elements and count of elements from given in
    the array.
   What challenges did you face while doing Automation?
   Few scenario-based questions
   Have you worked on another testing like ETL performance and all other than
    application testing?
   What do you to fetch data from excel?
   What are Hooks and tagging in BDD Cucumber?
   Ask to write XPath using parent and following sibling.
   If an element is not clickable, what will be your approach?
   Few more questions from the interface and classes
   What is your strength? 😃
   Reporting and CI/CD pipeline, integration to Jenkins were you involved?
   What is java, how JVM works, how java is platform-independent?
   What is the java classloader!!
   How do web services work- he was not happy with 2-3 points explanation on
    API architecture
   How does microservices are built?
   When do we use java for selenium, why not other languages
   What abstract class, interface- not definition, the concept behind it
   How Jenkins pipeline is built
   Only 1 question on selenium what’s XPath?
   15 min on typical agile questions
   Project summary
   What are Maven and its use in running test cases?
   What is absolute and relative XPath?
   Difference between XPath and CSS and which is faster?
   Advantages of the testing framework.
   What is traceability in software testing and what do you mean by
    Requirement Traceability Matrix (RTM)?
   How the regression reports are generated in your project?
   What do you mean by priority and severity in planning and tracking tools like
    JIRA?
   SQL query to fetch the second highest salary from a set of records.
   How to handle window pop-ups using selenium automation?
   What do you mean by defect lifecycle?
   Estimation and estimation tools used in your project.
   What is it like maintaining the regression pack and integrating it on CI/CD
    tools like TeamCity and Jenkins? (Project specific)
   How can we handle Captcha with Selenium automation?
   Can we create a constructor as private?
   Can we override private methods?
    No, we cannot override private or static methods in Java. Private methods in Java
    are not visible to any other class which limits their scope to the class in which they are
    declared.
   Program to count the occurrence of a specific word in the sentence
   Make XPath for locating specific column in dynamic web table
   How to double-click on the element in selenium?
   How to switch from the 5th frame to the 4th frame in case if all are nested?
   Validate the color of the progress bar at different points for eg:- at 100% it
    becomes green and before that it remains orange so how will u validate that
    green color has appeared?
   How to click on the last element always for a dynamic drop-down in which
    element change along with position and their count changes?
   Suppose I have three classes A, B, and C, where C extends B and B, extend A,
    so can we call the constructor of A from C by writing like super.super() is it
    correct?
   Brief Description
   How will you rate yourself in Selenium?
   SIDE
   How will you handle pop-ups?
   Which framework you are using in your project & why.
   How will you handle javascript pop-ups?
   How will you handle the SSL issue?
   How will you take a screenshot?
   How will you handle AJAX? Explain it with code.
   Explain your framework.
   What is STLC, Test Plan & Defect Life Cycle(Procedure to file a defect)
   Traceability matrix
   Selenium Grid concepts with code? RC
   Project Description
   Difference between Implicitly Wait and Explicitly Wait
   When will you stop testing?
   Thread 7 Synchronization in Java
   How Selenium IDE Different from UiPath
   Selenium IDE?
   How will you handle pop-ups?
   Which framework you are using in your project & why.
   How will you handle javascript pop-ups?
   How will you handle the SSL issue?
   How will you take the screenshot?
   How will you handle AJAX? Explain it with code.
   Explain your framework.
   What is STLC, Test Plan & Defect Life Cycle(Procedure to file a defect)
   Traceability matrix
   Selenium Grid concepts with the code? RC?
   Project Description
   Diff between Implicitly Wait and Explicitly Wait
   When will you stop testing?
   Thread 7 Synchronization in java
   What difficulty did you face in Automation?
   What you do with your code when a new version of the browser is launched?
   What are the features in your automation code?
   How to integrate HP ALM/HPQC with Selenium?
   How you are sending the emails from a framework, as .rar files are blocked
    in most of the companies?
   How code review is done for your code?
   Tell me abt ur framework (i explained the POM framework)
   Draw a diagram of whatever framework u explained
   Show the connection between all the packages u explained
     Explain ur role
     What r TestNG annotations, wat annotation u used in your project, and
      explain what each annotation does
     How do u fetch data in DataProvider….asked the program to be written
     How do u run ur test scripts?
     How many test cases do u have in your test cases package
     if there r 100 test cases, u want to run 50, how to do that
     What do u do when there is a Defect
     Defect LifeCycle
     What do u do in a Defect Triage call
     What is SDLC? Explain each phase, explain the documentation in each
     What r exceptions
     Where do u use it and y don’t u use it in the Pages package
     What Reporting technique u use
     How to pass PASS or FAIL to Reporter class
     What are Hub and Node
     How do u handle alerts?
     How to get the text of Alert
     How do u take the alert snapshot?
     How to handle windows
     Which Selenium version u use now
     What Selenium version u started working
     Explain interface with an example
     What is version control you use in the current project?
     How do u schedule execution using Jenkin
     What is maven
     Difference between Explicit n Implicit wait
     Explain to me how can we schedule the test case in Jenkins to run at a specific
      time?
      Ans: In Jenkins, there is one option to build periodically. U can schedule the build
      over there using the following option.MINUTES Minutes in one hour (0-59)
      HOURS Hours in one day (0-23)
      DAY MONTH Day in a month (1-31)
      MONTH Month in a year (1-12)
      DAY WEEK Day of the week (0-7) where 0 and 7 are SundayExample: */5 * * * *
      means every 5 minutes OR 5 * * * * means the 5th minute of every hour
Infosys Technical Round
     How Many Project u have Done
     Explain your project flow(They ware about u domain Like E-commerce,
      Banking)
     Write a used Case(Any test case) of your project and Automate (Write a
      Selenium Code) & I have Written the CheckOut process
     Explain Your FrameWork and What u have done in Your frameWork, Have u
      involved in the Design of FrameWork ya u have Used Existence FrameWork.
     What is the Component of Selenium (how to Setup Selenium project)
     What is Selenium RC?
     What is Selenium Grid?
     What is Selenium IDE?
     What is TestNG?
      TestNG is an automation testing framework in which NG stands for "Next
      Generation". TestNG is inspired from JUnit which uses the annotations (@).
      TestNG overcomes the disadvantages of JUnit and is designed to make end-to-
      end testing easy.
     Explain All annotation of TestNG
     They have Given Scenario U have ExcelSheet that gives data like Row col
      1 username pass
      2 invalid username pass
      3 valid username invalid pass
      4 invalid username pass
      Write a Code to fetch data from excel and Display?
Infosys Java Questions:
           What is the difference between final, finally, finalize
           What is the difference between Call by value and call by reference
           How to find out the length of the string without using the length
            function
           How to find out the part of the string from a string
           Difference between throw & throws
           What is binding (Early and Late binding)
           He gives Programs
            1.Reverse a number
            2.1,2,3,4,5,65,76,5,,4,33,4,34,232,3,2323,
            find the biggest number among these
         Simple string programs.
         What is exception types of exception?
From Manual:
         What is the test case technique?
         Why we write a test case.
         Bug Life Cycle
         What is the different status of a bug?
         What is the difference between functional and smoke?
         What is STLC?
         He gives an application & tells them to write the scenario
         Some manual testing concepts
         Explain your roles and responsibilities
         Explain Automation Life Cycle
         Which Framework U have Used?
         Explain Ur Framework
         What are the things u stored in PageFactory? Why?
         What is Constructor?
         Where u have used the constructor in Selenium?
         Which model u have followed in your company?
         How do you handle dynamic objects on a web page?
         How do you handle untrusted SSL certificates in Webdriver?
         What is the difference between the Before method and the Before
          test?
         How to verify a particular image and its size on a web page? (Web page
          has got many images out of which you have select particular one)
         What is the use of DesiredCapabilities in Selenium WebDriver?
         How do you know the Remote m/c details? Like OS, browser details.
         How do you find out active elements?
Selenium Real Time Interview Questions
         Write code for Action class
         Write code for positive and negative scenarios for Alerts
         Write code for handling multiple windows
         Find odd number
         Disadvantages of Selenium
   Difference between get() and navigate().to()
   Write code to click on the Check box which is inside the Dynamic Table
   Write code for taking Screenshot
   Explains Maps in Java
   Explain framework (Questions based on your framework explanation)
   What is Pom.xml
   Which is the correct Xpath for this code (Lot of questions on Xpath)
   Xpath methods Ex: Starts-with & Contains
   The syntax for the CSS selector
   How to identify dynamic images
   From a given string, separate characters, integers, and special
    characters and store in a separate variable and print them
   Remove duplicates from ArrayList
   Print all the frame names
   How to read from XML or CSV file and store in hashmap
   Get the value of a cell in the Dynamic table
   What is the Burndown chart (Agile)
   Print these characters from a given string and change them to
    uppercase
   Explain Access specifiers
   Difference between Priority and Severity
   Example for High Priority and Low Severity and vice versa
   Difference between Test Strategy and Test Scenario
   What Software Metrics you have used in your project
   How to handle Dynamic Elements, since the webpage is designed in
    Angular Js
   Implicit and Explicit Waits
   Write code for Cross Browser Testing
   Explain Method Overloading and Method Overriding with Example
   What is Static Keyword
   Dependencies in Pom.xml
   Write code for fetching data from Excel
   Select this value in the dropdown and hover to this element and click
   Assert and Verify
   Check if a given string is Palindrome or not
   Remove duplicate characters from a string and print
   Which Code Repository you are using (Ex: GitHub)
   How will you estimate the time to automate a scenario?
   How to perform Right Click
   In a Dynamic Table, if I give 1 cell value, it should give me the values of
    other cells in that row
   Have you Developed any Tool, If yes explain
   Write code for handling Frames
   Read from a text file and store it in HashMap
   Print the occurrence of each character if it is present more than once in
    a given string
   Write code for nested drop-down, You have to check all the values in
    the dropdown, All permutation, and combination
   Advantages of Selenium
   How to check if a checkbox is displayed
   If the element is not present, how will you print the Element that is not
    present in the message?
   What all exceptions you have faced
   What all difficulties you have faced in Selenium
   What all TestNG Annotations you have used in the project
   Where will you maintain the code?
   What all Collections, you have used in your project
   How to run multiple test cases
   What are Primitive and Non-primitive Data Types?
   What are JDK, JRE, and JVM
   Settings.xml in Maven
   Eliminate first and last string from array and print
   What is Encapsulation
   What is the use of build() and perform() in Actions
   How you will check the actual vs expected result
   Xpath Axes, Ex: Following
   Automate Menu and Sub Menu and click on a link in Sub Menu and
    navigate to the page and click on an element
   Syntax for Alerts
   How will you generate Reports?
   What is the execution time of your test cases?
   Print a Reverse Pyramid
   Go to frame and click on the upload button and select the file which is
    in this directory
   Difference between PUTS and POST in API
   Read data from Excel and given that data as input for login and
    password and click on submit and validate the popup which says Login
    is successful
   Read data from two text files and compare if they are the same or not
   Read data from an Excel file and compare the data to the web table
    and check whether it is the same or not
   Select multiple options from the dropdown
   Explain Defect Lifecycle
   How many people are working on your project, what all teams are
    there
   What is your role in your project?
   How often Daily Triage Call will happen and what will be discussed
   What all packages you have used in your project
   How will you check Broken Links?
   Read from a text file and change that content
   Write test scenario for Credit Cards
   How to read Properties file
   Which is the latest Java version and which one you have used and what
    are the features of that version
   Check if the given two strings are an anagram
   What is the difference between Interface and Abstract Methods?
   Difference between BeforeSuite and BeforeMethod
   Difference between Default and Protected
   Write a program to divide without using division or modulus symbol
   String = ‘AaBbCcDD’ ,In that change a lowercase ‘a’ to uppercase
   Hierarchy of TestNg Annotations
   How many Sprints you have worked on, how often you will get Sprints
   How Agile Methodology works
   Do Exceptions have priority?
   Can a try block have more than 1 catch block?
   Can a class be Public, Private, Protected, and Default
   How will you compare the data from the database to the data on the
    webpage?
   Blackbox vs Whitebox Testing
   Explain Waterfall Methodology
   What is Traceability Matrix
   Explain STLC
   Explain SDLC
   What is a class
   What is an object
   What is a variable
   How to clone one list and store it in a new list
        How to run a group of test cases in TestNg
        How to include or exclude test case in TestNg
        How to run the parallel test case in TestNg
        What is Selenium Grid
        Can a Map have a Null value?
        What all different test annotations you have used in TestNg
        How to switch frame in Selenium
        Difference between this and super
        Difference between Constructor and Method
        Difference between String Buffer and String Builder
        Difference between List and Set
        How to run a test suite in different browsers
        What is static and final
        Difference between String and String Builder
        How to run failed test cases in TestNg
        Difference between Iterator and ListIterator
        How to set the proxy in Jenkins
        Explain Maven Life Cycle
        Explain POM
        What will be there in POM.xml
        Without using Select statement, how to select dropdown
        Difference between Sanity and Smoke Testing
        Can the Main Method be overridden?
        What is Retrospective Meeting?
        What all methods String has?
☒ Automation ☒
        What are XPath and its types?
        What are cross-browser testing and parallel testing?
        Challenges faced during selenium testing?
        What is the Actions class?
        How to handle drop-down in selenium?
        How to handle multiple browser pop up?
        How to handle multiple browser tabs in selenium?
        How to perform upload files using selenium?
        How to perform download files using selenium?
        How to get all values of dropdown in selenium?
        How to perform (control + a) through selenium?
   How to shift between tabs of the same browser using selenium?
   What is a Robot class?
   What is AutoIT?
   What is the difference between get() and navigate()?
   What are the difference between findElement() and findElements()?
   What is difference between quit() and close()?
   What are different locators used?
   Difference between XPath and CSS selector?
   Different approaches to click the submit button?
   What is javascriptExecutor and when it is used?
   Handling WebTable(static and dynamic) in selenium
   What is POM? Advantage and its disadvantage?
   What is a maven? list its phases or life cycle? Command to run our
    project through the maven?
   Explain ur project folder structure? Or Explain ur framework?
   What is TestNG?
   How to create and delete cookies?
   What does getwindowhandles() and getwindowhandle() return? Or its
    differences?
   Is it possible to use only perform() without build()? 30.What is perform()
    and build()?
   How to scroll the browser window?
   Preceding sibling and following sibling of custom XPath?
   What is the test management tool used in ur project?
   What is the build automation tool used in ur project?
   How u will handle the SSL certification?
   What are DesiredCapabilities?
   How to verify ‘Bangalore’ present in the dropdown box or not?
   How to verify ‘Bangalore’ present in 4×4 webtable? And print the
    column and row number of it is present?
   How to fetch the data from a particular row and column of excel?
   List all maven plugins like surefire plugin etc
   What is Jenkins? And explain its use?
   Explain the tags present in the testng.xml file
   What is TDD?
   What is BDD? Explain the cucumber framework? What are gherkins?
   What is Listener?
   What is DataProvider?
   What is parameterization?
         What is PageFactory?
         What is Apache POI API? Or how to read data from excel?
         What are explicit and implicit waits?
         What are the challenges faced in automation testing?
         Write code for handling multiple browsers and switch to new windows?
         What is webdriver? And why webdriver is used?
         List some selenium exceptions
         What is StaleElementReferenceException?When this occurs? And how
          to overcome such exceptions?
         How do you group the test cases? And why?
         How to include or exclude test cases?
         What is NullPointerException?When it occurs?
         What is a selenium grid?
         Should have knowledge of all TestNG annotations.
         How do you control the execution of your test cases/test classes?
         Git and its commands
         Maven commands to execute, debug, compile
         What is the current version of maven used?
         How to identify broken links? How have done you in your project?
          Write code or tell approach.
         Write a code to fetch the value ‘Test’ from the excel sheet which might
          be present in any cell in excel. Or check whether the value ‘Test’ is
          present in excel or not.
         How to pass values to textbox other than using sendKeys()?
         How to click the login button other than using click(), submit(), and
          JavascriptExecutor?
         What is subversion?
Manual:
         What are test design techniques? Explain BVA and ECP with some
          examples?
         Explain STLC
         Explain Bug Life Cycle
         What is the difference between bug and defect?
         What are severity and priority?
         Explain SDLC
         What are the differences between smoke and sanity testing?
Selenium Real Time Interview Questions
What are the Selenium Tools, and Testing framework that you are using in
your Current Project?
           Selenium WebDriver for Creating Test Cases.
           Java Programming for Enhancing Test cases.
           TestNG Testing Framework for Grouping Test cases, executing Test
            batches, and generating Test reports. Also used,
           Firebug and Firepath for inspecting elements.
           IE Browser driver, Chrome browser driver for Cross Browser testing.
What is your Project Operating environment?
What is your project domain and Application Environment?
Ans: Our project is Banking Application, Our AUT (Application Under Test)
developed using Java Technology and the Database is Oracle.
What are the major challenges in Functional Test Automation?
Ans:
           Object Identification.
           Debugging Issues. etc…
What are the difficulties that you faced in Object identification?
Ans: Some Elements (Objects) not recognized properly using Selenium WebDriver
Element locators.
How you conducted Data-driven Testing in your project?
Ans: We conducted Data-driven Testing using an external Excel file as Resource, we
added some third-party excel jar files to Java Project in Eclipse.
How you conducted Batch Testing in your project?
Ans: We conducted Batch Testing using TestNG Testing Framework.
How you conducted Cross-browser testing in your project?
Ans: Using Mozilla Firefox, IE, and Google Chrome browsers(Downloaded IE and
Google Chrome Browser drivers). we executed Test cases.
How you handled duplicate Elements in your project?
Ans: Using the index property of Elements we handled duplicate objects.
How many Test cases you wrote for your Project/Module?
Ans: I prepared around 120 Test cases in my Module.
How many defects you detected and give one example?
Ans: I detected nearly 20 Defects in which 5 defects are Severe defects.
How you selected Test cases for Regression Testing?
Ans: We selected Test cases for Regression Testing based on Defect affected Test
cases and from defect dependent Test cases.
How you organized your Test Automation resources?
Did you use any build management tool in your project?
Ans: We used the Maven build management tool in our project.
How you handled errors in your Test scripts?
Ans: We handled errors in our Test Scripts using Java Error handling features.
Did you create any reusable components?
Ans: Yes, We created some reusable components in our project for Login
Functionality, Registration Functionality, etc.
Did you find any Test Scenarios that not to be automated in your project
using Selenium?
Ans: Yes, We find some Some Test Scenarios in our Current project, Functionalities
that require more user interaction, Functionalities that require Dynamic test data
submission.
How to execute multiple Java programs at a time?
Ans: We execute multiple Java programs using an XML file in the TestNG
framework.
How to conduct parallel Test execution?
Ans: Usually We conduct Parallel Test Execution using Selenium Grid, but no
parallel test execution in my Current project.
What Defect management / Test management tool you used in your project?
Ans: We are using the Jira Test Management tool in our project with Selenium.
How you communicated with the development team to resolve the issues.
Ans: We communicate Development team via Our Test Manager.
Did you involve in the Selenium Test environment Setup?
Ans: Yes, I involved in Selenium Environment Setup in my Current Project. As per
my project, we selected Java, Selenium WebDriver and TestNG Framework, and
Maven.
           We Downloaded Eclipse IDE and Extracted it.
           Downloaded Java Software and Installed.
           Environment Variable path setup.
           Downloaded Selenium WebDriver Java language bindings(jar files) and
            added them to Java Project in Eclipse.
           Downloaded and Installed TestNG Framework from Eclipse IDE.
           Installed Maven build management tool.
Generic Selenium Questions
What is Selenium?
Answer: Selenium is a browser automation tool that lets you automate operations
like – Type, Click, and Selection from a drop-down of a web page.
How is Selenium different from commercial browser automation tools?
Answer: Selenium is a library that is available in Various languages, i.e. Java, C#,
Python, Ruby, PHP, etc. while most commercial tools are limited in their
capabilities of being able to use just one language. Moreover, many of those tools
have their language, which is of little use outside the domain of those tools. Most
commercial tools focus on record and replay while Selenium emphasis using
Selenium IDE (Selenium record and replay) tool ONLY to get acquainted with
Selenium working and then move on to other Selenium libraries like Remote
control [RC] (Selenium 1.0) and Web Driver (Selenium 2.0). Though most
commercial tools have built-in capabilities of test reporting, error recovery
mechanisms and Selenium does not provide any such features by default. But given
the rich set of languages available with Selenium, it very easy to emulate such
features.
What is the set of tools available with Selenium?
Answer: Selenium has mainly four sets of tools – Selenium IDE, Selenium 1.0
(Selenium RC), Selenium 2.0 (WebDriver), and Selenium Grid.
Which Selenium Tool should I use?
Answer: It entirely boils down to where you stand today in terms of using
Selenium. If you are altogether new to Selenium, then you should begin with
Selenium IDE to learn Selenium location strategies and then move to Selenium 2
as it is the most stable Selenium library and future of Selenium. Use Selenium Grid
when you want to distribute
your test across multiple devices. If you are already using Selenium 1.0 then you
should begin to migrate your
test scripts to Selenium 2.0
Check Also: Common 50 Selenium Interview Questions
What is Selenium IDE?
Answer: Selenium IDE is a Firefox plugin which is used to record and replay test in
firefox browser. Selenium IDE can be used only with the Firefox browser.
Which language is used in Selenium IDE?
Answer: Selenium IDE uses an HTML sort of language called Selenese. Though
other languages (java, c#, PHP, etc.) cannot be used with Selenium IDE, Selenium
IDE lets you convert test in these languages so that they could be used
with Selenium 1.0 or Selenium 2.0
What is Selenium 1.0?
Answer: Selenium 1.0 or Selenium Remote Control (popularly known as Selenium
RC) is a library available in a wide variety of languages. The primary reason for the
advent of Selenium RC was the incapability of Selenium IDE to execute tests
in a browser other than Selenium IDE and the programmatical limitations of
language Selenese used in Selenium
IDE.
What is Selenium 2.0?
Answer: Selenium 2.0, also known as WebDriver, is the latest offering of Selenium.
It provides
           Better API than Selenium 1.0
           Does not suffer from javascript security restriction which Selenium 1.0 does
           Supports more UI complicated UI operations like drag and drop
What are the element locators available with Selenium, which could be used
to locate elements on a web page?
Answer: There are mainly 4 locators used with Selenium
           Html ID
           Html Name
           Html Tagname
           Html Class Name
           XPath locator
           CSS locators
           Link Text
           Partial Link Text
What is Selenium Grid?
Answer: Selenium grid lets you distribute your tests on multiple machines and all
of them at the same time. Hence you can execute tests on IE on Windows and
Safari on Mac machine using the same test script (well, almost always).
This greatly helps in reducing the time of test execution and provides quick
feedback to stack holders.
Selenium IDE Questions
What are the two modes of views in Selenium IDE?
Answer:  Selenium IDE can be opened either in sidebar (View > Sidebar > Selenium
IDE) or as a pop up window (Tools > Selenium IDE). While using Selenium IDE in the
browser sidebar, it cannot record user operations in a pop-up
the window opened by an application.
Can I control the speed and pause test execution in Selenium IDE?
Answer: Selenium IDE provides a slider with Slow and Fast pointers to control the
speed of execution.
Where do I see the results of Test Execution in Selenium IDE?
Answer: The result of test execution can be viewed in a log window in Selenium IDE
Where do I see the description of commands used in Selenium IDE?
Answer: Commands of description can be seen in the Reference section
Can I build a test suite using Selenium IDE?
Answer: Yes, you can first record individual test cases and then group all of them in
a test suite. Following this entire test suite could be executed instead of executing
individual tests.
What verification points are available with Selenium?
Answer: There are largely three types of verification points available with Selenium
           Check for the page title
           Check for certain text
           Check for the certain element (text box, drop-down, table, etc.)
I see two types of the check with Selenium – verification, an assertion, what’s
the difference between the two?
Answer: A verification check lets test execution continue even in the wake
of failure with a check, while assertion stops the test execution. Consider an
example of checking the text on a page, and you may like to use the verification
point and let test execution continue even if a text is not present. But for a login
page, you would like to add an assertion for the presence of text box login as it
does not make sense to continue with test execution if the login text box is not
present.
Read Also: Einfochips Selenium Automation Interview Questions
I don’t see checkpoints added to my tests while using Selenium IDE, how do I
get them added to my tests?
Answer: You need to use the context menu to add checkpoints to your Selenium
IDE tests.
How do I edit tests in Selenium IDE?
Answer:  There are two ways to edit tests in Selenium IDE; one is the table view
while others are looking into the source code of recorded commands.
What is the syntax of the command used in Selenium?
Answer: There are three entities associated with a command
           Name of Command
           Element Locator (also known as Target)
           Value (required when using echo, wait, etc.)
There are tons of Selenium Command, am I going to use all of them?
Answer: This entirely boils down to operations you are carrying out with Selenium.
Though you would be using the following Selenium Commands more often
           Open: opens a web page.
           Click/clickAndWait: click on an element and waits for a new page to load.
           Select: Selects a value from a drop-down value.
           VerifyTitle/assertTitle: verifies/asserts page title.
           Verify/assert ElementPresent: verifies/asserts presence of element, in the
            page.
           Verify/assert TextPresent:  verifies/asserts expected text is somewhere on
            the page.
How do I use HTML id and name while using Selenium IDE?
Answer: Html id and name can be used as it is in selenium IDE. For example, the
Google search box has a name – “q” and id  “listb,” and they can be used as a target
in Selenium IDE
What is XPath? When would I have to use XPath in Selenium IDE?
Answer: XPath is a way to navigate in an XML document, and this can be used to
identify elements in a web page. You may have to use XPath when there is no
name/is associated with the element on the page, or only a partial part of name/ide
is
constant.
           The direct child is denoted with /
           The relative child is denoted with //
           Id, class, names can also be used with XPath –
            · //input[@name=’q’]
            · //input[@id=’lstib’]
            · //input[@class=’ lst’]
           If only part of id/name/class is constant then “contains” can be used as –
            · //input[contains(@id,’lstib’)]
What is the CSS location strategy in Selenium?
Answer:  CSS location strategy can be used with Selenium to locate elements, it
works using cascade style sheet location methods in which Direct child is denoted
with – (space) Relative child is denoted with > Id, class, names can also be used with
XPath –
· css=input[name=’q’]
· css=input[id=’lstib’]
or input#lstib
· css=input[class=’ lst’] or input.lst
If only part of id/name/class is constant then “contains” can be used as –
· css=input[id*=’ lstib
‘)]
Element location strategy using inner text
· CSS = a:contains(‘log out’)
There is an id, name, XPath, CSS locator, which one should I use?
Answer: If there are constant names/IDs available, then they should be used
instead of XPath and CSS locators. If not, then CSS locators should be given
preference as their evaluation is faster than XPath in most modern browsers.
I want to generate random numbers, dates as my test data, how do I do this
in Selenium IDE?
Answer: This can be achieved by executing javascript in Selenium. Javascript can be
executed using the following syntax –
type
css=input#s
javascript{Math.random()}
And for a date –
type
css=input#s
javascript{new Date()}
Can I store the result of an evaluation and use it later in my test?
Answer: You can use the “store” command to achieve this. You can save the result
of an evaluation in a variable and use it later in your Selenium IDE script. For
example, we can store a value from a text box as following and later use it to
type it in another text box –
storeText
css=input#s
var1
type
css=input#d
${var1}
I have stored the result of an evaluation; can I print it in IDE to check its
value?
Answer: You can use the echo command as following to check the stored value in
Selenium IDE –
storeText
css=input#s
var1
echo
${var1}
Can I handle a javascript alert using Selenium?
Answer: You could use verify/assertAlert to check the presence of an alert on the
page. Since selenium cannot click on the “Ok” button on the js alert window, the
alert itself does not appear on the page when this check is carried out.
Selenium has recorded my test using XPath, how do I change them to CSS
locator?
Answer: You can use the drop-down available next to Find in Selenium to change
the element locator used by Selenium
I have written my element locator, how do I test it?
Answer: You can use the Find button of Selenium IDE to test your locator. Once
you click on it, you would see element being highlighted on the screen provided
your element locator is right Else one error message would be displayed in the log
window.
I have written one js extension; can I plug it in Selenium and use it?
Answer: You could specify a js extension in the “Options” window of Selenium IDE –
How do I convert my Selenium IDE tests from Selenese to another language?
Answer: You could use the Format option of Selenium IDE to convert tests in
another programming language –
I have converted my Selenium IDE tests to java, but I am not able to execute
them, execution options, as well as the Table tab of Selenium IDE, is disabled
Answer: This is because Selenium IDE does not support the execution of the test in
any other language than Selenese
(the language of Selenium IDE). You can convert Selenium IDE in a language of your
choice and then use
Selenium 1.0 to execute these tests in that language.
I want to use only Selenese as my test script language but still want to
execute tests in other browsers, how do I do that?
Answer: You can execute your Selenese test in another browser by specifying the
“htmlSuite” followed by the path of your
Selenese suite while starting the Selenium Server. Selenium Server would be
covered in detail in question
about Selenium RC.
I have added one command in the middle of the list of commands, how do I
test only this new command?
Answer: You can double click on the newly added command, and Selenium IDE
would execute only that command in
browser.
Can I make Selenium IDE tests begin test execution from a certain command
and not from the very first command?
Answer: You could set a command as a “start” command from the context menu.
When a command is set as a start command, then a small green symbol appears
before the command. The same context menu can be used to toggle this option
Are there other tools available outside Selenium IDE to help me tests my
element locators
Answer:  You could XPath checker
https://addons.mozilla.org/enUS/firefox/addon/xpathchecker/ to test your XPath
locators and Firefinder (a Firebug add-on) to test you, CSS locators. Firefinder can
also be used to test XPath locators.
What is an upcoming advancement in Selenium IDE?
Answer: The latest advancement in Selenium IDE would be to have capabilities of
converting Selenium IDE tests in
Webdriver (Selenium 2.0) options. This would help to generate quick and dirty tests
for Selenium 2.0
How can I use the looping option (flow control) is Selenium IDE
Answer: Selenese does not provide support for looping, but there is an extension
that could be used to achieve the same.
Can I use a screen coordinate while using the click command? I want to click
on a specific part of my element.
Answer: You would need to use the clickAT command to achieve. the clickAt
command accepts element locator and x, y
coordinates as arguments – clickAt(locator, coordString)
How do I verify the presence of drop-down options using Selenium?
Answer: Use assertSelectOptions as following to check options in a drop-down
list.
Can I get data from a specific HTML table cell using Selenium IDE?
Answer: Use the storeTable command to get data from a specific cell in an HTML
table, following example store text from cell 0,4 from an HTML table
storeTable
css=#tableId.0.4
textFromCell
I want to make a Selenium IDE record and display CSS locator followed by
other locators, is it possible to give high priority to CSS locator in Selenium
IDE?
Answer: You can change the default behavior of Selenium IDE > element locator
preference by creating a js file with the following– LocatorBuilders.order = [‘css:
name’, ‘CSS: id’, ‘id’, ‘link’, ‘name’, ‘XPath: attributes’]; And add this file under
“Selenium IDE Extension” under Selenium Options.
My application has dynamic alerts which don’t always appear, how do I
handle them?
Answer: If you want to simulate clicking “ok “ on alert than use
– chooseOkOnNextConfirmation and if you want to simulate clicking “cancel” on
the alert then use Selenium RC (Selenium 1.0) Questions
Can I right-click on a locator?
Answer: You can use command contextMenu ( locator) to simulate a right-click on
an element on a web page.
How do I capture a screenshot of a page using Selenium IDE?
Answer: Use the command – captureEntirePageScreenshot to take the screenshot
of the page.
I want to pause my test execution after a certain command.
Answer: Use pause command which takes time in milliseconds and would pause
test execution for a specified time –
pause ( waitTime )
I used the open command to launch my page, but I encountered a timeout
error?
Answer: This happens because open commands wait for only 30 seconds for the
page to load. If your application takes
more than 30 sec, then you can use “setTimeout ( timeout )” to make selenium IDE
wait for a specified time before proceeding with test execution.
What’s the difference between type and typeKeys commands?
Answer: type command simulates enter operations at one go while typeKeys
simulates keystroke key by key.
typeKeys could use when typing data in the text box, which brings options (like
Google suggestion list) because
such an operation is not usually simulated using type command.
130 Selenium Interview Question
Difference Between Assertion and Verification?
Answer: Verify command will not stop the execution of the test case if verification
fails. It will log an error and proceed with the execution of the rest of the test case.
We use verify commands in Selenium IDE when we still want to proceed with the
execution of the test case even if the expected output is not matched for a test
step.
Assert command will stop the execution of the test case if verification fails. It will log
an error and will not proceed with the execution of the rest of the test case. We use
assertions in scenarios where there is no point proceeding further if the expected
output is not matched.
It’s pretty simple. Use assertions when you want to stop the execution of a test case
if the expected output is not matched and use verification when you still want to
proceed execution of a test case if the expected output is not matched.
The difference between Set, List, and Map?
Set (Interface)
            Set is an unordered collection that doesn’t allow duplicate (no duplicate)
             elements
            We can iterate the values by calling the iterator() method
             Set s = new HashSet();
             Iterator iter = s.iterator();
List (Interface)
            The list is an ordered collection that allows duplicate elements
            We can iterate the values by calling the iterator() method
             List li = new ArrayList();
             Iterator iter = li.iterator();
Map (Interface)
            In Map, we used to store the data in key and value pairs, we may have
             duplicate values but no duplicate keys
            In Map we don’t have iterator() method, but we can get the keys by calling the
             method keySet()
             Map m; // insert values
             Set s = m.keySet();
             // Get Map keys into the Set and then iterate this Set object normally
             // m.keySet() returns Set object with Map keys
             Iterator iter = s.iterator();
How to Create a Parameterized Test in JUnit Testing Framework?
Answer: In this example, we are going to see how to create a parameterized test in
the JUnit testing framework.
Create the Java class to be tested
Answer: Create a folder named JUnitParameterized. This is the folder where your
classes will be located. Using a text editor, create a Java class named Addition.java.
To make sure your file name is Addition.java, (not Addition.java.txt), first choose
“Save as > Save as type > All files,” then type in the file name Addition.java.
Addition.java
      public class Addition
      {
      public int addNumbers(int a, int b)
      {
      int sum = a + b;
      return sum;
      }
      }
2. Create a JUnit test case
In the same directory (JUnitParameterized), use a text editor and create a java class
named JunitAdditionTest.java with the following code.
What are the types of Assertions in JUnit?
Answer: Assertions:
JUnit provides overloaded assertion methods for all primitive types and Objects and
arrays (of primitives or Objects). The parameter order is the expected value,
followed by an actual value. Optionally the first parameter can be a String message
that is output on failure. There is a slightly different assertion, assertThat that has
parameters of the optional failure message, the actual value, and a Matcher object.
Note that expected and actual are reversed compared to the other assert methods.
Examples: A representative of each assert method is shown below.
import static org.hamcrest.CoreMatchers.allOf;
import static org.hamcrest.CoreMatchers.anyOf;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.CoreMatchers.sameInstance;
import static org.hamcrest.CoreMatchers.startsWith;
import static org.junit.Assert.assertThat;
import static org.junit.matchers.JUnitMatchers.both;
import static org.junit.matchers.JUnitMatchers.containsString;
import static org.junit.matchers.JUnitMatchers.everyItem;
import static org.junit.matchers.JUnitMatchers.hasItems;
import java.util.Arrays;
import org.hamcrest.core.CombinableMatcher;
import org.junit.Test;
What is New in TestNG? and Difference Between TestNG and JUNIT?
Answer: TestNG is a testing framework inspired by JUnit and NUnit but introducing
some new functionalities that make it more powerful and easier to use, such as:
           Annotations.
           Flexible test configuration.
           Support for data-driven testing (with @DataProvider).
           Support for parameters.
           Allows distribution of tests on slave machines.
           Powerful execution model (no more TestSuite).
           It is supported by a variety of tools and plug-ins (Eclipse, IDEA, Maven, etc…).
           Dependent methods for application server testing.
If you want to learn TestNG, you can download it and see its documentation at
“http://testng.org/doc/index.html.” TestNG is extensively used in Selenium
Automation and Code testing instead of Junit due to its advantages over it. Using
TestNG Selenium automation becomes simplified, and also the Parallel execution
using Selenium Grid becomes easy.