Selenium Interview Questions & Answers

5 avg. rating (100% score) - 1 votes

Selenium Interview Questions & Answers

Selenium is the testing framework where applications are tested. One of its feature is record and play where the test scripts are run and can be played later. This is automatic. It is made up of four components, Selenium IDE, Selenium Remote Control, WebDriver, Selenium Grid. To overcome the manual testing difficult, it was introduced. Candidates should have knowledge on Selenium. Having certified in Selenium is very helpful in giving preference to you. There are number of positions available across all the locations. Wisdomjobs focus on providing interview questions and answers to help you in clearing the interview with ease. Selenium interview questions are useful to attend job interviews and get shortlisted for job position. Check out interview questions page to get more information.

Selenium Interview Questions

Selenium Interview Questions
    1. Question 1. How Do You Verify An Object Presented In Multiple Pages?

      Answer :

      Check on each page

      assertTrue(selenium.isElementPresent(locator));

    2. Question 2. How Do You Capture An Element Loading After The Page Load?

      Answer :

      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);
      }
      }

    3. Question 3. What Is Selenium ?

      Answer :

      • Selenium is a portable software testing framework for web applications.
      • The tests can be written as HTML tables or coded in a number of popular programming languages and can be run directly in most modern web browsers.
      • Selenium operations are highly flexible, allowing many options for locating UI elements and comparing expected test results against actual application behavior.
      • Selenium can be deployed on Windows, Linux, and Macintosh.
      • Selenium is used for UAT (User Acceptance Test)

    4. Question 4. Why And When To Automate?

      Answer :

      • Frequent regression testing
      • Repeated test case Execution is required
      • User Acceptance Tests
      • Faster Feedback to the developers
      • Reduce the Human Effort
      • Test same application on multiple environments

    5. Question 5. What Are The Components Of Selenium ?

      Answer :

      1. Selenium IDE
      2. Selenium Remote Control
      3. Selenium Grid

    6. Question 6. Explain About Selenium-ide ?

      Answer :

      • Selenium IDE is an integrated development environment for Selenium tests.
      • Operates as a Firefox add-on and provides an interface for developing and running individual test cases or entire test suites.
      • Selenium-IDE has a recording feature, which will keep account of user actions as they are performed and store them as a reusable script to play back.
      • It also has a context menu (right-click) integrated with the Firefox browser, which allows the user to pick from a list of assertions and verifications for the selected location.
      • Offers full editing of test cases.
      • Although it is a Firefox only add-on, tests created in it can also be run against other browsers by using Selenium-RC & specifying the name of the test suite on the command line.

    7. Question 7. What Are The Features Of Selenium Ide ?

      Answer :

      • Record and playback
      • Intelligent field selection will use IDs, names, or XPath as needed
      • Auto complete for all common Selenium commands
      • Walk through test cases and test suites.
      • Debug and set breakpoints
      • Save texts as HTML, Ruby scripts, or other formats
      • Support for Selenium user-extensions.js file
      • Option to automatically assert the title of every page
      • Rollup common commands

       

    8. Question 8. What Is Selenium-rc (remote Control) ?

      Answer :

      Selenium-RC provides an API (Application Programming Interface) and library for each of its supported languages: HTML, Java, C#, Perl, PHP, Python, and Ruby. Selenium-RC allows the test automation developer to use a programming language for maximum flexibility and extensibility in developing test logic.

      For instance, if the application under test returns a result set, and if the automated test program needs to run tests on each element in the result set, the programming languages iteration support can be used to iterate through the result set, calling Selenium commands to run tests on each item.

    9. Question 9. Explain About Selenium-grid ?

      Answer :

      Selenium-Grid allows the Selenium-RC solution to scale for test suites or test suites to be run in multiple environments.

      With Selenium-Grid multiple instances of Selenium-RC are running on various operating system and browser configurations, each of these when launching register with a hub. When tests are sent to the hub they are then redirected to an available Selenium-RC, which will launch the browser and run the test.

      This allows for running tests in parallel, with the entire test suite theoretically taking only as long to run as the longest individual test.

    10. Question 10. What Are The Selenese Commands In Selenium ?

      Answer :

      • clicking a link - click or clickAndWait commands
      • entering values - type command
      • selecting options from a drop-down listbox - select command
      • clicking checkboxes or radio buttons - click command

    11. Question 11. What Is Test Runner ?

      Answer :

      Test Runner allows you to run the test case in a browser loaded with the Selenium-Core TestRunner. Test runner is invoked by clicking the below Shown button in the IDE.

    12. Question 12. What Are The Running Options In Selenium ?

      Answer :

      • Run a Test Case: Click the Run button to run the currently displayed test case.
      • Run a Test Suite: Click the Run All button to run all the test cases in the currently loaded test suite.
      • Stop and Start: The Pause button can be used to stop the test case while it is running. The icon of this button then changes to indicate the Resume button. To continue click Resume.
      • Stop in the Middle: Set a breakpoint in the test case to cause it to stop on a particular command. This is useful for debugging your test case. To set a breakpoint, select a command, right-click, and from the context menu select Toggle Breakpoint.
      • Start from the Middle: We can set the IDE to begin running from a specific command in the middle of the test case. This also is used for debugging. To set a start point, select a command, right-click, and from the context menu select Set/Clear Start Point.
      • Run Any Single Command: Double-click any single command to run it by itself. This is useful when writing a single command. It lets you immediately test a command you are constructing, when you are not sure if it is correct. You can double-click it to see if it runs correctly. This is also available from the context menu.

       

    13. Question 13. What Are The Assertion Statements In Selenium ?

      Answer :

      • assertTextPresent : This will assert if the text is present in the page.
      • assertText: This will assert if a particular element is having the particular text.
      • assertTitle: This will assert if the page is having a proper title.
      • assertValue: This will assert if a Text box or check box has a particular value
      • assertElementPresent: This will assert if a particular UI Element is present in the page.

    14. Question 14. Explain Selenium Waitfor Commands ?

      Answer :

      • waitForPageToLoad : This command will make the script to wait till the page loads.Syntax is waitForPageToLoad(timeout); Timed out is the maximum time the script will wait for the page to load.
      • waitForAlert : This command will wait for the alert message to appear
      • waitForTable: This command will wait for the Web table to completely load in the page
      • waitForTitle: This command will for the page Title to appear on the browser.
      • Other waitFor commands : Selenium has several other wait command like waitForText,waitForPopup and so on. These commands are generically called Synchronization commands

    15. Question 15. What Are The Advantages And Disadvantages Of Selenium ?

      Answer :

      Advantages

      • Supports C#, Java, PHP, Perl, Python
      • Supported on Windows, Linux and Mac OS
      • Highly active developer community - backed by Google
      • Powerful methods to locate elements (Xpath, CSS, DOM)

      Disadvantages

      • Challenges running on browsers other than Firefox
      • Difficulty to automate AJAX
      • Limitations to automate Applets, MS and Desktop Applications

    16. Question 16. What Is Selenium Ide?

      Answer :

      Selenium IDE is an integrated development environment for Selenium tests. It is implemented as a Firefox extension, and has a recording feature, which will keep account of user actions as they are performed and store them as a reusable script to play back. Selenium-IDE also offers full editing of test cases for more precision and control.

    17. Question 17. Selenium Test A Application On Iphone Mobile Safari Browser?

      Answer :

      Selenium can handle Mobile Safari browser. There is experimental Selenium IPhone Driver for running tests on Mobile with Safari on the iPhone and iPad and iPod Touch.

    18. Question 18. Can Selenium Test An Application On Android Browser?

      Answer :

      Selenium can handle Android browser.

    19. Question 19. How To Start The Selenium Server From Your Language Class?

      Answer :

      try {
      seleniumServer = new SeleniumServer();
      seleniumServer.start();
      } catch (Exception e) {
      e.printStackTrace();
      }

    20. Question 20. But My Tests Need Me To Exercise Objects Outside Browser, How Do I Achieve It?

      Answer :

      You can use Robot class in java to achieve this, but it would be dirty solution even if you get through this.

    21. Question 21. What Are The Technical Challenges With Selenium?

      Answer :

      As you know Selenium is a free ware open source testing tool. There are many challenges with Selenium.

      1. Selenium supports only web based applications.
      2. It doesn’t support any non web based (Like Win 32, Java Applet, Java Swing, .Net Client Server etc) applications.
      3. When you compare selenium with QTP, Silk Test, Test Partner and RFT, there are many challenges in terms of maintainability of the test cases.
      4. Since Selenium is a freeware tool, there is no direct support if one is in trouble with the support of applications.
      5. There is no object repository concept in Selenium, so maintainability of the objects is very high
      6. There are many challenges if one have to interact with Win 32 windows even when you are working with Web based applications.
      7. Bitmap comparison is not supported by Selenium.
      8. Any reporting related capabilities, you need to depend on third party tools.
      9. You need to learn any one of the native language like (.Net, Java, Perl, Python, PHP, Ruby) to work efficiently with the scripting side of selenium.

    22. Question 22. How To Run Test Case Recorded Using Selenium Ide In Other Browsers?

      Answer :

      Running test case recorded with the help of Selenium Remote Control.

    23. Question 23. What Is The Selenium's Recording Language?

      Answer :

      Selenium’s recording language is “HTML”.

    24. Question 24. What Are The Steps To Run Automation Using Selenium?

      Answer :

      The very basic steps are:

      1. Record the test steps using selenium-IDE.
      2. Modify the script according to the testing needs. Add validation points, Java Scripts, Time-out etc.
      3. Run the test.
      4. View the result after test run complete analyze.

    25. Question 25. What Are The Capabilities Of Selenium Ide?

      Answer :

      Selenium IDE (Integrated Development Environment) works similar to commercial tools like QTP, Silk Test and Test Partner etc. The below points describes well about Selenium IDE.

      1. Selenium IDE is a Firefox add-on.
      2. Selenium IDE can support recording the clicks, typing, and other actions to make a test cases.
      3. Using Selenium IDE, a tester can play back the test cases in the Firefox browser.
      4. Selenium IDE supports exporting the test cases and suites to Selenium RC.
      5. Debugging of the test cases with step-by-step can be done.
      6. Breakpoint insertion is possible.
      7. Page abstraction functionality is supported by Selenium IDE.
      8. Selenium IDE can supports an extensibility capability allowing the use of add-ons or user extensions that expand the functionality of Selenium IDE.

    26. Question 26. Describe Technical Problems That You Had With Selenium Tool?

      Answer :

      As with any other type of test automation tools like SilkTest, HP QTP, Watir, Canoo Webtest, Selenium allows to record, edit, and debug tests cases. However there are several problems that seriously affect maintainability of recorded test cases, occasionally Quality Assurance Engineers complain that it takes more time to maintain automated test cases than to perform manual testing; however this is an issue with all automated testing tools and most likely related to improper testing framework design. Another problem is complex ID for an HTML element. If IDs is auto-generated, the recorder test cases may fail during playback. The work around is to use XPath to find required HTML element. Selenium supports AJAX without problems, but QA Tester should be aware that Selenium does not know when AJAX action is completed, so ClickAndWait will not work. Instead QA tester could use pause, but the snowballing effect of several 'pause' commands would really slow down total testing time of test cases. The best solution would be to use waitForElement.

    27. Question 27. What Test Can Selenium Do?

      Answer :

      Selenium could be used for the functional, regression, load testing of the web based applications. The automation tool could be implemented for post release validation with continuous integration tools like Jenkins, Hudson, QuickBuild or CruiseControl.

    28. Question 28. What Is The Price Of Selenium License Per Server?

      Answer :

      Selenium is open source software, released under the Apache 2.0 license and can be downloaded and used without charge.

    29. Question 29. How Much Does Selenium License Cost Per Client Machine?

      Answer :

      Selenium is open source software, released under the Apache 2.0 license and can be downloaded and used without charge.

    30. Question 30. Where To Download Selenium?

      Answer :

      Selenium can be downloaded and installed for free from seleniumhq.org

    31. Question 31. What Is The Latest Version Of Selenium?

      Answer :

      The latest versions are Selenium IDE 1.3.0, Selenium Server (formerly the Selenium RC Server) 2.8.0, Selenium Client Drivers Java 2.8.0, Selenium Client Drivers C# 2.8.0, Selenium Client Drivers Ruby 2.8.0, Selenium Client Drivers Python 2.8.1, Selenium Grid 1.0.8.

    32. Question 32. What Are The Limitations Of Selenium Ide?

      Answer :

      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.

    33. Question 33. What Does Side Stand For?

      Answer :

      Selenium IDE. It was a very tricky interview question.

    34. Question 34. Why Do I Get "permission Denied" Error During Execution Of Selenium Tests?

      Answer :

      The primary reason of permission denied error is same origin policy restriction from java script. To overcome this error you can use browsers with elevated security privileges. In case of Firefox you should use *chrome and in case of IE you should use *iehta as browser for working with Selenium.

    35. Question 35. Is There A Way For Me To Know All Available Options When I Start Selenium Server?

      Answer :

      If you want to see all options available while starting Selenium server then you should use option “-h” while starting Selenium server

      Java –jar .jar –h

      It would display you all the options which you can use while starting the Selenium server.

    36. Question 36. What Are The Locators Available In Selenium?

      Answer :

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

    37. Question 37. What Is Selenium Webdriver?

      Answer :

      Selenium WebDriver is a tool for writing automated tests of websites. It is an API name and aims to mimic the behaviour of a real user, and as such interacts with the HTML of the application. Selenium WebDriver is the successor of Selenium Remote Control which has been officially deprecated.

    38. Question 38. I Have Created My Own Firefox Profile; Can I Execute My Test Scripts On It

      Answer :

      You may like to create your own firefox profile because Selenium always created a clean firefox profile while executing the tests and none of your FF settings and plug-in are considered with this clean profile. If you want to execute tests on FF with your settings then you should create custom profile for FF.

      To be able to execute tests on a custom firefox profile you should specify its path while starting Selenium server. For example if your new profile is stored at “awesome location” in your directory then you should start Selenium server as following–

      Java –jar .jar -firefoxProfileTemplate "awesome location"

    39. Question 39. How Does Selenium Rc Stand With Other Commercial Tools?

      Answer :

      The biggest advantage of Selenium RC is that it is absolutely free and has vast support of languages and browsers (almost always). Selenium lags when it comes to test reporting as Selenium does not have any in built reporting but this can be easily achieved.

    40. Question 40. What Are Heightened Privileges Browsers?

      Answer :

      Firefox and IE have browser modes which are not restricted by java script’s same origin policy. These browsers are known as browsers with elevated security privileges. In case of Firefox it is known as chrome (It’s not the Google browser) and in case of IE it is known as iehta

    41. Question 41. I Am Not Able To Use "style" Attribute To Locate Element With Ie Browser?

      Answer :

      This is because IE expects attribute values to be in caps while other browsers expect it to be lower case letters. Hence

      //tr[@style="background-color:yellow"] works with other browsers
      //tr[@style="BACKGROUND-COLOUR:yellow"] works with IE

    42. Question 42. How Many Testing Framework Can Qa Tester Use In Selenium Rc?

      Answer :

      Testing frameworks aren't required, but they can be helpful if QA Tester wants to automate test cases. Selenium RC supports Bromine, JUnit, NUnit, RSpec (Ruby), Test::Unit (Ruby), TestNG (Java), unittest (Python).

    43. Question 43. How To Developer Selenium Test Cases?

      Answer :

      Using the Selenium IDE, QA Tester can record a test to comprehend the syntax of Selenium IDE commands, or to check the basic syntax for a specific type of user interface. Keep in mind that Selenium IDE recorder is not clever as QA Testers want it to be. Quality assurance team should never consider Selenium IDE as a "record, save, and run it" tool, all the time anticipate reworking a recorded test cases to make them maintainable in the future.

    44. Question 44. What Programming Language Is Best For Writing Selenium Tests?

      Answer :

      The web applications may be written in Java, Ruby, PHP, Python or any other web framework. There are certain advantages for using the same language for writing test cases as application under test. For example, if the team already have the experience with Java, QA Tester could always get the piece of advice while mastering Selenium test cases in Java. Sometimes it is better to choose simple programming language that will ultimately deliver better success. In this case QA testers can adopt easier programming languages, for example Ruby, much faster comparing with Java, and can become become experts as soon as possible.

    45. Question 45. Have You Read Any Good Books On Selenium?

      Answer :

      There are several great books covering Selenium automation tool, you could check the review at Best Selenium Books: Top Recommended page.

    46. Question 46. Do You Know Any Alternative Test Automation Tools For Selenium?

      Answer :

      Selenium appears to be the mainstream open source tool for browser side testing, but there are many alternatives. Canoo Webtest is a great Selenium alternative and it is probably the fastest automation tool. Another Selenium alternative is Watir, but in order to use Watir QA Tester has to learn Ruby. One more alternative to Selenium is Sahi, but is has confusing interface and small developers community.

    47. Question 47. Compare Hp Qtp Vs Selenium?

      Answer :

      When QA team considers acquiring test automation to assist in testing, one of the most critical decisions is what technologies or tools to use to automate the testing. The most obvious approach will be to look to the software market and evaluate a few test automation tools. Read Selenium vs QTP comparison

    48. Question 48. What Are The Technical Challenges With Selenium?

      Answer :

      As you know Selenium is a free ware open source testing tool. There are many challenges with Selenium.

      1. Selenium Supports only web based applications
      2. It doesn’t support any non web based (Like Win 32, Java Applet, Java Swing, .Net Client Server etc) applications
      3. When you compare selenium with QTP, Silk Test, Test Partner and RFT, there are many challenges in terms of maintainability of the test cases
      4. Since Selenium is a freeware tool, there is no direct support if one is in trouble with the support of applications
      5. There is no object repository concept in Selenium, so maintainability of the objects is very high
      6. There are many challenges if one have to interact with Win 32 windows even when you are working with Web based applications
      7. Bitmap comparison is not supported by Selenium
      8. Any reporting related capabilities, you need to depend on third party tools
      9. You need to learn any one of the native language like (.Net, Java, Perl, Python, PHP, Ruby) to work efficiently with the scripting side of selenium

    49. Question 49. How To Test Ajax Application With Selenium?

      Answer :

      Ajax interview questions could be tough for newbie in the test automation, but will be easily cracked by Selenium Tester with a relevant experience. Read the detailed approach at Testing Ajax applications with Selenium in the right way

    50. Question 50. How Can I Learn To Automate Testing Using Selenium?

      Answer :

      Don't be surprised if the interviewer asks you to describe the approach for learning Selenium. This interviewer wants to hear how you can innovative software test automation process the company. Most likely they are looking for software professional with a good Selenium experience, who can do Selenium training for team members and get the team started with test automation. I hope this Selenium tutorial will be helpful in the preparation for this Selenium interview question.

    51. Question 51. While Trying To Execute My Tests With Firefox I Encountered Following Error "firefox Refused Shutdown While Preparing A Profile". How Do I Solve It?

      Answer :

      This message simply means that Selenium is not able to launch FF browser as it is already running on your system. To overcome this you should close all running instances of FF browser.

      You should also check your system process if there is any hidden FF profile running which is not visible on screen. You should kill all FF processes and following this your tests should run smooth

    52. Question 52. What Is The Use Of Context Menu In Selenium Ide?

      Answer :

      It allows the user to pick from a list of assertions and verifications for the selected location.

    53. Question 53. How Do You Select The 2nd Item In A List Box Or Drop Down?

      Answer :

      selenium.select(selectLocator, optionLocator)
      selectLocator – a locator for the select element
      optionLocator – a locator for the option element

    54. Question 54. What Are The Advantage And Features Of Selenium Ide?

      Answer :

      1. Intelligent field selection will use IDs, names, or XPath as needed
      2. It is a record & playback tool and the script format can be written in various languages including C#, Java, PERL, Python, PHP, HTML
      3. Auto complete for all common Selenium commands
      4. Debug and set breakpoints
      5. Option to automatically assert the title of every page
      6. Support for Selenium user-extensions.js file

       

    55. Question 55. What Are The Disadvantage Of Selenium Ide Tool?

      Answer :

      1. Selenium IDE tool can only be used in Mozilla Firefox browser.
      2. It is not playing multiple windows when we record it.

    56. Question 56. How Do I Upload A File Using Selenium? I Need To Upload A Word File During Test Execution.

      Answer :

      If you are using Firefox then you can use “type” command to type in a File Input box of upload file. But type operation does not work with IE and you would have to use “Robot” class in java to work make file upload work.

    57. Question 57. What Is The Difference Between Single And Double Slash In Xpath?

      Answer :

      /

      1. start selection from the document node
      2. allows you to create 'absolute' path expressions
      3. example “/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. example. “//p” matches all the paragraph elements

       

    58. Question 58. What You Say About The Flexibility Of Selenium Test Suite?

      Answer :

      Selenium testing suite is highly flexible. There are multiple ways to add functionality to Selenium framework to customize test automation. As compared to other test automation tools, it is Selenium’s strongest characteristic. Selenium Remote Control support for multiple programming and scripting languages allows the test automation engineer to build any logic they need into their automated testing and to use a preferred programming or scripting language of one’s choice.

      Also, the Selenium testing suite is an open source project where code can be modified and enhancements can be submitted for contribution.

    59. Question 59. What Is The Cost Of Selenium Test Suite?

      Answer :

      Selenium test suite a set of open source software tool, it is free of cost.

    60. Question 60. What Browsers Are Supported By Selenium Remote Control?

      Answer :

      The test automation expert can use Firefox, IE 7/8, Safari and Opera browsers to run tests in Selenium Remote Control.

    61. Question 61. What Programming Languages Can You Use In Selenium Rc?

      Answer :

      C#, Java, Perl, PHP, Python, Ruby

    62. Question 62. What Are The Advantages And Disadvantages Of Using Selenium As Testing Tool?

      Answer :

      Advantages: Free, Simple and powerful DOM (document object model) level testing, can be used for continuous integration; great fit with Agile projects.

      Disadvantages: Tricky setup; dreary errors diagnosis; can not test client server applications.

    63. Question 63. What Is Difference Between Qtp And Selenium?

      Answer :

      Only web applications can be testing using Selenium testing suite. However, QTP can be used for testing client server applications. Selenium supports following web browsers: Internet Explorer, Firefox, Safari, Opera or Konqueror on Windows, Mac OS X and Linux. However, QTP is limited to Internet Explorer on Windows.

      QTP uses scripting language implemented on top of VB Script. However, Selenium test suite has the flexibility to use many languages like Java, .Net, Perl, PHP, Python, and Ruby.

    64. Question 64. What Is Difference Between Borland Silk Test And Selenium?

      Answer :

      Selenium is completely free test automation tool, while Silk Test is not. Only web applications can be testing using Selenium testing suite. However, Silk Test can be used for testing client server applications. Selenium supports following web browsers: Internet Explorer, Firefox, Safari, Opera or Konqueror on Windows, Mac OS X and Linux. However, Silk Test is limited to Internet Explorer and Firefox.

      Silk Test uses 4Test scripting language. However, Selenium test suite has the flexibility to use many languages like Java, .Net, Perl, PHP, Python, and Ruby.

    65. Question 65. What Is The Difference Between An Assert And A Verify With Selenium Commands?

      Answer :

      Effectively an “assert” will fail the test and abort the current test case, whereas a “verify” will fail the test and continue to run the test case.

    66. Question 66. If A Selenium Function Requires A Script Argument, What Would That Argument Look Like In General Terms?

      Answer :

      StoreEval(script, variable) and storeExpression(expression, variableName)

    67. Question 67. If A Selenium Function Requires A Pattern Argument, What Five Prefixes Might That Argument Have?

      Answer :

      glob, regexp, exact, regexpi

    68. Question 68. What Is The Regular Expression Sequence That Loosely Translates To "anything Or Nothing?"

      Answer :

      (.* i.e., dot star) This two-character sequence can be translated as “0 or more occurrences of any character” or more simply, “anything or nothing.

    69. Question 69. What Is The Globbing Sequence That Loosely Translates To Anything Or Nothing?

      Answer :

      (*) which translates to “match anything,” i.e., nothing, a single character, or many characters.

    70. Question 70. What Does A Character Class For All Alphabetic Characters And Digits Look Like In Regular Expressions?

      Answer :

      [0-9] matches any digit
      [A-Za-z0-9] matches any alphanumeric character
      [A-Za-z] matches any alphabet character

    71. Question 71. What Does A Character Class For All Alphabetic Characters And Digits Look Like In Globbing?

      Answer :

      [0-9] matches any digit
      [a-zA-Z0-9] matches any alphanumeric character
      [a-zA-Z] matches any alphabet character

    72. Question 72. What Must One Set Within Side In Order To Run A Test From The Beginning To A Certain Point Within The Test?

      Answer :

      Set Toggle BreakPoint.

    73. Question 73. What Does A Right-pointing Green Triangle At The Beginning Of A Command In Side Indicate?

      Answer :

      Play Entire Test Suite

    74. Question 74. Which Wildcards Does Side Support?

      Answer :

      *, [ ]

    75. Question 75. What Regular Expression Special Character(s) Means "any Character?"

      Answer :

      (.*)

    76. Question 76. What Distinguishes Between An Absolute And Relative Url In Side?

      Answer :

      Absolute URL: Its is base url and this represent domain address. Relative URL: (Absolute URL + Page Path). Open command uses Base URL (Absolute URL) to navigate web page.

    77. Question 77. How Would One Access A Selenium Variable Named "count" From Within A Javascript Snippet?

      Answer :

      ${count}

    78. Question 78. What Selenese Command Can Be Used To Display The Value Of A Variable In The Log File, Which Can Be Very Valuable For Debugging?

      Answer :

      echo()

    79. Question 79. If One Wanted To Display The Value Of A Variable Named Answer In The Log File, What Would The First Argument To The Previous Command Look Like?

      Answer :

      echo()

    80. Question 80. Which Selenium Command(s) Simulates Selecting A Link?

      Answer :

      click, clickandWait, ClickAt, ClickAtandWait, DoubleClick, DoubleClickandWait, doubleClickAt,
      doubleClickAtandWait

    81. Question 81. Which Two Commands Can Be Used To Check That An Alert With A Particular Message Popped Up?

      Answer :

      The following commands are available within Selenium for processing Alerts:

      • getAlert()
      • assertAlert()
      • assertAlertNotPresent()
      • assertAlertPresent()
      • storeAlert()
      • storeAlertPresent()
      • verifyAlert()
      • verifyAlertNotPresent()
      • verifyAlertPresent()
      • waitForAlert()
      • waitForAlertNotPresent()
      • waitForAlertPresent()

      The AlertPresent() and AlertNotPresent() functions check for the existence or not of an alert – regardless of it’s content. The Alert() functions allow the caller to specify a pattern which should be matched. The getAlert() method also exists in Selenium RC, and returns the text from the previous Alert displayed.

      SELENIUM IDE Interview Questions and Answers

    82. Question 82. What Do You Know About Selenium?

      Answer :

      Selenium is a suite of tools for web automation testing.

      Selenium first came to life in 2004 when Jason Huggins was testing an internal application at ThoughtWorks.

      Selenium was a tremendous tool, it wasn't without it’s drawbacks. Because of its Javascript based automation engine and the security limitations browsers apply to Javascript, different things became impossible to do.

      Selenium Suite of projects include:

      Selenium IDE
      Selenium Core
      Selenium 1 (known as. Selenium RC or Remote Control)
      Selenium 2 (known as. Selenium Webdriver)
      Selenium-Grid

    83. Question 83. What Are The Test Types Supported By Selenium?

      Answer :

      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. QuickBuild
      4. CruiseCont

    84. Question 84. What Are The Challenges With Selenium Ide?

      Answer :

      Selenium-IDE does not directly support:

      1. conditional statements
      2. iteration or looping
      3. logging and reporting of test results
      4. error handling, particularly unexpected errors
      5. database testing 6. test case grouping
      6. re-execution of failed tests
      7. test case dependency
      8. capture screenshots on test failures
      9. Results Report generations

    85. Question 85. Which Are The Browsers Supported By Selenium Ide?

      Answer :

      Selenium IDE supports only one browser Mozilla Firefox. The versions supported as of now are:

      Mozilla Firefox 2.x
      Mozilla Firefox 3.x

      The versions not supported as of now are:

      earlier versions of Mozilla Firefox 2.x
      Mozilla Firefox 4.x

    86. Question 86. How To Execute A Single Line Command From Selenium Ide?

      Answer :

      Single line command from Selenium IDE can be executed in two ways

      1. Right click on the command in Selenium IDE and select "Execute This Command"
      2. Select the command in Selenium IDE and press "X" key on the keyboard

    87. Question 87. How To Insert A Start Point In Selenium Ide?

      Answer :

      Start point Selenium IDE can be set in two ways

      1. Right click on the command in Selenium IDE and select "Set / Clear Start Point"
      2. Select the command in Selenium IDE and press "S" key on the keyboard
      3. You can have only one start point
      4. If you have already set one start point and you selected other command as start point. Then the first start point will be removed and the new start point will be set

    88. Question 88. How To Insert A Comment In Selenium Ide?

      Answer :

      Comments in Selenium IDE can be set in two ways

      1. Right click on the command in Selenium IDE and select "Insert New Comment"
      2. If you want to comment an existing line. You need to follow the below mentioned steps.
        1. Select the source tab in IDE
        2. Select the line which you want to comment
        3. Assume that if you want to comment a open command you need to write like below mentioned code
      <tr> 
      <!-- 
      <td>open&l/td>
      <td>/node/304/edit&l/td>
      <td></td>
      -->
      </tr>

    89. Question 89. How To Insert A Breakpoint In Selenium Ide?

      Answer :

      Break point can be set in two ways in Selenium IDE

      1. Right click on the command in Selenium IDE and select "Toggle BreakPoint"
      2. Select the command in Selenium IDE and press "B" key on the keyboard
      3. If you want to clear the break point once again Spress "B" key on the keyboard
      4. You can set multiple break points in Selenium IDE

    90. Question 90. How To Export The Tests From Selenium Ide To Selenium Rc In Different Languages?

      Answer :

      From selenium IDE the test cases can be exported into the languages

      1. .Net,
      2. Java,
      3. Perl,
      4. Python,
      5. PHP,
      6. Ruby

      The below mentioned steps can explain how to export the test cases

      1. Open the test case from Selenium IDE
      2. Select File -> Export Test Case As

       

    91. Question 91. Which Is The Command Used For Displaying The Values Of A Variable Into The Output Console Or Log?

      Answer :

      The command used for displaying the values of a variable into the output console or log - echo

      If you want to display a constant string.

      The below mentioned command can be used echo

      ex: echo "The sample message" If you want to display the value of a variable it can be written like below

      echo ${variable name}

      example: echo ${var1}

      Note: Here var1 is the variable

       

    92. Question 92. How Do You Set User Extensions In Selenium Ide?

      Answer :

      1. Open user-extensions.js with an editor (Notepad, etc.); it's found in the seleniumcorescripts folder. If it doesn't exist, just create it.
      2. If you need to, commit the user-extensions.js file (like if you use subversion).
      3. Open Selenium IDE and choose the Options menu and then Options... from that menu.
      4. Make sure the path to your user-extensions.js file is entered in the Selenium Core extensions field (like seleniumcorescriptsuser-extensions.js)
      5. Press OK button on options
      6. Restart the IDE to reflect your extensions.

    93. Question 93. Define Selenium 2.x?

      Answer :

      It is the next generation selenium. It is selenium server-web driver that replaces Selenium RC.

    94. Question 94. What Is Needed To Be Good At Selenium?

      Answer :

      HTML basic knowledge, web technologies and web based testing are mandatory. Other software development languages are not needed. It is better to have knowledge on JAVA script.

    95. Question 95. From Where, You Can Download Selenium?

      Answer :

      Initially, visit official site of Selenium to get information about it. Different version can be downloaded from official site.

    96. Question 96. My Application Uses Ajax Heavily How Do I Use Selenium Rc To Work With Ajax Operations?

      Answer :

      Ajax operations don’t reload a page like normal form submission but they make http requests behind the scene. You cannot use waitForPageToLoad for such operations and instead should use conditional wait for change in state of application. This could as well mean waiting for presence of an element before continuing with test operations. Consider following example in which type operation triggers Ajax operation which is followed by conditional wait for presence of a text box

      // type operation brings element “q” on screen without loading the page

      selenium.type("elementLocator","testData");
      // conditional wait for element “q”
      for(intsecond = 0;; second++) {
      if(second >= 60) fail("timeout");
      try {if(selenium.isElementPresent("q"))break;}catch(Exception e){}
      Thread.sleep(1000);
      }

    97. Question 97. Give The Steps For Running Automation Using Selenium?

      Answer :

      The basic steps are given below:

      • Record test steps by making use of selenium-IDE
      • Change the script according to the requirements of testing. Add java scripts, validation points, Time-out, etc.
      • Now, run test
      • Result can be viewed after analyzing test run

       

    98. Question 98. Define Selenium Test Suite And How It Is Developed?

      Answer :

      The main concept of software testing is to group test cases as test suite. HTML files containing links of test cases in selenium. To run test suite, selenium IDE plug-in called Test runner is used.

    99. Question 99. How To Run Test Case Traced By Employing Ide In Browsers?

      Answer :

      Selenium remote control is used in this case.

    100. Question 100. Give Ide's Main Parts And Components?

      Answer :

      • Target
      • Command and
      • Value

    101. Question 101. How Recorded Command Can Be Edited In Ide?

      Answer :

      First select and choose interested value from drop-down.

    102. Question 102. Give The Default Port Number Of Selenium Server?

      Answer :

      4444

    103. Question 103. Give Major Components Of Selenium Testing Tools?

      Answer :

      • Selenium RC
      • Selenium IDE
      • Selenium Grid

    104. Question 104. In Selenium Ide, Give The Usage Of Context Menu?

      Answer :

      It permits user to select from assertions and verifications list for chosen specific location.

    105. Question 105. Give Selenium Ide Tool Disadvantage?

      Answer :

      • The selenium IDE tool works only in Mozilla Firefox browser
      • Multiple windows are not played when it is recorded.

    106. Question 106. Did You Write Any User Extensions?

      Answer :

      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 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.

Selenium Tutorial

Selenium Practice Tests


Face Book Twitter Google Plus Instagram Youtube Linkedin Myspace Pinterest Soundcloud Wikipedia

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Selenium Tutorial