Selenium Interview Question-4

46) Explain how you can switch back from a frame?
To switch back from a frame use method defaultContent()
Syntax-driver.switchTo().defaultContent();
47) List out different types of locators?
Different types of locators are
·         By.id()
·         By.name()
·         By.tagName()
·         By.className()
·         By.linkText()
·         By.partialLinkText()
·         By.xpath
·         By.cssSelector()
48) What is the command that is used in order to display the values of a variable into the output console or log?
·         In order to display a constant string, command can be used is echo <constant string>
·         If order to display the value of a variable you can use command like echo ${variable name>>
Above is using PHP. If you are using Java, replace echo with System.out.println
49)   Explain how you can use recovery scenario with Selenium?
Recovery scenarios depends upon the programming language you use.  If you are using Java then you can use exception handling to overcome same.  By using “Try Catch Block” within your Selenium WebDriver Java tests
50) Explain how to iterate through options in test script?
To iterate through options in test script you can loop features of the programming language, for example to type different test data in a text box you can use “for” loop in Java
// test data collection in an array
String[ ] testData = { “test1” , “test2” , “test3” } ;
// iterate through each test data
For  (string s: test data) { selenium.type ( “elementLocator”, testData) ; }
51) How can you prepare customized html report using TestNG in hybrid framework ?
There are three ways
·         Junit: With the help of ANT
·         TestNG: Using inbuilt default.html to get the HTML report. Also XST reports from ANT, Selenium, TestNG combinations
·         Using our own customized reports using XSL jar for converting XML content to HTML
52) From your test script how you can create html test report?
To create html test report there are three ways
·         TestNG:  Using inbuilt default.html to get the HTML report. Also XLST reports from ANT, Selenium, TestNG combination
·         JUnit: With the help of ANT
·         Using our own customized reports using XSL jar for converting XML content to HTML
53)  Explain how you can insert a break point in Selenium IDE ?
In Selenium IDE to insert a break point
·         Select “Toggle break point” by right click on the command in Selenium IDE
·         Press “B” on the keyboard and select the command in Selenium IDE
·         Multiple break points can be set in Selenium IDE
54)  Explain in Selenium IDE how can you debug the tests?
·         Insert a break point from the location from where you want to execute test step by step
·         Run the test case
·         At the given break point execution will be paused
·         To continue with the next statement click on the blue button
·         Click on the “Run” button to continue executing all the commands at a time
55)  What is Selenese and what are the types of Selenese ?
Selenese is a selenium set of command which are used for running the test
There are three types of Selenese
·         Actions: It is used for performing the operations and interactions with the target elements
·         Assertions: It is used as a check points
·         Accessors: It is used for storing the values in a variable
56)  Explain what are the limitations of Selenium IDE?
The limitations of Selenium IDE
·         Exceptional handling is not present
·         Selenium IDE uses only HTML languages
·         External databases reading is not possible with IDE
·         Reading from the external files like .txt, .xls is not possible

·         Conditional or branching statements execution like if,else,  select statements is not possible

Comments

Post a Comment

Popular posts from this blog

Handling Dynamic Web Tables Using Selenium WebDriver

Verify Specific Position of an Element

Read it out for TESTNG before going for an iterview