Sei sulla pagina 1di 30

Selenium Interview Questions

SeleniumIDE
1. What is the advantages and disadvantages of Selenium?
Advantages:
a. It is Opensource
b. Can generate code in any format like java,python,html,php etc.
c. Easy to record and play
d. Can extend the code of IDE using user-extensions
e. Can increase and decrease the speed of execution
f. Can run multiple tests at a time
g. Breakpoint insertion is possible.

Disadvantages:
a. Doesnt support flow control,data driven testing unless we use third party user-
extensions.
b. Not efficient in running large number of scripts,complex to manage suites.
c. Detailed results are not available
d. Supports only in Mozilla as add-on,but not for IE,chrome etc
e. Supports only web based apps,
f. We cant run recorded script if it is converted to Java,C# ,Ruby etc
g. Not allowed to write manual scripts like conditions and loops for Data driven
testing
h. No option to verify Images.

2. What is the Difference between id and name?
Name as used on the form controls (input, textarea, select, button elements) is
radically different from the id attribute on named elements. In this case, the name
attribute relates to how data is labeled when sent to server, and multiple elements
may share the same name. The id attribute on the other hand is for identifying one
unique element for the purposes of scripting, styling, or addressing.
id and name are the two different attributes of web elements.These are used to
locate the element on webpage while automating,most of the times id is used, if
two elements has same ids then we can also look for name attribute to locate
exact one.
Ex: //input[@id =xxx and @name =yyy]
//input[@id=xxx]
//input[@name=yyy]



3. What is the difference between Xpath and dom?
DOM: The Document Object Model (DOM) is a cross-platform and language-independent
convention for representing and interacting with
objects in HTML, XHTML and XML documents. Objects in the DOM tree may be addressed and
manipulated by using methods on the objects
Ex: var element=document.getElementById ("intro");
XPTAH: XPath, the XML Path Language, is a query language for selecting nodes from
an XML document. In addition, XPath may be used to compute values (e.g., strings, numbers,
or Boolean values) from the content of an XML document.
Ex: //input[@id=xxx]
4. How to Handle the Bitmaps in selenium?
The Bitmaps are captured using the Selenium set of commands.

There are two modes of capturing the bitmaps

1) Capture the bitmap for the entire page - it captures the browser main page area
of AUT and

2) Capture the bitmap for the screen shots - it captures the entire screen shot like
the print scree that you give from your keyboard
Selenium doesn't support bitmap capturing for an element on AUT.
5. what is the limitations of Selenium IDE or Selenium? ( Covered in 1
st
and 8
th
question)
6. what is the difference between assert and verify command?
Assert : If you use this, the test will be terminated at the point where check fails.
The main plus point of this is you can immediately see if the test passed or
failed. However, the disadvantage of doing this is the remaining checks and
verification that will never be performed and you cannot track that.
Verify : This is in contrast, will not terminate the whole test. If you only used
Verify commands in your tests, all tests are going to run guaranteed even if any of
the checks fails when test is running. However, there is a bit of work in order to
find out your results in details)

7. when we go for Assertions? What is Assertion?
Assertion is nothing but check or verification point. Assertion verifies the state of the
application conforms to what is expected.
Examples include make sure the page title is X and verify that this checkbox is checked
Selenium Assertions can be used in 3 modes:
1) assert - When an assert fails, the test will be aborted. If you are executing test suite, the
next state case will start
2) verify - When a verify fails, the test will continue execution, logging the failure.
3) waitFor - waitFor commands wait for some condition to become true (which can be useful
for testing Ajax applications). They will succeed immediately if the condition is already true.
However, they will fail and halt the test if the condition does not become true within the current
timeout setting
When we go for Assertion? - If the expected value is mandatory to continue with the next set of
steps we will use Assert. As Assert aborts the test, if the expected value doesn't match. It is good
to use for any mandatory checks.
8. Difference between selenium and other automation tool?

QTP: -
Functional Testing Tool -QTP has the feature for storing screenshot of each and every page
navigated during the execution. So it can be used as a proof for completion of testing, and also we
can refer the screenshots of previous executions if there is any need to refer them. Test report can be
automatically written to a customized report page which will ensure accuracy of the report and also it
can improve look & feel of the report

Advantages of Using QTP

User friendliness and less effort for script creation.
Meets the needs of both technical and non-technical users.
Advanced solution for functional test and regression test automation.
Automation scripts are executed within specific interval of time using task scheduler/crone
job.
Many inbuilt functionalities by default and easy configuration.
Excellent Object Identification process/mechanism.
Easily integrated with test management tools like QC.

Disadvantages of QTP
In recent economic crisis, software companies are planning for cost reduction and efficient
productivity. QTP is losing its market because of the following limitations:

Runs only in Windows environments.
Cannot test with all browser types and versions.
Limited to smaller organizations/ testing teams.
High licensing and add-inns costs.
Slow in execution when compared with open source tools.

Selenium: -There are four variants of Selenium, which can be used in isolation or in
combination to create complete automation suite for your web applications.

Selenium IDE Recording/Creating and enhancing scripts
Selenium Remote Control (RC) Executing scripts
Selenium Web Driver (API) Cross browser testing
Selenium Grid Cross platform testing

Advantages of Using Selenium:-

Simple and powerful document object model (DOM) level testing, can be used for
continuous integration with agile projects.
Has great extensibility and flexibility, along with its tight integration with the browser
unmatched by available proprietary tools.
Supports multiple browsers such as Internet Explorer, Fire fox, Safari or Opera
on Windows, Mac OS X and Linux.
Wires Object Oriented Programming languages like JAVA, .NET, Ruby, Perl, PHP, etc.
Provides the option of using wide range of IDEs such as Eclipse, Netbeans, Visual Studio etc
depending on the choice of development language.

Disadvantages of Selenium: -

Supports only browser based application, not the windows application
Does not support file uploads from local machine
Provides only partial support for dialog boxes
Being an open source, Selenium has no official technical support

Comparison between Selenium and QTP is as follows:-


FEATURES

SELENIUM

QTP

Cost

Open source & Portable

Licensed and very expensive; Ten
user license costs approx. 60L

Application support

Web Applications only

Client server applications only (like
built in TCL/TK and PowerBuilder)

Support for web browsers

Supports IE, Firefox, Safari and
Opera

Supports IE & Firefox only

Object Oriented Language support
& Scalability

Supports Java, .Net, Perl, PHP,
Python, and Ruby

Supports VB script only

Support for operating
system/platforms

Supports Windows PC/MAC/UNIX
Platforms

Supports Windows Platform only

Support for Test management tool
integration

Not available. Need to track
separately

TD/QC will be easily integrated

Test Development Environment

We can use wide range of IDEs like
Eclipse, Netbeans, Visual Studio etc

Need Separate environment

UI object management & Storage

Managed using UI-Element user
extension and properties A set of
dynamically loaded libraries that is
stored in the Java archive file.

Built-in object repository and easy
handling

Support for Dialog Boxes

Supports partially

Supports all kinds of dialog boxes

Support for File upload (system)

Not available

Supports all kinds of File upload


Conclusion:-
Using Selenium as the Functional Test Automation Tool, you can reduce the cost incurred
for licensing using QTP.
The efforts involved in scripting for Selenium increased by about 15 % than QTP in the
initial stages. Once all the solutions are in place the efforts of automation using Selenium
and QTP were almost the same.

9. Which type of testing we are doing by using Selenium?
Selenium could be used for testing the web based applications. The test types can be supported
are:
1. functional,
2. regression,
3. load testing
The automation tool could be implemented for post release validation with continuous
integration tools like:
1. Jenkins,
2. Hudson,
3. Quick Build
4. CruiseCont
SeleniumRC
Junit
1. What is Selence?
(Selenese is the set of selenium commands which are used to test your web application. Tester
can test the broken links, existence of some object on the UI, Ajax functionality, Alerts, window,
list options and lot more using selenese.
Selenium command tells selenium automation engine to perform certain tasks. Selenium
commands are classified into 3 basic categories.
1. Actions: Commands which change the state of the application are classified as actions,
like click on some link, select some options on the page, select a value from drop down
etc. When action is performed on page the test will fail if the action is not successful.
Most common action commands of selenium are:
a.ClickAndWait
b. Click
2. Accessors: These commands check the state of the application and store the application
state in some variable. Some examples of accessors are as follows.a. storeTitle
b. storeTextAccessors are also used to evaluate whether the desired result is present on
the page and store the result in the variable.
Examples:
a. storeTextPresent: If text is found on the page then it stores the boolean value as true
else store false.
b. storeElementPresent: If UI element is present on the page then it stores boolean value
as true else stores false.
3. Assertions: Assertions are used like the checkpoints or verification points in automation.
Assertion verifies the state of the application conforms to the expected state.
Example: a. verifyText
b. verifyTitle
c. assertText

2. What is SeleneseTestCase?
3. Tell me about the selenium architecture?
http://www.seleniumhq.org/docs/05_selenium_rc.jsp
4. can we open a web page without Create an object to Default Selenium
5. What is the Difference between Selenium Server and Default Selenium?
6. What is the Library file of DefaultSeelnium?
7. What is Default Port Number? 4444
8. Tell me the Script For Login page? - By using IDE we can create scripts easily(Go
through module 10 Selenium IDE)
9. How to handle the Ajax Applications in Selenium Rc?
10. What is the limitations of seleniumRC?
The limitations of selenium RC are:
1) Switching between the multiple instances of the same browser is not possible
2) Switching between the multiple instances of the different browsers is not possible
3) Browser navigation, like back and forward button emulations is not possible
4) Limited features in terms of drag and drop of objects
5) To work with Ajax based UI elements there are very limited features are there with
Selenium RC
To overcome the above limitations we use selenium web driver or google web driver
11. How to handle the multiple Windows?
Use selenium.selectWindow("Window[Titel/Id/Name]") to switch to different
windows. This must be a window that has been opened by the browser controlled by
Selenium.
You can get a list of available windows using one of the following:
selenium.getAllWindowTitles();
selenium.getAllWindowIds();
selenium.getAllWindowNames();

12. How to handle the Alerts or pop up ?

Use chooseOkOnNextConfirmation() to dismiss the alert and getAlert() to verify that it has
been shown (and optionally grab its text for verification).
selenium.chooseOkOnNextConfirmation();//prepares Selenium to handle next
alert
selenium.click(locator);
String alertText = selenium.getAlert(); // verifies that alert was shown
assertEquals("This is a popup window", alertText);
...
http://aboutselenium.blogspot.in/2011/11/handling-alert-prompt-and-confirmation.html
13. What is Annotation what are there in junit?
Annotations are like meta-tags that you can add to you code and apply them to methods
or in class. These annotation in JUnit gives us information about test methods , which
methods are going to run before & after test methods, which methods run before & after
all the methods, which methods or class will be ignore during execution, which methods
are suspected to throw exception etc.Annotation are added in JUnit 4 version & you can
found it in all the releases after this version. Annotations reduces coding & extra burden
from tester. The annotations in JUnit are predefined and need not to define, you can
implement it directly. Also you can have your own defined annotations in class. But for
testing , annotations are predefined in JUnit.
Given below list of annotations and their meaning in JUnit
Given below list of annotations and their meaning in JUnit :
Annotation Description
@Test
The Test annotation tells JUnit that the public void method to
which it is attached can be run as a test case.
@Before
Several tests need similar objects created before they can run.
Annotating a public void method with @Before causes that
method to be run before each Test method.
@After
If you allocate external resources in a Before method you need
to release them after the test runs. Annotating a public void
method with @After causes that method to be run after the
Test method.
@BeforeClass Annotating a public static void method with @BeforeClass
causes it to be run once before any of the test methods in the
class. This can be used to perform computationally expensive
setup (like logging into a database).
@AfterClass
Will perform the method after all tests have finished. This can
be used to perform clean-up activities for example be used to
disconnect to a database
@Ignore
Sometimes you want to temporarily disable a test or a group of
tests. Methods annotated with Test that are also annotated with
@Ignore will not be executed as tests. Also, you can annotate
a class containing test methods with @Ignore and none of the
containing tests will be executed.

14. How to read and write the Data From Xl-sheat? U can use the attachment given in link
Read_Java.docx

15. What is limitations of Junit?
16. What is four parameters object?
17. How to create a user defined port number?
18. Ip address port no is same?
19. Tell me about the SAF?
20. What is advantages of Object Repository?
The advantages of having an OR
Sync with GUI front end of the application.
Highlight capability makes easier to Cross check.
During it is very easy to identify which object gets changed.
If it stores with logical name of the object,it is extremely easy to maintain
the OR file.
Scripts are untouched if the object property gets changed.we need to
check the OR file thats it!!
Modern scripting tools allows to modify the OR file separately.
The disadvantages having an OR:
you need to check out the file size. Please read here for more details
Object conflict may occur when adding individual OR files.
Sometimes extra objects get added and it makes the OR file heavy in
size.
The OR files are private to the scripts. So concurrent update to the file is
not possible
It became overhead while developing large projects.
Even though i like to use OR.but i cannot say descriptive programming is
not required. Can you???
There are many a things which cannot be recorded. like-Sub Menu,
Objects changing its position

21. How to open a new tab in Juint?
22. How to get the rows and columns from a current web table?
23. How to get the total links from available web page?
24. What is @ parameters?
25. How many ways are there to stop the selenium-server?
Selenium Grid
1. What is Selenium Grid?
Selenium Grid is a part of the Selenium Suite that specializes on running multiple tests across
different browsers, operating systems, and machines in parallel.
Selenium Grid uses a hub-node concept where you only run the test on a single machine called a hub,
but the execution will be done by different machines called nodes.
When to Use Selenium Grid?
You should use Selenium Grid when you want to do either one or both of following :
Run your tests against different browsers, operating systems, and machines all at the same time.This
will ensure that the application you are testing is fully compatible with a wide range of browser-OS
combinations.
Save time in execution of your test suites. If you set up Selenium Grid to run, say, 4 tests at a time,
then you would be able to finish the whole suite around 4 times faster


2. What are the advantages of Selenium Grid?
3. When we go for Selenium Grid?
4. By Using Selenium Grid we can read Data or capture the Data from Other Machines? If
Possible How can we Read that?
5. By using Selenium Grid We can Record the Test Cases From other Machines? if possible
How can we Record?
TestNG

1. What is TestNG?
TestNG is a testing framework inspired from JUnit and NUnit but introducing some new
functionalities that make it more powerful and easier to use, such as:
Annotations.
Run your tests in arbitrarily big thread pools with various policies available (all methods
in their own thread, one thread per test class, etc...).
Test that your code is multithread safe.
Flexible test configuration.
Support for data-driven testing (with @DataProvider).
Support for parameters.
Powerful execution model (no more TestSuite).
Supported by a variety of tools and plug-ins (Eclipse, IDEA, Maven, etc...).
Embeds BeanShell for further flexibility.
Default JDK functions for runtime and logging (no dependencies).
Dependent methods for application server testing.

2. How many annotations are there in testng?
http://testng.org/doc/documentation-main.html
Mostly used are listed below,

3. What is Data Provider?
While pulling data values into an XML file can be quite handy, but test cases occasionally
may require complex data types, which cant be represented as a String or a primitive value
in XML file. TestNG handles this scenario with @DataProviderannotation, which facilitates
the mapping of complex parameter types to a test method.
A DataProvider provide data to the function which depends on it. And
whenever we define a DataProvider it should always return a double
object array Object[][]. The function which calls dataprovider will
be executed based on no. of array returned from the DataProvider
4. What is return type of Data Provider?
always return a double object array Object[][]
5. Difference between Junit and TestNg?
http://www.mkyong.com/unittest/junit-4-vs-testng-comparison/
1. Annotation Support
The annotation supports are implemented in both JUnit 4 and TestNG look similar.
Feature JUnit 4 TestNG
test annotation @Test @Test
run before all tests in this
suite have run
@BeforeSuite
run after all tests in this suite
have run
@AfterSuite
run before the test @BeforeTest
run after the test @AfterTest
run before the first test
method that belongs to any of
these groups is invoked
@BeforeGroups
run after the last test method
that belongs to any of these
groups is invoked
@AfterGroups
run before the first test
method in the current class is
invoked
@BeforeClass @BeforeClass
run after all the test methods
in the current class have been
run
@AfterClass @AfterClass
run before each test method @Before @BeforeMethod
run after each test method @After @AfterMethod
ignore test @ignore @Test(enbale=false)
expected exception
@Test(expected =
ArithmeticException.class)
@Test(expectedExceptions =
ArithmeticException.class)
timeout @Test(timeout = 1000) @Test(timeout = 1000)

The main annotation differences between JUnit4 and TestNG are
1. In JUnit 4, we have to declare @BeforeClass and @AfterClass method as static method.
TestNG is more flexible in method declaration, it does not have this constraints.
2. 3 additional setUp/tearDown level: suite and group (@Before/AfterSuite, @Before/AfterTest,
@Before/AfterGroup). See more detail here.
J Unit 4
@BeforeClass
public static void oneTimeSetUp() {
// one-time initialization code
System.out.println("@BeforeClass - oneTimeSetUp");
}
TestNG
@BeforeClass
public void oneTimeSetUp() {
// one-time initialization code
System.out.println("@BeforeClass - oneTimeSetUp");
}

6. How to handle the Ajax Applications?
7. How to capture The bitmaps in Selenium? or How to take the Screen shots ?
8. How to read The methods/functions from Xml File?
9. How to read The Groups From Xml File?
10. Wha t is the difference between include and exclude?
11. How to execute the (single)selected method in TestNg?
12. What is the difference between the packages and classes in TestNg?
13. Tell me a login page script in TestNg?
14. What is the difference between the @parameters and @Data provider in TestNg?
15. Is possible to write to multiple Test Cases in single class?
16. Which problems are faced in TestNg?
17. What is the max time of selenium.thread.sleep ()?
18. How to create the suits in TestNg?
19. What is the library file of Testng?
20. Tell me the script for executing the groups?

Web Driver

1. What is web driver?
2. What are the advantages of selenium2.0?
3. Difference between the selenium1.0 and selenium 2.0?
4. What are the Locators are there in selenium 2.0?
Locators tell Selenium IDE which GUI elements ( say Text Box , Buttons, Check Boxes etc)
its needs to operate on. Identification of correct GUI elements is a prerequisite to create an
automation script. But accurate identification of GUI elements is more difficult than it sounds.
Sometimes, you end up working with incorrect GUI elements or no elements at all! Hence, Selenium
provides a number of Locators to precisely locate a GUI element

The different types of locator are:
ID
Name
Link Text
CSS Selector
Tag and ID
Tag and class
Tag and attribute
Tag, class, and attribute
Inner text
DOM (Document Object Model)
getElementById
getElementsByName
dom:name
dom:index
XPath



5. How to handle the Ajax Applications in Web driver?
http://blog.devscrum.net/2011/04/selenium-2-webdriver-handling-ajax-page-requests/
The Selenium 2 framework provides a WebDriverWait class. This class effectively
wraps the polling of the page for us. The WebDriverWait class includes an Until
method, which accepts a single Func as its parameter. This can be used to instruct
Selenium to wait until the chosen element is found on the page, halting execution of the test
until it is either found or the specified time out is reached
public class WaitFor
{
public static void ElementPresent(IWebDriver driver, By locator, TimeSpan
timespan)
{
IWait<IWebDriver> wait = new WebDriverWait(driver, timespan);
wait.Until(d => d.FindElement(locator));
}
}

6. How to handle the multiple windows in web driver?
driver.switchTo().window("windowName"); - For Multiple window
driver.switchTo().window(FrameName); For Multiple Frame
to select the correct window before calling driver.close(). (If there are no windows left,
the browser will close.)





7. Difference between findelement() and findelements()?

findelement()
findELement will find the first matching element.
findELement will throw NoSuchElementException if no matching element found
findElement() method will throw NoSuchElementException if it couldnt able to find the
element with the specified locator .
public WebElement findElement(By by)
findelements()
findELements will all the matching elements. Youll probably need to loop through all
the elements returned. Im sure theres a concrete examples of this on the wiki, if nto
google.
findELements will return a empty list if no matching elements found and no exception
will be thrown
findElements() will return empty list if it couldnt able to find the element with the
specified locator.
public java.util.List<WebElement> findElements(By by)
8. How to handle the alerts in web driver? By using
driver.switchTo().alert().accept();
or
driver.switchTo().alert().dismiss();
9. How to take the screen shots in seelnium2.0?
WebDriver driver = new FirefoxDriver();
driver.get("http://www.google.com/");
File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
// Now you can do whatever you need to do with it, for example copy
somewhere
FileUtils.copyFile(scrFile, new File("c:\\tmp\\screenshot.png"));

http://stackoverflow.com/questions/3422262/take-a-screenshot-with-selenium-webdriver

10. Tell me about then web driver architecture?
http://www.guru99.com/introduction-webdriver-comparison-selenium-rc.html
11. What is the limitations of web driver?
The only drawbacks of WebDriver are:
It cannot readily support new browsers, but Selenium RC can.
It does not have a built-in command for automatic generation of test results.
-----------------------------------------------------------------------------------------------------------
---





Interview Question-1
1. which version your using selenium ? Can go with Latest version or Prior to that

2.what is the default port no for selenium ?
4444

3.for day how many scripts your writing and executing ?

4.What framework your using can you Explain the framework. ?

5.What is Test Plan ? can you explain contents in test plan ?

6.What is Exit Criteria ?

7.Difference between Test Case and Test Scenario ?

8.What is Alpha Testing and Beta Testing ?

9.What is the default time for selenium ?

10.What is difference between Select & Select wait ?

11.What is difference between Selenium RC and WebDriver ?

12.What is DCL (Oracle) ?

13.What is group by command ? tell me one query by using group by

14.What is trigger ? how may triggers are available in oracle ?
Interview Questions

1. how do you start the selenium server?

2.is there any command to start the server?
(Generally you would start a hub first since nodes depend on a hub. This is
not abolutely necessary however, since nodes can recognize when a hub has
been started and vice-versa. For learning purposes though, it would easier
to start the hub first, otherwise youll see error messages that may not want
to start off with your first time using Selenium-Grid.
Starting a Hub
To start a hub with default parameters, run the following command from a
command-line shell. This will work on all the supported platforms, Windows
Linux, or MacOs.
java -jar selenium-server-standalone-2.21.0.jar -role hub
This starts a hub using default parameter values. Well explain these
parameters in folowing subsections. Note that you will likely have to change
the version number in the jar filename depending on which version of the
selenium-server youre using.
Starting a Node
To start a node using default parameters, run the following command from a
command-line.
java -jar selenium-server-standalone-2.21.0.jar -role node -hub
http://localhost:4444/grid/register
This assumes the hub has been started above using default parameters. The
default port the hub uses to listen for new requests is port 4444. This is why
port 4444 was used in the URL for locating the hub. Also the use of
localhost assumes your node is running on the same machine as your hub.
For getting started this is probably easiest. If running the hub and node on
separate machines, simply replace localhost with the hostname of the
remote machine running the hub.
WARNING: Be sure to turn off the firewalls on the machine running your hub
and nodes. Otherwise you may get connection errors.

3.i want to run my application into the firefox browser how do you handling it?
4.your telling "*firefox" , OK what is the star means here'*' ?
5.what frame work your using ? can you briefly explain?
6.in your frame work your taking the support from Junit or TestNg ?
7.in TestNg i have some test's line
Test1
Test2
Test3
Test4
Test5
i want to run my execution order is
Test5
Test1
Test3
Test2
Test4

how do you set the execution order can you explain for that ?

8.i have a requirement in my application i don't want to take the input data from data
base's , excel sheet and hordcoding , how do you handling the this scenario ? where do
you take the input data from my application?

9.Tell me your facing difficulty's in your project

Data base questions


10.in EMP table
empno , ename ,hiredate , sal ,deptno

I want to update sal hike 3000 from last 6 years joined employees tell me the query ?


Interview Questions-2

1.What is Annatation? How many Annatations are there in TestNg?
2.What is DataProvider?
3.Any Return Type was there to DataProvider? what is the Return type?
4.How to read the data from XL Sheet?
5.How to Identify the Elements?
6.Tell me Script For Gmail Login page?
7.How to handle the Alerts in Rc?
8.How to handle The Alerts in Web Driver?
9.How to take the ScreenShots in Rc and Web Driver?
10.How handle the multiple windows in RC and Web Driver?
11.What are the Commands to login the Gmail page?
12.What is Object Repository?
13.What is Object? What is static variable?
14.How can we call them?
15.what is use of Object Repository?
16.What is the Difference between the Throws & throw?
17.What is Exception?
18.What is UserDefind Exception? How we can Create?
19.What is Collection?
20.Collection can store variable?
21.how to read the data From Data base in Selenium?
22.How to read the Function/methods From XMl File?
23.what is jdbc? How we are Connect the Database?
24.what is the Difference between Oracle and MySql?
25.how to get the Columns From a Table?
Interview Questions on Selenium
1. Tell me about the brief introduction of Selenium?
2. Difference between the Selenium and other automation toll which is better?
3. What is default port no?
4. What is accretion?
5. If Default port no is busy how to change port no?
6. When we will go for Xpath?
7. How to identify elements in the PDF file?
8. Tell me about the SAF?
9. How to get the same elements from two arrays?
10. How to handle the multiple windows in selenium1.0 and selenium2.0?
11. How to select the third value from drop-down in selenium 2.0?
12. Selenium supports https protocols?
13. How to connect the selenium to database?
14. How to extend the selenium?
15. Difference between the assert and verify command?
16. Give me a example an login page in selenium2.0?
17. What is selenium grid? why we will go for Selenium grid?
18. Selenium support mobile applications?
19. How to handle the Ajax applications?
20. What is object -Repository? what are the advantages?
Selenium RC Latest Interview Questions
21. Here I listed few latest interview questions asked by different MNCs
22. 1. How do you start Selenium RC?
23. 2. How do you connect Data base from selenium
24. 3. How do you handle Ajax controls using selenium?
25. 4. How do you select the 2nd item in a List box or drop down.
26. 5. How do you identify an object using selenium?
27. 6. How do you capture an element loading after the page load?
28. 7. Brief about your framework
29. 8. What is the difference between assert and Verify Commands?
30. 9. Explain about your reporting method
31. 10. How do you verify an object presented in multiple pages.
32. 11. What are the locators available in Selenium?
33. 12.Did you write any User Extensions.
34. 13.What are all things can not be done through selenium IDE
35. 14.Brief about Selenium Grid.
36. 15.Is it possible to start the Remote engine more than once in an instance.
37. 16. How to use selenium for performance testing
38. 17. How to start the selenium server from your language class?
39. 18. Is it possible to handle multiple pop ups in selenium?
40. 19. Give the benefits of SQL Stored procedure in selenium?
41. 20.What are the difficulties or challenge you faced in selenium?
42. 21. How do you check a single test method in multiple browser?
43. 22. What is the annotation you use to connect the Spread sheet in Junit.
44. 23.Brief about Junit annotations.
45. 24.How can we speed up the selenium script execution?
46. 25.If the default port of selenium is busy then which port you use?
47. 29.Explain types of SQL joins.
48. 30.How do you handle the secured connection error in HTTPS?
49. 31.How do you compare two strings or values are same.

Selenium RC Latest Interview Questions
1. what is diff between smoke and sanity
2. what is high priority and low severity defect
3. what is the testing annotation will use to run same method N no.of times
4. what is the diff between array and arraylist
5. how to map requirements with test cases in QC
6. If three dropdowns given of country,state,city once we select country, states need to come
a/c to country, once state selected cities need to come for that which command you use
for running script without error in RC and IDE
7. How you implemented java in your RC script
8. What is dataprovider in testing
9. Write a login script in using selenium RC.
10. How to get the selected text in RC.
11. Before starting automation which testing is required smoke and sanity why?

1. How to handle multiple windows using Web driver?
2. What are the comparisons of Selenium IDE, Web driver and RC?
3. How many ways to find 3rd value in drop down menu ?
4. When to use Absolute path and Relevant path?
5. What is difference in Data driven and key driven in Selenium?
6. what is the different between Junit and test NG?
7. Can you explain Junit Annotation? If there are 1000 test cases. 500 test cases are
executed. how will you execute the rest of the test cases by using annitation?
8. In Java, what is hash table and hash maps?
9. In Java, define String comparision?
10.How can we do browser compatability?
11.Why do you shift IDE to RC?
Second Round: Technical Round-2

1. Explain your actual role in the company.
2. What is the difference between javascript and java program.
3. Why we choose selenium where we are having so many testing tools.
4. If iam having a company you suggest me which automation tool is better
5. Can client server application can be automate through the selenium.
6. How to access the excel data and place in the webpage write algorithm? Write on the
paper.
7. Is getRows() and getColumns() gives exact range of the excel.
8. getCell() and range() what is difference.
9. What is difference between selenium1 and selenium2.
10. What is dom? Where we use?
11. Can you create the user defined frame work?
12. What is the frame work in your company? Explain it?
13. How to access data from xml file.
14. What is use of testng frame work.
15. What do you know about our company.


Interview Questions on Selenium
1.write a program to search keyword in google?
2.what is difference between selenium and Default selenium?
3.what is client Library?
4.what is page object model?
5.Explain me about RC architecture?
6.what is Selenium server and how it will work?
7.how to identify objects in selenium?
8.how to handle dynamic objects in selenium
9.what are the challenges did you face while automating the application?
10.how differ selenium with other automation tools?
11.how to select values in multi-drop down?
12.what is repository?
Java:
13. how to handle exception in java?
14.what is the advantage of static method?
15.what is the difference between abstract class and interface?
16.what is finalize()? Can we cal finalize()?
17.what is difference between string and stringBuffer class?
18.which is the base class for all classes in java?
DB:
19.what is difference between delete and truncate?
20.what is the syntax for update?
21.how to find 2
nd
height salary


1)dif abstract and interface
2) if we write fileinput stream statements in ty block, what are the statements will write in finally
block?
3)diff b/n notify notifyall, wait?
4)diff String & StringBuffer?
5)Class.forName(X)..what statement will u write in the place pf X?
6)OOPS concept? Explain abt polymorphism..with example?
7)Is null a keyword?
8)Diff b/n List & set?
9)What is the purpose of finalization?
10)diff b/n final ()& finalized..
11)what is advantage of static?
12)diff b/w the equal() and == ?
13)diff b/w array and arrayList?
14)diff b/w hashmap and hashtable?
15)diff b/w collection and array?
16)diff b/w char array and String array?
17)explain abt typecasting?
18)explain abt jdk features like jdk1.5.0,jdk1.6.0,jdk1.7.0?
19)what is the use of generics concept in collection?
20)what is your rating in java out of 10?
21)diff b/w StringTokenizer and split()?
22)what is class variable in java?
23)what is local variable?
24)what is default boolean value in java?
25)what is polymorphisum? and expain?


These Questions asked in
Accenture,compgain,infobrain,3infoTech,centramed,
happeist mind space companies:
Question 1:- when creating the Employee fields are:-
Name:- textbox
Address:- textbox
Emailid:- textbox
if the values of the above fields changes frequently. how can we handle dynamically..?
Question 2:- How to handle ajax application for selecting the City from the State..
Ex:- Select the State AP from the dropdown list and then select the city Hyderabad from the
Dropdown list...
if hyderabad is selected with in 5 sec.. how can the executiton come to next statement without
waiting upto default time of 32000 milliseconds
Question 3:- Write the Script for selecting the Image file by browsing with by browse button and
attach to our web page and send. Like attach the text file to our Email id.
Question4:is it possible to handle multiple pops ups at a time in web driver?
Question5: how to find how many web links in a web application
Question6: my web page contain calendar, how to write script for calendar date selection.
Question7: My check box would be in checked position, how can u say check box would be in
check position
Question8: My login page contains capche explain how to write script?
Question9:Explain script drop down list selection?
Question10:how to get all Text Fields without using direct method ? what do you do?
Question11: Table has row and columns with some data ,Row gives wrong values how to
handle?
Question12: one web page contains series of images how to write script?
Question13: which tool is using for Reporting?
Question14 : Table contains 5 rows and 6 columns how to test 3
rd
row 2
nd
column and which
command you use to write script?
Question15: In which language selenium server developed ? ans java
Question16: which driver implementation will allow headless mode? Ans html unit driver
Question17: I have peace of code , how to drag and drop to one place to other place in web
driver?
Question18:How many ways can we identify the objects ,all of them which object do you prefer
and
why?
Question19: how to run eclipse scripts from cmd prompt by Ant?
Question20:which protocol are you using?
Common questions:
1. What is diff b/w selenium ide , selenium Rc and selenium web driver?
2. Tell me about your roles and responsibilities?
3. Tell me about your client?
4. Tell me about current project?
5. Explain abt data driven framework?
a) Data Driven framework: Externalized the data from the scripts. Framework will function
based on the number of combination of test data available in external files. Scripts
should not be modified for any addition of test case or scenario if the transaction or
action (and the navigation involved in the transaction) remains same.
b) Data-driven testing (DDT) is a term used in the testing of computer software to describe
testing done using a table of conditions directly as test inputs and verifiable outputs as
well as the process where test environment settings and control are not hard-coded.

KeyDriven Framework :
a) Keyword driven framework: Action Driven. For e.g. for any url, if you have an
action defined say login.do, this action or keyword should drive the whole test.
Based on keyword, you should be able to pick up input data sheets, expected
data sheet, verification points etc. and run the whole test.
b) Keyword-driven testing, also known as table-driven testing or action-word
testing, is a software testing methodology for automated testing that separates the
test creation process into two distinct stages: a Planning Stage, and an
Implementation Stage.

6. Explain abt testing framework?
A set of guidelines like coding standards , test-data handling , object repository
treatment etc... which when followed during automation scripting produce beneficial
outcomes like increase code re-usage , higher portability , reduced script maintenance
cost etc. Mind you these are just guidelines and not rules; they are not mandatory and
you can still script without following the guidelines. But you will miss out on the
advantages of having a Framework.

What are the various Automation Frameworks available?
1) Linear Scripting
2)The Test Library Architecture Framework.
3)The Data-Driven Testing Framework.
4)The Keyword-Driven or Table-Driven Testing Framework.
5)The Hybrid Test Automation Framework.
For Detailed: http://www.guru99.com/quick-test-professional-qtp-tutorial-34.html


7. How to execute same script in different browsers?
8. What is diff b/w isElementpresent and isVisible?
isElementPresent() - This method basically tests if the element we are looking for is
present somewhere on the page.
isVisible() - looks for display: none style tag - this might throw a null pointer if we
aren't careful...thus to see if an element is visible first check if the element is present using I
isElementPresent() method. Then try checking if the element is visible!



9. How to select all check boxs drop downs values at time?
(<SCRIPT LANGUAGE="JavaScript">
<!--

<!-- Begin
function CheckAll(chk)
{
for (i = 0; i < chk.length; i++)
chk[i].checked = true ;
}

function UnCheckAll(chk)
{
for (i = 0; i < chk.length; i++)
chk[i].checked = false ;
}
// End -->
</script>
This is the HTML code to be kept inside the body tag.
<form name="myform" action="checkboxes.asp" method="post">
<b>Scripts for Web design and programming</b><br>
<input type="checkbox" name="check_list" value="1">ASP<br>
<input type="checkbox" name="check_list" value="2">PHP<br>
<input type="checkbox" name="check_list" value="3">JavaScript<br>
<input type="checkbox" name="check_list" value="4">HTML<br>
<input type="checkbox" name="check_list" value="5">MySQL<br>

<input type="button" name="Check_All" value="Check All"
onClick="CheckAll(document.myform.check_list)">
<input type="button" name="Un_CheckAll" value="Uncheck All"
onClick="UnCheckAll(document.myform.check_list)">)

10. Explain Selenium IDE draw backs? Selenium IDE has many great features and is a fruitful
and well-organized test automation tool for developing test cases, in the same time Selenium
IDE is missing certain vital features of a testing tool: conditional statements, loops, logging
functionality, exception handling, reporting functionality, database testing, re-execution of
failed tests and screenshots taking capability. Selenium IDE doesn't for IE, Safari and Opera
browsers.
Though Selenium scripts can be used for most of the browser and operating system, Scripts
written using Selenium IDE can be used for only Firefox browser if it is not used with Selenium
RC or Selenium Core.
11. Explain selenium Rc draw backs?
12. What are the challenges you faced in your project in selenium?
13. Can u test flash images in selenium? Selenium RC has support for flash. You can use
selenium RC in backward compatibility mode from Webdriver for that purpose along with flash-
selenium.
14. Which firefox and fire bug versions do you use?
15. What is default class in TestNg? By default, TestNG will run your tests in the order they are found in
the XML file. If you want the classes and methods listed in this file to be run in an unpredictible order, set
the preserve-order attribute to false
16. My web page locaters are hidden? How to get locators?
findElementsByXPath("//*")
17. Explain selenium architecture?
18. Can u generate reports?
19. Explain limitations of selenium?
Identifying the locators that support common attributes like id, names etc as well as
XPATH, javascript DOM and others (Use firebug for finding the locators)
Detailed results are not available
Selenium IDE does not supports loop and data driven testing
No Option to verify the images.

20. Explain how to configure hub in grid and what commands do you use to run script in
browsers? - http://www.guru99.com/introduction-to-selenium-grid.html
21. When we go for x path?
22. Which object is faster than all of them
23. What is diff b/w setSpeed() ,setTimeOut(),Thread.sleep()?
24. Diff b/w wait and pause commands?
25. How to create suite in your project?
26. How to do verify an object presented in multiple page?
27. What is object repository? Explain how store object in data driven framework?
28. What is Ajax application? How to handle?
29. Send one empty mail from your official mail id?
30. Where is your company?
Mostly interview questions ask topics on Table, drop down, alerts, multiple windows.
(Santosh Prasad Jangeti)

Potrebbero piacerti anche