December 20, 2016
XML Quiz
December 28, 2014
Selenium WebDriver Quiz Part 4
You may have already attempted the Selenium Quiz Parts 1, 2 and 3. If not, try those first. Now, attempt this short part 4 of this quiz to check your familiarity with Selenium WebDriver (also known as Selenium 2) basics. Selenium-WebDriver is the new Selenium tool that has a simpler and more powerful API than Selenium 1. Additionally, it addresses the limitations of Selenium RC. Each question in this quiz has four options with one best answer. The score is updated at the bottom left as you answer each question.
June 09, 2013
VBScript Questions and Answers
1. Which browser has built-in support for executing VBScript?
2. Which statement is true for VBScript names e.g. variable names or procedure names?
3. What is the datatype of a variable in VBScript?
4. What is the difference between the Sub procedure and Function procedure?
5. In the Select Case statement, which case is used for unknown cases?
6. Which loop is used to iterate till a condition becomes true?
7. What is the purpose of the Set keyword in VBScript?
8. Which VBScript function returns the day of the week for any date?
9. Which VBScript function converts an input string to all lowercase?
10. Which VBScript function can compare two strings?
Score is 0/ 10.
Mention your scores in the comments below.
March 31, 2013
Selenium RC Quiz Part 3
Instead of this quiz, you may want to see my video on Selenium Questions and Answers where I have compiled all these questions.
1. What are the different modes that Selenium uses?
2. How do you start the browser?
3. Do you need to have Selenium .jar files as a dependency of your tests?
4. How many parameters does the Selenium object take when using DefaultSelenium?
5. How do you start selenium rc server with user extensions?
6. Which Selenium command do you use to run commands in slow motion in Selenium RC?
7. Which command is used to get the alert box?
8. Which command is used for verifying if a web element exists?
9. Which command is used for typing in a textbox?
10. What is the command to load a page?
Score is 0/ 10.
Please remember to mention your scores in the comments below. Now answer the quiz on Selenium WebDriver (also known as Selenium 2).
March 06, 2013
Selenium IDE Quiz Part 2
Instead of this quiz, you may want to see my video on Selenium Questions and Answers where I have compiled all these questions.
March 01, 2013
Selenium IDE Quiz Part 1
February 24, 2013
Java Questions and Answers Part 2
1. How can you add GUI elements to a Java application?
Java has an API called swing to provide GUI components such as textboxes, checkboxes, radiobuttons, comboboxes and so on. These components are available on importing javax.swing.*. The process to add a GUI element to a Java application involves creating a new object of the component class, adding the object to the container and attaching an event handler to the object.
2. How can you accept user input to a Java application?
This can be done by importing the java.util.Scanner class. The Scanner class has methods like nextInt, nextDouble, nextLine and so on to accept inputs of different data types from the user into a variable.
3. What methods are available to search within a string?
The String class in Java has a vast number of methods. There are many methods to search for characters within a string. Some of these methods include charAt, contains, indexOf, lastIndexOf, startsWith and endsWith.
4. How do you draw graphics in an application?
Java has a built-in Graphics object. This object has methods such as drawArc, drawImage, drawLine, drawRect (empty rectangle)/ fillRect (solid rectangle), drawPolygon/ fillPolygon and so on that can be invoked to draw the respective lines and shapes in any desired color.
5. How can you work with files and folders?
First, import the java.io.File library. Then create an object of the File class and point it to the required file or directory. This object will have the file's properties (e.g. length, isDirectory, lastModified) and methods (e.g. listFiles, createNewFile, getPath). A Scanner object can be created for the File object and used to fetch the contents in the file.
6. How do you handle exceptions?
There may be code which if executed may throw an exception. Such code is put inside a try block, which is followed by a catch block containing the exception handler. If the code throws an exception when it is executed, the control flows to the catch block. The try block may have one or more lines of code. Each line of code may have its own try block. There can be one or more catch blocks to handle different types of exceptions. All such catch blocks immediately follow the try block.
7. What is recursion?
A recursive method is one that calls itself. See the example below. For a given integer input that is greater than one, this method sums all integers from the input down to one. This method has the base case for input equal to one. The recursion exists where sumAll method calls itself in the last line.
public static int sumAll(int n){
if (n==1)
return 1;
else
return n + sumAll(n-1);}// recursion is in this line of code
8. What is the benefit of using a List instead of an array?
The Collections class has several useful methods that work on a List but not on an array. Examples of these methods are addAll, binarySearch, copy, fill, max, min, reverse, shuffle and sort.
9. What is the difference between Stack and PriorityQueue classes?
A new element can be added to the Stack by the push method. The new element is always added at the top of the Stack. In an existing Stack, the top element can be removed by the pop method. The Stack has other methods to add and remove elements at specified positions within the Stack.
In a PriorityQueue, a new element is added by the offer method. This new element is always inserted at the bottom of the queue. In an existing queue, the top element can be removed by using the poll method. The queue does not have methods to add and remove elements at specified positions within the queue.
10. How can different code in a program be executed concurrently?
This can be done using threads. A Java application can have multiple threads of execution running at the same time. A thread can be created by writing a class that implements the Runnable interface which means implementing the run method. Thereafter, a new thread can be created by instantiating a new Thread passing the new object of this class as parameter. A Thread object has a number of methods like setPriority and start.
February 13, 2013
Java Questions and Answers Part 1
February 04, 2013
JavaScript Quiz Part 2 (final part)
January 28, 2013
HTML (HyperText Markup Language) Quiz
January 21, 2013
JavaScript Quiz Part 1
2. What is the result of applying an arithmetic operator on a string?
3. How do you reduce the time it takes a javascript switch statement to execute?
4. What is the difference between == and === operators in javascript?
5. What happens when a javascript function is called with extra parameters? For example, the function is defined with 2 parameters but is invoked with 3 parameters.
6. Which javascript loop runs at least once?
7. What is the result of running the following loop?
var i=1;
8. In javascript, what is the preferred way of creating just one instance of a user-defined object?
9. The concat method does which of the following tasks in javascript?
10. In javascript, the elements of an associative array can be referred by their number index. True or false?
January 16, 2013
HTML and CSS Quiz Part 2
2. Which input type is used to create a Browse button?
3. In CSS, which tag can be used to style multiple elements all at once?
4. In CSS, which prefix is used before the class selector?
5. Which of these CSS selectors for a paragraph is (are) INCORRECT?
6. Which position places an element down and left to its normal position?
7. Which position places an element so that it stays in place even when the web page is scrolled?
8. How are external stylesheets (styles applied to multiple web pages) written?
9. If there is a conflict between the style defined in an external stylesheet and that defined within the web page, which style is applied to the element?
10. Which of these attributes of a FORM tag is(are) INCORRECT?
