Showing posts with label Quiz Time. Show all posts
Showing posts with label Quiz Time. Show all posts

December 20, 2016

XML Quiz


XML (eXtensible Markup Language) defines rules to create and store documents in a text format. It is extensively used to transfer encoded data over the internet between different applications. You can learn XML from my XML coding tutorial for beginners - Part 1 and XML coding tutorial for beginners - Part 2
 
If you are into web applications, it is important to know XML along with HTML, CSS and JavaScript. XML looks deceptively simple on the surface but it has many features. Try this quiz to find out how well you know XML.

December 28, 2014

Selenium WebDriver Quiz Part 4


Selenium is a popular open source test automation tool for web applications that is used for functional and cross-browser compatibility testing. You can learn from my video, Selenium WebDriver tutorial.

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

VBScript is a scripting language used to create test automation in tools such as UFT and TestComplete. In addition, it is used to automate user tasks on Windows computers. Learn VBScript in detail using my free VBScript video tutorials. Then attempt the below quiz on VBScript.
 
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. Try it.

1. Which browser has built-in support for executing VBScript?
Internet Explorer
Mozilla Firefox
Opera
None of these

2. Which statement is true for VBScript names e.g. variable names or procedure names?
They are case sensitive.
They are case insensitive.
They are case insensitive but should be written consistently for readability.
Only variable names are case insensitive.

3. What is the datatype of a variable in VBScript?
String
Variant
It is the datatype specified when that variable is declared.
None of the above

4. What is the difference between the Sub procedure and Function procedure?
Only the Sub procedure can perform actions
Both procedures can take arguments
Only the Function procedure can return a value
All of the above

5. In the Select Case statement, which case is used for unknown cases?
Else
Default
Unknown
Not

6. Which loop is used to iterate till a condition becomes true?
For Next loop
For Each Next loop
Do While loop
Do Until loop

7. What is the purpose of the Set keyword in VBScript?
Assign a value to any variable
Assign a value to an object variable
Declare an array
Configure the VBScript program

8. Which VBScript function returns the day of the week for any date?
Date
Day
Weekday
Now

9. Which VBScript function converts an input string to all lowercase?
LCase
LowerCase
Lower
There is no such function to directly convert to lowercase.

10. Which VBScript function can compare two strings?
StringCompare
Compare
StrComp
StrCompare

Score is 0/ 10.
Mention your scores in the comments below.

March 31, 2013

Selenium RC Quiz Part 3


Selenium is a popular open source test automation tool for web applications that is used for functional and cross-browser compatibility testing. You may have already attempted the Selenium Quiz Part 1 and 2. If not, try those first. Now, attempt the part 3 of this quiz to check your familiarity with Selenium RC (also known as Selenium 1). Selenium RC is the original Selenium tool. RC has the Selenium Server that controls the browsers and Client Libraries for the supported programming languages (Java, Ruby, Python, Perl, PHP or .Net). Each question in this quiz has four options with one best answer. The score appears at the bottom left. A score of 5 or less indicates low knowledge; 6 to 7 means a fair level of knowledge and 8 and above shows a good knowledge of Selenium RC.
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?
*iehta
*firefox and *iexplore
*chrome
All of the above

2. How do you start the browser?
selenium.Start()
get start()
selenium.server start()
None of the above

3. Do you need to have Selenium .jar files as a dependency of your tests?
Yes
No
Yes, but as a good practice only
No Selenium jar file is provided with Selenium RC.

4. How many parameters does the Selenium object take when using DefaultSelenium?
2
3
4
6

5. How do you start selenium rc server with user extensions?
java -jar selenium-server.jar
java -jar selenium-server.jar -userExtensions user-extensions.js
java -jar selenium-server.jar user-extensions.js
java -jar selenium-server.jar user-extensions.js -h

6. Which Selenium command do you use to run commands in slow motion in Selenium RC?
selenium.setSpeed()
selenium.speed()
selenium.serverSpeed()
None of the above

7. Which command is used to get the alert box?
assertequals(selenium.getAlert())
selenium.getAlert()
selenium.alertBox()
selenium.click()

8. Which command is used for verifying if a web element exists?
selenium.isElementPresent(String locator)
assertTrue(Selenium.isElementPresent())
selenium.ElementPresent()
None of the above

9. Which command is used for typing in a textbox?
selenium.input()
selenium.type(String locator, String value)
assertequals(selenium.getValues())
selenium.textInput()

10. What is the command to load a page?
selenium.waitForPageToLoad(String timeoutInMilliseconds)
selenium.waitForPageToLoadInt timeoutInMilliseconds
selenium.waitForPageToLoad(timeoutInMilliseconds)
selenium.waitForPageToLoad()
Score is 0/ 10.

I have written the JavaScript source code that runs the quiz. The questions and answers of this quiz have been contributed by Varsha Tomar.

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


As you know, Selenium is a popular open source test automation tool for web applications that is used for functional and cross-browser compatibility testing. You may have already attempted the Selenium IDE Quiz Part 1. If not, try that first. Now, attempt the part 2 of this quiz to check your familiarity with Selenium IDE. Some of the answer choices are quite similar so please read each answer carefully before selecting the best one. The score appears at the bottom. A score of 5 or less indicates low knowledge, 6 to 7 means a fair level of knowledge and 8 and above shows a good knowledge of the Selenium IDE.
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


Selenium is a popular open source test automation tool for web applications. It is used for functional and cross-browser compatibility testing. In addition, several other open source functional testing tools are based on Selenium. This quiz on Selenium IDE is the first part of my series on testing using Selenium. Attempt this quiz to check your familiarity with Selenium IDE. Each question has one best answer. The score appears at the bottom. A score of 5 or less indicates low knowledge, 6 to 7 means a fair level of knowledge and 8 and above shows a good knowledge of the Selenium IDE. Instead of this quiz, you may want to see my video on Selenium Questions and Answers where I have compiled all these questions. 
 
Note: You can learn Selenium WebDriver from my complete set of Selenium Python tutorials for Beginners.

February 24, 2013

Java Questions and Answers Part 2

As you know, Java is one of most popular object-oriented programming languages and has been in use since its release. It is interesting that test automation can be written in Java in certain automated testing tools/ frameworks. View the videos, Java Interview Questions and Answers - 1 and Java Interview Questions and Answers - 2. Or read on.

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


As you would know, Java is one of the most popular object-oriented programming languages and has been in use since its release in 1995. What is particularly interesting is that test automation can be written in Java in certain automated testing tools/ frameworks. Here are some basic questions and answers related to the Java programming language. These questions and answers are excerpted from the notes that I created. View the videos, Java Interview Questions and Answers - 1

and Java Interview Questions and Answers - 2. Or read on.

February 04, 2013

JavaScript Quiz Part 2 (final part)


As you may know, JavaScript is the default scripting language of the browser. In addition, much test automation is also written in JavaScript. If you have not attempted the Part 1 of this Quiz, do that first. Then attempt this part of the quiz to find out how well you know JavaScript. If you can answer 8 or more questions correctly in each part, then you are a JavaScript expert :)

January 28, 2013

HTML (HyperText Markup Language) Quiz

HTML5 is the upcoming HTML standard. It introduces a number of new features like built-in video support, geolocation, drawing and so on. It also integrates XHTML, CSS and JavaScript. Check your awareness of HTML5 with this short quiz which is created using HTML5. Each question has one best answer. Your score will always be visible in the bottom left. Please use the latest version of an A-class browser like Chrome, Firefox or Internet Explorer to view this post. The latest versions of these browsers already implement a lot of HTML5 features.

January 21, 2013

JavaScript Quiz Part 1

As you know, JavaScript is a very popular programming language used to create interactive websites. Also, much test automation is also written in JavaScript. Attempt this quiz to find out how well you know JavaScript and see how many questions you are able to answer correctly.

1. In javascript, what happens when two functions call each other recursively?
Javascript error
The two functions keep calling each other endlessly.
The recursive calls stop after some time.
The browser displays an alert asking the user to decide if the recursive calls should continue or not.

2. What is the result of applying an arithmetic operator on a string?
Javascript error
null
The program execution stops at the error.
NaN

3. How do you reduce the time it takes a javascript switch statement to execute?
Write all possible cases for the expression.
Write a break statement after every case.
Include a default.
Change the value of the expression within every case.

4. What is the difference between == and === operators in javascript?
There is no === operator in javascript.
There is no difference between the two.
== compares the value but === assigns first and then compares the value so it always returns true.
== compares only the value but === compares both the value and the datatype.

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.
All the extra parameters at the end are ignored.
All the parameters are turned undefined.
Javascript error
All the extra parameters at the beginning are ignored.

6. Which javascript loop runs at least once?
for loop
for in loop
while loop
do while loop

7. What is the result of running the following loop?
var i=1;
for(;;) {
if (i>5) {break;}
document.write(++i);
}
1234
12345
23456
Javascript error in the for statement

8. In javascript, what is the preferred way of creating just one instance of a user-defined object?
createObject function
Object constructor function
Object initializer
You cannot create user-defined objects in javascript

9. The concat method does which of the following tasks in javascript?
Creates a new array joining two or more existing arrays
Appends one array to another array
Appends one or more arrays to an array
Concatenates all the strings in the array elements

10. In javascript, the elements of an associative array can be referred by their number index. True or false?
true
false
Please now go to the Part 2 of this JavaScript Quiz by clicking here.

January 16, 2013

HTML and CSS Quiz Part 2

If you haven't done so, learn HTML, CSS and SEO first. Then attempt this second and final part of the quiz on HTML (HyperText Markup Language) and CSS (Cascading Style Sheets). If you have not answered the part 1 of this quiz, attempt that here first. Most of the questions below have just one correct answer. See how many of your answers are green :)

1. Which attribute(s) is used to define the size of a TEXTAREA?
size
rows, cols
height, width

2. Which input type is used to create a Browse button?
button
image
file

3. In CSS, which tag can be used to style multiple elements all at once?
<BODY>
<DIV>
<SPAN>

4. In CSS, which prefix is used before the class selector?
#
.
No prefix is required

5. Which of these CSS selectors for a paragraph is (are) INCORRECT?
p:first-line
p:last-line
p:first-child

6. Which position places an element down and left to its normal position?
fixed
absolute
relative

7. Which position places an element so that it stays in place even when the web page is scrolled?
fixed
absolute
relative

8. How are external stylesheets (styles applied to multiple web pages) written?
As regular HTML documents with <HTML>, <HEAD> <STYLE> and <BODY> tags
With only the <STYLE> tag
With only the specific styles

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?
The bottom most style is applied
The style defined within the web page is applied
The style defined in the external stylesheet is applied

10. Which of these attributes of a FORM tag is(are) INCORRECT?
action
target
post

January 13, 2013

HTML and CSS Quiz Part 1

HTML (HyperText Markup Language) and CSS (Cascading Style Sheets) are the fundamental building blocks of web pages. Learn HTML, CSS and SEO. Then attempt this quiz to see how well you understand these. Most of the questions have just one correct answer.