You are on page 1of 18

Ans Question Option 1 Option 2

A Which of the following is the correct syntax for invoking a Watir::Browser.new :firefox Watir::Browser.Launch :firefox
firefox browser?

B What are the library files in Ruby/Cucumber called? JAR Utils

D What is the language used for expressing scenario in Java VB


feature file?

C Which keyword is used to call a library file in your script? import include

Which of the following gem is required for accessing an


C XL extlib
Excel file?

B Which of the following gem is required for accessing an signet csv


CSV file?

D Which of the following is not a keyword in Cucumber? Given Then

A What are the 2 files required to execute a Cucumber test features,step_definiton features,support
scenario?

C Which symbol is used to separate columns in Scenario / \


Outline?
Which symbol is used as preffix to declare a variable as
D @ !
public?

D Which of the following is NOT a webDriver in Cucumber? Watir Selenium

A What is the shortut key to open setting in RubyMine IDE? Ctrl+Alt+S Ctrl+Shift+S

What are before, after, beforeStep and afterStep in


B support Hooks
Cucumber?

Cucumber tags are used to sort the Cucumber tags are used to give
D Why we use the tags for scenarios in Cucumber ? scenarios a scenario a layout

C What preffix is used for adding a tag to a scenario? $ &

A What is the syntax of executing all the feature files in a cucumber features cucumber features/all
project from command line?

C Where does the Cucumber execution starts from? step_definition hooks

A What is env.rb used for? It is used to load the required libraries It is used to load the scenarios
for cucumber scenario execution for execution

C "____" is the file extension for a ruby file cucumber? .feature .ruby

D BDD stands for? Behave Driven Design Behave Driven Development

D Which of the following is not a Agile methodology? Sprint Scrum

B Which testing model is best suited for the BDD Waterfall Agile
framework?
What is the default feature for parameterizing your
D Excel CSV
scenario in Ruby?

B "--------------" is the method available in Ruby Cucumber to Instrumentation Interpolation


use the value of a variable inside a string?

D This command is used to check the Ruby version installed. ruby -vi ruby -c

B Which file cannot be used to import data into Ruby Excel JS file
Cucumber?

B How do we define functions in Ruby Cucumber? _def  <function_name> def  <function_name>

C How do we comment a block of code in Ruby Cucumber? Shift+Ctrl+/ Shift+//


B Which one of the following is not a valid String command reverse equal
in Ruby Cucumber?
The command used for enering data in a text field in Ruby
A Cucumber? .set .type

C Which command is used to check for the presence of an .exist .ispresent


object in Ruby Cucumber?
C How do we "Rename" a file in Ruby Cucumber? Rename F2 key

D Shortcut for Running a Scenario in Ruby Cucumber? Shift+F5 Shift+F8

A Shortcut for Debugging a Scenario in Ruby Cucumber? Shift+F9 Shift+F11

B How can we a parameterize any input in the feature file in Write the parameter in single quotes Write the parameter in double
Ruby Cucumber? quotes
Which one of the following is used to select a checkbox in
C Ruby Cucumber? .set .select

C Which of the following is not part of a "feature" file in Feature Scenario


Ruby Cucumber?

B Cucumber is used for "------------" Testing? System & Unit Testing System & Integration Testing

A regular expression is a
A What is a Regular expression? A regular expression is a pattern pattern describing numbers
describing a certain amount of text only.

D Which of these we do NOT need to run a Cucumber Web Gems Ruby


Test?

A What does a features/support file contain? Features/ support file contains Features/ support file contains
supporting ruby code supporting cucumber code

C How is the data seperated in a Scenario Outline in Ruby Quotes("") Semi-colon(;)


Cucumber?

D What is cucumber.yml file in Ruby cucumber? It is used to write step definitions It is used to write features

Ruby on Rails is an open source web


Ruby on Rails is a Gem file in
C What is Ruby on Rails? application framework for the Ruby
Cucumber programming language

A Which of these is not an Environment variable present in RUBYLIBRARY RUBYOPT


Ruby Cucumber?

To call the superclass implementation To call the superclass of the


D What is the use of the "super" keyword in Ruby Rails? of the default method default method

A Command used for installing a Gem file gem install gemfile gem install gems

What is missing in the following line of code used to


B invoke the Excel Application in Ruby Cucumber? CSV WIN32OLE

objExcel=???.new("Excel.Application")
C "???" executes after the each step execution Before After
A "???" execute before the feature file execution Before After

"???" loads and processes the Ruby code from a separate


B file, including whatever classes, modules, methods, and env.rb Require()
constants are in that file into the current scope

D "-----" exercise the concept – “ You write test cases and BDD Gherkin
then develop the product that suits them"

"-----" criteria for the feature can be defined as when The


C Product Owner, a Programmer and a Tester collaborate BDD TDD
on system behaviour.
"-----" is a story testing approach.The functionalities
D written by the Business Analyst's triggers the testing Agile TDD
process

A "----" is an incremental and iterative software Agile Waterfall


development model

C "----" is a framework for writing and executing high level Capybara Calabash
descriptions of your software’s functionality.

D Which one of the following is not a specification file? spec rspec

C What is the tag used for writing a scenario for Selenium in @Test @Scenario
Ruby Cucumber?

Which of the following is the Object locator used for


B finding objects through Selenium in Ruby Cucumber? find_by_element find_element

Which prefix is used to use/call the steps from a pre-


D + &
defined scenario in Ruby Cucumber?
Option 3 Option 4
Watir:Browser.new :firefox Watir::Browser.Open :firefox

Gems Lib

.NET Gherkin Language

require call

Win32OLE yaml

uuidtools redcard

When Also

support,step_definitions feature,step_definition

| _

& $

Poltergeist Phantom

Ctrl+S Alt+S

Tags Drivers

Cucumber tags are used to filter the


Cucumber tags are used to
name the scenrios scenarios and execute the scenarios
based on tags.

@ %

cucumber/ run features cucumber/ run all

support WebDriver

It is used to run multiple It is used to create a log file


features together

.rb .exe

Behaviour Driven Design Behaviour Driven Development

Product Backlog BDD

Iterative V model

Text file Scenario Outline

Concatenation L value

ruby -version ruby -v

CSV file Property file

sub <function name> define <function name>

CTRL+/ ALT+/
starts_with size

.edit .set_field

.exist? .ispresent?

Refactor---->Rename Refactor--->Edit

F5 Shift+F10

Shift+F10 F9

Write the parameter after the Write the parameter as it is.


+ symbol

.click .check

Step_definition Scenario Outline

Unit & Integration Testing System,Unit &Integration Testing

A regular expression is an
encoding used for describing A regular expression is a pattern used for
a text variable names.

Watir Hooks

Features/ support file Features/ support file contains the


contains the scenario. scenario outline.

Pipe(||) And(&&)

It is used to write driver It is used to create a profile


settings

Ruby on Rails is an open


Ruby on Rails is an automation
source web application
framework for the Ruby framework designed for Open source
tools.
programming language

RUBYPATH RUBYLIB_PREFIX

To call the superclass of the To call the superclass implementation of


current method the current method

install gems gems install gemfile

WATIR Excel

AfterStep BeforeStep
AfterStep BeforeStep

Require_Method() Watir

Ruby Cucumber TDD

Acceptance Regression
Gherkin BDD

Iterative BDD

Cucumber Keyword Driven

mspec nspec

@selenium @selenium-cucumber

find xpath

* %
Ans Question Option 1
A Which of the following is the correct syntax for implementing a implicit wait of objDriver.driver.manage.timeouts.implicit_
5 seconds? wait=5

Which of the following is the correct syntax for command line execution of a
A feature file named 'MyScript' assuming we are at the project folder in cucumber features/MyScript.feature
Command Prompt?

Which of the following is the correct syntax for command line execution of a
A feature file named 'MyScript' which has a tag named '@smoke' assuming we cucumber features --tags @smoke
are at the project folder in Command Prompt?

D Which of the following is the correct syntax for reports generation via cucumber features\Opencart.feature --
command prompt? format html --out TestReport.html

C How do we identify a link in Ruby Cucmber? driver.link(:href="")


A How do we identify a Textbox in Ruby Cucmber? driver.text_field(:name=>"")
Which of the following is the correct syntax for invoking a browser using
A Selenium WebDriver? Selenium::WebDriver.for :firefox

C Which of the following is the correct syntax for declaring an implicit timeout objDriver.driver.manage.timeouts.implicit_
using Selenium WebDriver? wait=5
B How do we identify a WebElement(Button) in Ruby Cucumber? driver.webbutton(:name=>"")
C How do we identify a RadioButton in Ruby Cucmber? driver.radio(:name=>"")
A How do we identify a ComboBox in Ruby Cucmber? driver.select_list(:name=>"")

D How do we maximize a browser window in Ruby Cucumber? $objBrowser.manage.max

D How do we give multiple properties for an Object in Ruby Cucumber? :name=>"";:class=""

What is missing in the following code of Ruby Cucumber:

C Parameters

B Command used to execute a Cucumber profile? cucumber features -profile <profile_name>

What will be the outcome of the following code:


while i<7 do
B Prints the value of "i" 7 times
puts(i)
end
What is missing in the following code of Ruby Cucumber:
A :name=>
$driver.text_field("email").set "email"

D How can we open a Web URL in Ruby Cucumber? $driver.open("http://10.207.182.108:81/


opencart/")
B How do we do a Dry-run in Ruby Cucumber? Cucumber features –dryrun
C How do we open a Text file in Ruby Cucumber? $objFile=File.Open("Path")
What is missing in the following code for reading from a text file:
$objFile.each do
B ??? |variable|
puts line
end
A Which of these commands is used to run a particular scenario from a feature cucumber features/test.feature:21
file?
What is missing in the following command used to generate report using Ruby
Cucumber?
B --

cucumber features/Opencart.feature ??? html –out report.html


C Syntax for writing XPATH in Ruby Cucumber is? :xpath

foreach("path") do

D Which one of the followin is the correct way of reading data from a CSV file?
|row|
puts row
end
objSheet=objExcel.workbooks.open("Path")
A How do we open an Excel sheet through Ruby Cucumber?
.worksheets("Sheet1")
Feature: Visit XYZ page in abc.com
Scenario : Visit abc.com
D Which one of the following options is the correct form of writing a feature file?
When: I click on XYZ page
Then: I should see ABC page
Given: I am on abc.com
C Which one of the following is correct?
I click on login
What is the output of the following code: In End
END {puts "In End"} In Begin
C
BEGIN {puts "In Begin"} middle
puts "middle"
What is the output of the following code: double quoted 3
age=3 single quoted {age}
x="double quoted {age}"
B
y='single quoted {age}'
puts x
puts y
What is the output of the following code:
C message="Ruby Programming" Ruby Programming
puts message[0,message.length-4]
What is the output of the following code: hello
.3 times do hello
A
puts "hello" hello
end
What is the output of the following code:
i=10
D while i==10 Hello 10 (10 times)
puts "Hello {i}"
end
What is the output of the following code:

B 010 Kumar
B 010 Kumar
empdata={"Emp ID"=>"010","Name"=>"Kumar"}
puts empdata["Name"]
What is the output of the following code: Hello
10.downto(7) do Hello
puts "Hello" Hello
A end Hello

What is the output of the following code:


while i<10
D Hello -10 times
puts "Hello"
end
What is the output of the following code:
i=0
C while i<10 Hello -10 times
puts "Hello"
end
What is the output of the following code:
i=0
D while i==10 Hello -10 times
puts "Hello"
end
What is the output of the following code:
i=0
C while i=10 Hello -10 times
puts "Hello"
end
What is the output of the following code:
i=0
D while i=10 Hello 10 (10 times)
puts "Hello {i}"
end
Option 2 Option 3 Option 4
objDriver.driver.manage.timeouts.implic objDriver.manage.timeouts.implicit_wai objDriver.manage.timeouts.implicit.wait=5
it_wait=5000 t=5000

cucumber feature/MyScript.feature cucumber feature--MyScript.feature cucumber -- feature--MyScript.feature

cucumber features/tags @smoke cucumber features/@smoke cucumber features-- @smoke

cucumber features/Opencart.feature -- cucumber features-- Opencart.feature -- cucumber features/Opencart.feature --format


format html TestReport.html format html TestReport.html html --out TestReport.html

driver.weblink(:href="") driver.link(:href=>"") driver.link(href=>"")


driver.text(:name=>"") driver.text(name=>"") driver.text_field(:name="")

Selenium::WebDriver.Open :firefox Selenium::WebDriver.new :firefox Selenium:WebDriver.new :firefox

objDriver.driver.manage.timeouts.implic objDriver.manage.timeouts.implicit_wai objDriver.driver.manage.timeouts.implicit.wait=


it.wait=5 t=5 5000
driver.button(:name=>"") driver.button(name=>"") driver.webbutton(:name="")
driver.radio_button(:value=>"") driver.radio(:value=>"") driver.radio_button(:name=>"")
driver.select(:name=>"") driver.list(:name=>"") driver.selectlist(:name=>"")

$objBrowser.manage.maximize $objBrowser.manage.window.maximize $objBrowser.driver.manage.window.maximize

:name=>""+:class=>"" :name=>""&:class=>"" :name=>"",:class=>""

Step_definition Scenario TestCase

cucumber features -p <profile_name> cucumber features <profile_name> cucumber feature -p <profile_name>

Error for "i" not initialized Error because the value of "i" is not Prints 0
increased

:link=> :value=> :id=>

$driver.link("http://10.207.182.108:81/ $driver.run("http:// $driver.goto("http://10.207.182.108:81/


opencart/").click 10.207.182.108:81/opencart/") opencart/")
Cucumber features –dry-run Cucumber features dry-run Cucumber features –Dry-Run
$objFile=OpenFile("Path",'r') $objFile=File.Open("Path",'r') $objFile=Open("Path",'r')

|line| |arg| |nextarg|


cucumber features cucumber features/run features cucumber features/run all

--format -format --html format

XPATH :xpath=> :XPATH

CSV.for("path") do CSV.foreach("path") CSV.foreach("path") do

|row| |row| |row|


puts row puts row puts row
end end end
objSheet=objExcel.open("Path").worksh objSheet=objExcel.workbooks("Path").w
objSheet=objExcel.workbooks.open("Path")
eets("Sheet1") orksheets("Sheet1")
Feature: Visit XYZ page in abc.com Feature: Visit XYZ page in abc.com
Scenario : Visit abc.com Scenario : Visit abc.com
Given: I am on abc.com Given: I am on abc.com Given: I am on abc.com
When: I click on XYZ page When: I click on XYZ page When: I click on XYZ page
Then: I should see ABC page Then: I should see ABC page Then: I should see ABC page
Given: I am on abc.com Given: I am on abc.com Given: I am on abc.com
& I click on login *I click on login --I click on login
In Begin In End

Error as END is preceding the BEGIN middle middle


command In END In Begin

double quoted {age} double quoted 3 double quoted


single quoted {age} single quoted 3 single quoted

Syntax Error Ruby Program Ruby Programm

hello
hello Syntax Error as "for/while" is not hello
defined

Hello 0 (9 times) Hello {0} (infinite times) Hello {i} (infinite times)

Kumar Kumar 010 Errror


Kumar Kumar 010 Errror

Hello Hello
Hello Hello
Hello Hello
Hello Error as For/while is not implemented
Hello
Hello
Hello

Error because the value of "i" is not


Hello - 9 times increased Error because "i" is not initialized

Hello - 9 times Hello - infinite times Error because the value of "i" is not increased

Hello - 9 times Hello - infinite times No Output

Hello - 9 times Hello - infinite times No Output

Hello 0 (9 times) Hello {0} (infinite times) Hello {i} (infinite times)
Ans Question Option 1 Option 2
A Which of the following is the correct syntax for invoking a Watir::Browser.new :firefox Watir::Browser.Launch :firefo
firefox browser? x
B What are the library files in Ruby/Cucumber called? JAR Utils

D What is the language used for expressing scenario in feature Java VB


file?

C Which keyword is used to call a library file in your script? import include

Which of the following gem is required for accessing an Excel


C file? XL extlib

B Which of the following gem is required for accessing an CSV signet csv
file?
D Which of the following is not a keyword in Cucumber? Given Then

A What are the 2 files required to execute a Cucumber test features,step_definiton features,support
scenario?

C Which symbol is used to separate columns in Scenario Outline? / \

D Which symbol is used as preffix to declare a variable as public? @ !

D Which of the following is NOT a webDriver in Cucumber? Watir Selenium

A What is the shortut key to open setting in RubyMine IDE? Ctrl+Alt+S Ctrl+Shift+S

B What are before, after, beforeStep and afterStep in Cucumber? support Hooks

Cucumber tags are used to sort Cucumber tags are used to


D Why we use the tags for scenarios in Cucumber ?
the scenarios give a scenario a layout

C What preffix is used for adding a tag to a scenario? $ &


What is the syntax of executing all the feature files in a project cucumber features
A cucumber features/all
from command line?
C Where does the Cucumber execution starts from? step_definition hooks

It is used to load the required It is used to load the scenarios


A What is env.rb used for? libraries for cucumber scenario for execution
execution

C "____" is the file extension for a ruby file cucumber? .feature .ruby

D BDD stands for? Behave Driven Design Behave Driven Development

D Which of the following is not a Agile methodology? Sprint Scrum

B Which testing model is best suited for the BDD framework? Waterfall Agile

What is the default feature for parameterizing your scenario in


D Ruby? Excel CSV

"--------------" is the method available in Ruby Cucumber to use


B Instrumentation Interpolation
the value of a variable inside a string?

D This command is used to check the Ruby version installed. ruby -vi ruby -c

B Which file cannot be used to import data into Ruby Cucumber? Excel JS file

B How do we define functions in Ruby Cucumber? _def  <function_name> def  <function_name>

C How do we comment a block of code in Ruby Cucumber? Shift+Ctrl+/ Shift+//

B Which one of the following is not a valid String command in reverse equal
Ruby Cucumber?
A The command used for enering data in a text field in Ruby .set .type
Cucumber?

C Which command is used to check for the presence of an object .exist .ispresent
in Ruby Cucumber?
C How do we "Rename" a file in Ruby Cucumber? Rename F2 key
D Shortcut for Running a Scenario in Ruby Cucumber? Shift+F5 Shift+F8
A Shortcut for Debugging a Scenario in Ruby Cucumber? Shift+F9 Shift+F11

B How can we a parameterize any input in the feature file in Ruby Write the parameter in single Write the parameter in
Cucumber? quotes double quotes

C Which one of the following is used to select a checkbox in Ruby .set .select
Cucumber?
Which of the following is not part of a "feature" file in Ruby
C Cucumber? Feature Scenario

B Cucumber is used for "------------" Testing? System & Unit Testing System & Integration Testing

A regular expression is a A regular expression is a


A What is a Regular expression? pattern describing a certain pattern describing numbers
amount of text only.

D Which of these we do NOT need to run a Cucumber Web Test? Gems Ruby

Features/ support file contains Features/ support file


A What does a features/support file contain? supporting ruby code contains supporting
cucumber code

How is the data seperated in a Scenario Outline in Ruby


C Quotes("") Semi-colon(;)
Cucumber?
It is used to write step
D What is cucumber.yml file in Ruby cucumber? It is used to write features
definitions

Ruby on Rails is an open source


web application framework for Ruby on Rails is a Gem file in
C What is Ruby on Rails?
the Cucumber programming Ruby
language

A Which of these is not an Environment variable present in Ruby RUBYLIBRARY RUBYOPT


Cucumber?

To call the superclass


To call the superclass of the
D What is the use of the "super" keyword in Ruby Rails? implementation of the default
default method
method

A Command used for installing a Gem file gem install gemfile gem install gems
What is missing in the following line of code used to invoke the
B Excel Application in Ruby Cucumber? CSV WIN32OLE
objExcel=???.new("Excel.Application")
C "???" executes after the each step execution Before After
A "???" execute before the feature file execution Before After

"???" loads and processes the Ruby code from a separate file,
B including whatever classes, modules, methods, and constants env.rb Require()
are in that file into the current scope

D "-----" exercise the concept – “ You write test cases and then BDD Gherkin
develop the product that suits them"

"-----" criteria for the feature can be defined as when The


C Product Owner, a Programmer and a Tester collaborate on BDD TDD
system behaviour.

D "-----" is a story testing approach.The functionalities written by Agile TDD


the Business Analyst's triggers the testing process
A "----" is an incremental and iterative software development Agile Waterfall
model

C "----" is a framework for writing and executing high level Capybara Calabash
descriptions of your software’s functionality.
D Which one of the following is not a specification file? spec rspec

C What is the tag used for writing a scenario for Selenium in Ruby @Test @Scenario
Cucumber?
Which of the following is the Object locator used for finding
B objects through Selenium in Ruby Cucumber? find_by_element find_element

D Which prefix is used to use/call the steps from a pre-defined + &


scenario in Ruby Cucumber?
Option 3 Option 4
Watir:Browser.new :firefox Watir::Browser.Open :firefox

Gems Lib

.NET Gherkin Language

require call

Win32OLE yaml

uuidtools redcard

When Also

support,step_definitions feature,step_definition

| _

& $

Poltergeist Phantom

Ctrl+S Alt+S

Tags Drivers

Cucumber tags are used to filter


Cucumber tags are used to
the scenarios and execute the
name the scenrios
scenarios based on tags.

@ %

cucumber/ run features cucumber/ run all

support WebDriver

It is used to run multiple


features together It is used to create a log file

.rb .exe

Behaviour Driven Design Behaviour Driven Development

Product Backlog BDD

Iterative V model

Text file Scenario Outline

Concatenation L value

ruby -version ruby -v

CSV file Property file

sub <function name> define <function name>

CTRL+/ ALT+/

starts_with size
.edit .set_field

.exist? .ispresent?

Refactor---->Rename Refactor--->Edit
F5 Shift+F10
Shift+F10 F9
Write the parameter after the Write the parameter as it is.
+ symbol

.click .check

Step_definition Scenario Outline

Unit & Integration Testing System,Unit &Integration Testing

A regular expression is an
A regular expression is a pattern
encoding used for describing a used for variable names.
text

Watir Hooks

Features/ support file contains Features/ support file contains the


the scenario. scenario outline.

Pipe(||) And(&&)

It is used to write driver


It is used to create a profile
settings

Ruby on Rails is an open Ruby on Rails is an automation


source web application
framework designed for Open
framework for the Ruby
source tools.
programming language

RUBYPATH RUBYLIB_PREFIX

To call the superclass


To call the superclass of the
implementation of the current
current method
method

install gems gems install gemfile

WATIR Excel

AfterStep BeforeStep
AfterStep BeforeStep

Require_Method() Watir

Ruby Cucumber TDD

Acceptance Regression

Gherkin BDD
Iterative BDD

Cucumber Keyword Driven

mspec nspec

@selenium @selenium-cucumber

find xpath

* %

You might also like