Selenium Interview Questions and Answers
Question - 71 : - How can you retrive the message in an alert box ?
Answer - 71 : -
You can use the storeAlert command which will fetch the message of the alert pop up and store it in a variable.
Question - 72 : - What is selenium RC (Remote Control)?
Answer - 72 : -
Selenium IDE have limitations in terms of browser support and language support. By using Selenium RC limitation can be diminished.
- On different platforms and different web browser for automating web application selenium RC is used with languages like Java, C#, Perl, Python
- Selenium RC is a java based and using any language it can interact with the web application
- Using server you can bypass the restriction and run your automation script running against any web application
Question - 73 : - Why Selenium RC is used?
Answer - 73 : -
Selenium IDE does not directly support many functions like condition statements, Iteration, logging and reporting of test results, unexpected error handling and so on as IDE supports only HTML language. To handle such issues Selenium RC is used it supports the language like Perl, Ruby, Python, PHP using these languages we can write the program to achieve the IDE issues.
Question - 74 : - Explain what is the main difference between web-driver and RC ?
Answer - 74 : -
The main difference between Selenium RC and Webdriver is that, selenium RC injects javascript function into browsers when the page is loaded. On the other hand, Selenium Webdriver drives the browser using browsers built in support
Question - 75 : - What are the advantages of RC?
Answer - 75 : -
Advantages of RC are
- Can read or write data from/ to .xls, .txt, etc
- It can handle dynamic objects and Ajax based UI elements
- Loops and conditions can be used for better performance and flexibility
- Support many Programming languages and Operating Systems
- For any JAVA script enabled browser Selenium RC can be used
Question - 76 : - Explain what is framework and what are the frameworks available in RC?
Answer - 76 : -
A collection of libraries and classes is known as Framework and they are helpful when testers has to automate test cases. NUnit, JUnit, TestNG, Bromine, RSpec, unittest are some of the frameworks available in RC .
Question - 77 : - How can we handle pop-ups in RC ?
Answer - 77 : -
To handle pop-ups in RC , using selectWindow method, pop-up window will be selected and windowFocus method will let the control from current window to pop-up windows and perform actions according to script
Question - 78 : - What are the technical limitations while using Selenium RC?
Answer - 78 : -
Apart from “same origin policy” restriction from js, Selenium is also restricted from exercising anything that is outside browser.
Question - 79 : - Can we use Selenium RC to drive tests on two different browsers on one operating system without Selenium Grid?
Answer - 79 : -
Yes, it is possible when you are not using JAVA testing framework. Instead of using Java testing framework if you are using java client driver of selenium then TestNG allows you to do this. By using “parallel=test” attribute you can set tests to be executed in parallel and can define two different tests, each using different browser.
Question - 80 : - Why to use TestNG with Selenium RC ?
Answer - 80 : -
If you want full automation against different server and client platforms, You need a way to invoke the tests from a command line process, reports that tells you what happened and flexibility in how you create your test suites. TestNG gives that flexibility.