Thursday 30 January 2014

Selenium Questions and Answers - Part -1



1.      What are the advantages and disadvantages of Selenium IDE?
Advantages:
1.      It is Opensource
2.      Can generate code in any format like java,python,html,php etc.
3.      Easy to record and play
4.      Can extend the code of IDE using user-extensions
5.      Can increase and decrease the speed of execution
6.      Can run multiple tests at a time
7.      Breakpoint insertion is possible
Disadvantages:
1.      Supports only in Mozilla as add-on,but not for IE,chrome etc
2.      Doesn’t support flow control,data driven testing unless we use third party user-extensions.
3.      Not efficient in running large number of scripts,complex to manage suites.
4.      Detailed results are not available
5.      Supports only web based apps

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 id’s 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 HTMLXHTML 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.      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 can not 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

5.      What type of testing we can do by using Selenium?
    • Functional automation testing of web applications(Android also)
    •  Load Testing

No comments:

Post a Comment