0% found this document useful (0 votes)
95 views13 pages

Correct Answer Option 1 Option 2 Option 3 Option 4

Cucumber is a tool used for Behavior Driven Development (BDD) that allows automation of acceptance criteria in plain English. It uses the Gherkin language to define test scenarios in a readable way for both technical and non-technical audiences. Cucumber executes features and scenarios defined in Ruby code to automate tests and provide feedback.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
95 views13 pages

Correct Answer Option 1 Option 2 Option 3 Option 4

Cucumber is a tool used for Behavior Driven Development (BDD) that allows automation of acceptance criteria in plain English. It uses the Gherkin language to define test scenarios in a readable way for both technical and non-technical audiences. Cucumber executes features and scenarios defined in Ruby code to automate tests and provide feedback.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

Correct

Question Option 1 Option 2 Option 3 Option 4


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

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

What is the language used for expressing scenario in
D Java VB .NET Gherkin Language
feature file?

Which of the following is the correct syntax for objDriver.driver.manage.timeouts.impli objDriver.driver.manage.timeo objDriver.manage.timeouts.implic objDriver.manage.timeouts.


A
implementing a implicit wait of 5 seconds? cit_wait=5 uts.implicit_wait=5000 it_wait=5000 implicit.wait=5

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

Which of the following gem is required for accessing an
C XL extlib Win32OLE yaml
Excel file?
Which of the following gem is required for accessing an CSV
B signet csv uuidtools redcard
file?

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

What are the 2 files required to execute a Cucumber test
A features,step_definiton features,support support,step_definitions feature,step_definition
scenario?
Which symbol is used to separate columns in Scenario
C / \ | _
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 Poltergeist Phantom

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

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

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

Which of the following is the correct syntax for command
line execution of a feature file named 'MyScript' which has cucumber features/tags cucumber features--
A cucumber features --tags @smoke cucumber features/@smoke
a tag named '@smoke'  assuming we are at the project @smoke @smoke
folder in Command Prompt?
cucumber
cucumber cucumber features--
Which of the following is the correct syntax for reports cucumber features\Opencart.feature -- features/Opencart.feature --
D features/Opencart.feature -- Opencart.feature --format html
generation via command prompt? format html --out TestReport.html format html --out
format html TestReport.html TestReport.html
TestReport.html

Cucumber tags are used to
Cucumber tags are used to sort the Cucumber tags are used to Cucumber tags are used to name filter the scenarios and
D Why we use the tags for scenarios in Cucumber ?
scenarios give a scenario a layout the scenrios execute the scenarios
based on tags.

C What preffix is used for adding a tag to a scenario? $ & @ %
What is the syntax of executing all the feature files in a
A cucumber features cucumber features/all cucumber/ run features cucumber/ run all
project from command line?
C Where does the Cucumber execution starts from? step_definition hooks support WebDriver

It is used to load the required libraries It is used to load the scenarios It is used to run multiple features


A What is env.rb used for? It is used to create a log file
for cucumber scenario execution for execution together

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

Behaviour Driven
D BDD stands for? Behave Driven Design Behave Driven Development Behaviour Driven Design
Development
D Which of the following is not a Agile methodology? Sprint Scrum Product Backlog BDD

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

What is the default feature for parameterizing your
D Excel CSV Text file Scenario Outline
scenario in Ruby?

"--------------" is the method available in Ruby Cucumber to
B Instrumentation Interpolation Concatenation L value
use the value of a variable inside a string?

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

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

A How do we identify a Textbox in Ruby Cucmber? driver.text_field(:name=>"") driver.text(:name=>"") driver.text(name=>"") driver.text_field(:name="")

Which of the following is the correct syntax for invoking a Selenium::WebDriver.Open Selenium:WebDriver.new


A Selenium::WebDriver.for :firefox Selenium::WebDriver.new :firefox
browser using Selenium WebDriver? :firefox :firefox

Which of the following is the correct syntax for declaring an objDriver.driver.manage.timeouts.impli objDriver.driver.manage.timeo objDriver.manage.timeouts.implic objDriver.driver.manage.ti


C
implicit timeout using Selenium WebDriver? cit_wait=5 uts.implicit.wait=5 it_wait=5 meouts.implicit.wait=5000

How do we identify a WebElement(Button) in Ruby driver.webbutton(:name=""
B driver.webbutton(:name=>"") driver.button(:name=>"") driver.button(name=>"")
Cucumber? )
driver.radio_button(:value=>"" driver.radio_button(:name=
C How do we identify a RadioButton in Ruby Cucmber? driver.radio(:name=>"") driver.radio(:value=>"")
) >"")

A How do we identify a ComboBox in Ruby Cucmber? driver.select_list(:name=>"") driver.select(:name=>"") driver.list(:name=>"") driver.selectlist(:name=>"")

How do we maximize a browser window in Ruby $objBrowser.manage.maximiz $objBrowser.manage.window.ma $objBrowser.driver.manage


D $objBrowser.manage.max
Cucumber? e ximize .window.maximize
Which file cannot be used to import data into Ruby
B Excel JS file CSV file Property file
Cucumber?
B How do we define functions in Ruby Cucumber? _def  <function_name> def  <function_name> sub <function name> define <function name>

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

Which one of the following is not a valid String command in
B reverse equal starts_with size
Ruby Cucumber?
The command used for enering data in a text field in Ruby
A .set .type .edit .set_field
Cucumber?
Which command is used to check for the presence of an
C .exist .ispresent .exist? .ispresent?
object in Ruby Cucumber?

C How do we "Rename" a file in Ruby Cucumber? Rename F2 key Refactor---->Rename Refactor--->Edit

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

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

How can we a parameterize any input in the feature file in Write the parameter in double Write the parameter after the +


B Write the parameter in single quotes Write the parameter as it is.
Ruby Cucumber? quotes symbol
Which one of the following is used to select a checkbox in
C .set .select .click .check
Ruby Cucumber?
How do we give multiple properties for an Object in Ruby
D :name=>"";:class="" :name=>""+:class=>"" :name=>""&:class=>"" :name=>"",:class=>""
Cucumber?
Which of the following is not part of a "feature" file in Ruby
C Feature Scenario Step_definition Scenario Outline
Cucumber?
System,Unit &Integration
B Cucumber is used for "------------" Testing? System & Unit Testing System & Integration Testing Unit & Integration Testing
Testing
A regular expression is a A regular expression is an A regular expression is a
A regular expression is a pattern
A What is a Regular expression? pattern describing numbers encoding used for describing a pattern used for variable
describing a certain amount of text
only. text names.
Which of these we do NOT need to run a Cucumber Web
D Gems Ruby Watir Hooks
Test?
Features/ support file
Features/ support file contains Features/ support file contains Features/ support file contains the
A What does a features/support file contain? contains the scenario
supporting ruby code supporting cucumber code scenario.
outline.
How is the data seperated in a Scenario Outline in Ruby
C Quotes("") Semi-colon(;) Pipe(||) And(&&)
Cucumber?
What is missing in the following code of Ruby Cucumber:
Feature: Visit XYZ page in abc.com

C Parameters Step_definition Scenario TestCase


Given:  I am on abc.com
When:  I click on XYZ page
Then:  I should see ABC page

cucumber features -profile cucumber features -p cucumber features cucumber feature -p


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

D What is cucumber.yml file in Ruby cucumber? It is used to write step definitions It is used to write features It is used to write driver settings It is used to create a profile

Ruby on Rails is an
Ruby on Rails is an open source web Ruby on Rails is an open source
Ruby on Rails is a Gem file in automation framework
C What is Ruby on Rails? application framework for the web application framework for
Ruby designed for Open source
Cucumber programming language the Ruby programming language
tools.
Which of these is not an Environment variable present in
A RUBYLIBRARY RUBYOPT RUBYPATH RUBYLIB_PREFIX
Ruby Cucumber?
To call the superclass
To call the superclass implementation To call the superclass of the To call the superclass of the
D What is the use of the "super" keyword in Ruby Rails? implementation of the
of the default method default method current method
current method
What will be the outcome of the following code:
while i<7 do Error because the value of "i" is
B Prints the value of "i" 7 times Error for "i" not initialized Prints 0
    puts(i) not increased
  end

What is missing in the following code of Ruby Cucumber:
A :name=> :link=> :value=> :id=>
$driver.text_field("email").set "email"

$driver.open("http://10.207.182.108:8 $driver.link("http://10.207.182 $driver.run("http://10.207.182.10 $driver.goto("http://10.207


D How can we open a Web URL in Ruby Cucumber?
1/opencart/") .108:81/opencart/").click 8:81/opencart/") .182.108:81/opencart/")

Cucumber features –Dry-
B How do we do a Dry-run in Ruby Cucumber? Cucumber features –dryrun Cucumber features –dry-run Cucumber features dry-run
Run

C How do we open a Text file in Ruby Cucumber? $objFile=File.Open("Path") $objFile=OpenFile("Path",'r') $objFile=File.Open("Path",'r') $objFile=Open("Path",'r')

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


What is missing in the following code for reading from a
text file:
$objFile.each do
B   ??? |variable| |line| |arg| |nextarg|
  puts line
end
Which of these commands is used to run a particular
A cucumber features/test.feature:21 cucumber features cucumber features/run features cucumber features/run all
scenario from a feature file?
What is missing in the following command used to generate
report using Ruby Cucumber?
B  --  --format  -format  --html format
cucumber features/Opencart.feature ??? html –out
report.html
C Syntax for writing XPATH in Ruby Cucumber is? :xpath XPATH :xpath=> :XPATH
foreach("path") do CSV.for("path") do CSV.foreach("path") CSV.foreach("path") do
Which one of the followin is the correct way of reading data   |row|   |row|   |row|   |row|
D
from a CSV file?   puts row   puts row   puts row   puts row
end end end end
What is missing in the following line of code used to invoke
B the Excel Application in Ruby Cucumber? CSV WIN32OLE WATIR Excel
objExcel=???.new("Excel.Application")

objSheet=objExcel.workbooks.open("P objSheet=objExcel.open("Path objSheet=objExcel.workbooks("Pa objSheet=objExcel.workboo


A How do we open an Excel sheet through Ruby Cucumber?
ath").worksheets("Sheet1") ").worksheets("Sheet1") th").worksheets("Sheet1") ks.open("Path")

Feature: Visit XYZ page in
Feature: Visit XYZ page in
Feature: Visit XYZ page in abc.com abc.com
abc.com
Scenario : Visit abc.com Scenario : Visit abc.com Scenario : Visit abc.com
Which one of the following options is the correct form of
D Given:  I am on abc.com Given:  I am on abc.com
writing a feature file? Given:  I am on abc.com
When:  I click on XYZ page 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
Then:  I should see ABC page
page

Given:  I am on abc.com Given:  I am on abc.com Given:  I am on abc.com Given:  I am on abc.com


C Which one of the following is  correct?
I click on login & I click on login *I click on login  --I click on login
C "???" executes after the each step execution Before After AfterStep BeforeStep
A "???" execute before the feature file execution Before After AfterStep BeforeStep

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

"-----" exercise the concept – “ You write test cases and
D BDD Gherkin Ruby Cucumber TDD
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 on BDD TDD Acceptance Regression
system behaviour.
"-----"  is a story testing approach.The functionalities
written by the Business Analyst's triggers the testing
D Agile TDD Gherkin BDD
process

"----" is an incremental and iterative software development
A Agile Waterfall Iterative BDD
model
"----" is a framework for writing and executing high level
C descriptions of your software’s functionality. Capybara Calabash Cucumber Keyword Driven

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

What is the output of the following code:
In End In Begin In End
END {puts "In End"} Error as END is preceding the
C In Begin middle middle
BEGIN {puts "In Begin"} BEGIN command
middle In END In Begin
puts "middle"
What is the output of the following code:
age=3
x="double quoted {age}" double quoted 3 double quoted {age} double quoted 3 double quoted
B
y='single quoted {age}' single quoted {age} single quoted {age} single quoted 3 single quoted
puts x
puts y
What is the output of the following code:
C message="Ruby Programming" Ruby Programming Syntax Error Ruby Program Ruby Programm
puts message[0,message.length-4]
What is the output of the following code:
hello
.3 times do hello Syntax Error as "for/while" is not
A hello hello
  puts "hello" hello defined
hello
end
What is the tag used for writing a scenario for Selenium in
C  @Test  @Scenario  @selenium  @selenium-cucumber
Ruby Cucumber?

Which of the following is the Object locator used for finding
B find_by_element find_element find xpath
objects through Selenium in Ruby Cucumber?

Which prefix is used to use/call the steps from a pre-
D  + & * %
defined scenario in Ruby Cucumber?
What is the output of the following code:
i=10
while i==10
D Hello 10 (10 times) Hello 0 (9 times) Hello {0} (infinite times) Hello {i} (infinite times)
  puts "Hello {i}"
end
What is the output of the following code:

B empdata={"Emp ID"=>"010","Name"=>"Kumar"} 010 Kumar Kumar Kumar 010 Errror


puts empdata["Name"]

Hello
What is the output of the following code: Hello Hello
10.downto(7) do Hello Hello Hello
Error as For/while is not
A   puts "Hello" Hello Hello Hello
implemented
end Hello Hello Hello
Hello
Hello
What is the output of the following code:
while i<10
Error because the value of "i" is Error because "i" is not
D   puts "Hello" Hello -10 times Hello - 9 times
not increased initialized
end

What is the output of the following code:
i=0
while i<10 Error because the value of
C Hello -10 times Hello - 9 times Hello - infinite times
  puts "Hello" "i" is not increased
end

What is the output of the following code:
i=0
while i==10
D Hello -10 times Hello - 9 times Hello - infinite times No Output
  puts "Hello"
end

What is the output of the following code:
i=0
while i=10
C Hello -10 times Hello - 9 times Hello - infinite times No Output
  puts "Hello"
end

What is the output of the following code:
i=0
while i=10
D Hello 10 (10 times) Hello 0 (9 times) Hello {0} (infinite times) Hello {i} (infinite times)
  puts "Hello {i}"
end

You might also like