Selenium Training

Selenium Training in Java

Blog

Selenium Interview Questions

Posted by onlineseleniumtraining@gmail.com on July 1, 2011 at 9:01 AM

1. How do you start Selenium RC?

Ans:

simple way  to start selenum rc is

 java -jar selenium-server.jar

 to run a suite of Selenese scripts in a browser

java -jar selenium-server.jar -htmlSuite

2. How do you connect Data base from selenium

Ans:

Connecting to database is lanuage dependent. if we are using Java

A Connection object represents aconnection with a database. When we connect to a database by using connection method, we create a Connection Object, which represents theconnection to the database. An application may have one or more than one connections with a single database or many connections with different databases.

We can use the Connection object for the following things:

1). It creates the Statement, PreparedStatement and CallableStatement objects for executing the SQL statements.

2). It helps us to Commit or roll back a jdbc transactionn.

3). If you want to know about the database or data source to which you are connected then the Connection object gathers information about the database or data source by the use of DatabaseMetaData.

4). It helps us to close the data source. The Connection.isClosed() method returns true only if the Connection.close() has been called. This method is used to close all the connection.

Firstly we need to to establish the connection with the database. This is done by using the method DriverManager.getConnection(). This method takes a string containing a URL. The DriverManager class, attempts to locate a driver that can connect to the database represented by the string URL. Whenever the getConnection() method is called the DriverManager class checks the list of all registered Driver classes that can connect to the database specified in the URL.

Syntax:

String url = "jdbc: odbc: makeConnection";

Connection con = DriverManager.getConnection(url, "userID", "password");


3. How do you handle Ajax controls using selenium?

Eg. By typing in search engine how do you capture the auto suggestion

4. How do you select the 2nd item in a List box or drop down.

Ans:

selenium.select(selectLocator, optionLocator)

selectLocator – a locator for the select element

optionLocator – a locator for the option element


5. How do you identify an object using selenium?

Ans:

isElementPresent(String locator)
isElementPresent takes a locator as the argument and if found returns a boolean value of True.

6. How do you capture an element loading after the page load?

Ans:

 provide a time to check the element( in seconds) Like :

public void waitForElementPresent(String element, int timeout) throws Exception {

for (int second = 0;; second++) {

if (second >= timeout)

fail("Timeout. Unable to find the Specified element" + element);

try {

       if (selenium.isElementPresent(element)) break;

} catch (Exception e) { }

Thread.sleep(1000);

}

}

7. Brief about your framework

8. What is the difference between assert and Verify Commands?

Ans:

There are two mechanisms for validating elements that are available on the application under test. The first is assert: this allows the test to check if the element is on the page. If it is not available, then the test will stop on the step that failed. The second is verify: this also allows the test to check whether the element is on the page, but if it isn't, then the test will carry on executing.

9. Explain about your reporting method

10.How do you verify an object presented in multiple pages.

Ans:

Check on each page

assertTrue(selenium.isElementPresent(locator));

11.What are the locators available in Selenium?

Ans:

  1. ID
  2. Name
  3. Filters
  4. DOM
  5. CSS
  6. Xpath

12.What is the difference between single and double slash in Xpath

Ans:

 /

  1.  start selection from the document node
  2. allows you to create 'absolute' path expressions
  3. e.g. “/html/body/p” matches all the paragraph elements

 //

  1.  start selection matching anywhere in the docume
  2. allows you to create 'relative' path expressions
  3. e.g. “//p” matches all the paragraph elements


13.Brief about Selenium Client.

14.Did you write any User Extensions.

User extensions are stored in a separate file that we will tell Selenium IDE or Selenium RC to use. Inside there the new function will be written in JavaScript.

Because Selenium's core is developed in JavaScript, creating an extension follows the standard rules for prototypal languages. To create an extension, we create a function  in the following design pattern.

Selenium.prototype.doFunctionName = function(){

.

}

The "do" in front of the function name tells Selenium that this function can be called  as a command for a step instead of an internal or private function.

 

 

15.What are all things can not be done through selenium IDE

Ans:

  1. Easy record and playback.
  2. Intelligent field selection will use IDs, names, or XPath as needed.
  3. Autocomplete for all common Selenium commands.
  4. Walk through tests.
  5. Debug and set breakpoints.
  6. Save tests as HTML, Ruby scripts, or any other format.
  7. Support for Selenium user-extensions.js file.
  8. Option to automatically assert the title of every page.


Advantages: Selenium IDE is the only flavor of Selenium, which allows you to record user action on browser window. It can also record user actions in most of the popular languages like Java, C#, Perl, Ruby etc. This eliminates the need of learning new vendor scripting language. For executing scripts created in these languages, you will need to use Selenium Remote Control. If you do not want to use Remote Control than you will need to create your test scripts in HTML format.

Disadvantages: Biggest drawback of Selenium IDE is its limitation in terms of browser support. 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.

16.Brief about Selenium Grid.

Ans:

Selenium Grid is a tool that dramatically speeds up functional testing of web-apps by leveraging your existing computing infrastructure. It allows you to easily run multiple tests in parallel, on multiple machines, in an heterogeneous enviroment. 

Based on the excellent Selenium web testing tool, Selenium Grid allows you to run multiple instances of Selenium Remote Control in parallel. Even better, it makes all these Selenium Remote Controls appear as a single one, so your tests do not have to worry about the actual infrastructure. Selenium Grid cuts down on the time required to run a Selenium test suite to a fraction of the time that a single instance of Selenium instance would take to run.

17.Is it possible to start the Remote engine more than once in an instance.

18. How to use selenium for performance testing

19. How to start the selenium server from your language class?

Ans:

try {

      seleniumServer = new SeleniumServer();

      seleniumServer.start();

} catch (Exception e) {

      e.printStackTrace();

}

20. Is it possible to handle multiple pop ups in selenium?

22. Give the benefits of SQL Stored procedure in selenium?

23.What are the difficulties or challenge you faced in selenium?

24. How do you check a single test method in multiple browser?

25. What is the annotation you use to connect the Spread sheet in Junit.

26.Brief about Junit annotations.

27.How can we speed up the selenium script execution?

28.If the default port of selenium is busy then which port you use?

29.Explain types of SQL joins.

30.How do you handle the secured connection error in HTTPS?

31.How do you compare two strings or values are same.


Categories: None

Post a Comment

Oops!

Oops, you forgot something.

Oops!

The words you entered did not match the given text. Please try again.

Already a member? Sign In

26 Comments

Reply venubabu
10:31 AM on June 18, 2012 
i have more selenium interview questions and answers for experienced. pls provid in KT.
Reply venkatareddy
8:18 AM on December 7, 2012 
hi
Reply lakshmi
1:39 PM on March 22, 2013 
i have more selenium interview questions and answers for experienced.
plz send my mail id

thanks and regards
Reply Deepika
7:00 AM on March 26, 2013 
venubabu says...
i have more selenium interview questions and answers for experienced. pls provid in KT.
Reply Anil
6:28 AM on April 3, 2013 
lakshmi says...
i have more selenium interview questions and answers for experienced.
plz send my mail id

thanks and regards
Reply abhinav
1:35 AM on April 15, 2013 
See SWIFT Interview questions on

http://testwithus.blogspot.in/p/swift.html

For testing training in jaipur:-

Visit

http://testwithus.blogspot.in/

Selenium Interview questions:-

http://testwithus.blogspot.in/
Reply Muzammill Haq
9:45 AM on June 14, 2013 
please share few more interview questions and answers.
Reply K Prasada Reddy
3:22 AM on June 28, 2013 
i am learning Slenium. Would you please send me Selenium docs and interview Questions if you have.

Thanks in Advance,
Prasad K


lakshmi says...
i have more selenium interview questions and answers for experienced.
plz send my mail id

thanks and regards
Reply PriyaRagavan
2:56 AM on July 1, 2013 
Plz send me Selenium documents and interview Questions if you have.

Thanks.
Reply kanchan lata
1:43 AM on July 10, 2013 
Hi lakshmi,
can you pls share interview question on selenium .


thanks and regards
kanchan
Reply pradeep
12:58 PM on August 14, 2013 
pradeep says...
i am learning Slenium. Would you please send me Selenium docs and interview Questions if you have. spradeep89@gmail.com is my mail id..

Thanks in Advance,
Prasad K
Reply kkmuari
8:02 AM on August 16, 2013 
hi hello vankam
Reply priyadarshan
3:37 PM on August 30, 2013 
can u send send selenium interview question for experienced in priyadarshan3265@rediffmail.com
Reply Naveen
2:19 AM on September 10, 2013 
Kindly send me the notes.

lakshmi says...
i have more selenium interview questions and answers for experienced.
plz send my mail id

thanks and regards
Reply naveen
2:19 AM on September 10, 2013 
Hi..Kindly send me the notes

lakshmi says...
i have more selenium interview questions and answers for experienced.
plz send my mail id

thanks and regards
Reply Kumar Vikrant
10:59 AM on September 20, 2013 
lakshmi says...
i have more selenium interview questions and answers for experienced.
plz send my mail id

thanks and regards
Reply sreekanth
5:15 AM on September 21, 2013 
sir,
i have more selenium interview questions and answers for experienced.
Reply Santosh Kumar
12:32 PM on October 6, 2013 
plzz, post some more selenium interview questions or mail me(santosh201188@gmail.com).
Reply saravana
2:01 PM on October 19, 2013 
thank u so much sir..........
Reply Manoj
2:25 PM on October 24, 2013 
Please send questions details:-

Thanks

Upcoming Events

No upcoming events

Testimonials

  • "All I can say is that it was an excellent training session. Ramesh dealt each class with a lot of enthusiasm and had a clear motive on what he was about to deliver. The course c..."
    Pramod
    Test Lead
  • "Hi all, I don't have much word to say regarding this selenium training classes[ taught by Ramesh sir], but one thing i would like to share to all of you, way of teaching was su..."
    sushanth
  • "Hi All,I would like to share my views on Training conducted by Ramesh Sir w.r.t Selenium.The Trainings were exhaustive and very Explanative and very informative.He has a lot of..."
    Ramesh Sir's Tutorials on Selenium

Subscribe To Our Site