Вы находитесь на странице: 1из 12

Ans Question Option 1 Option 2

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

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

What is the language used for expressing scenario in


D 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?
Which of the following gem is required for accessing an
B 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?
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

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
D Why we use the tags for scenarios in Cucumber ? 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


A cucumber features cucumber features/all
project from command line?

C Where does the Cucumber execution starts from? step_definition hooks

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


A What is env.rb used for? 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

Which testing model is best suited for the BDD


B Waterfall Agile
framework?
What is the default feature for parameterizing your
D Excel CSV
scenario in Ruby?

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


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

This command is used to check the Ruby version


D ruby -vi ruby -c
installed.
Which file cannot be used to import data into Ruby
B 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+//

Which one of the following is not a valid String command reverse


B equal
in Ruby Cucumber?
The command used for enering data in a text field in
A .set .type
Ruby Cucumber?
Which command is used to check for the presence of an .exist
C .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

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

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

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

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


D Ruby
Test?

Features/ support file contains Features/ support file contains


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

How is the data seperated in a Scenario Outline in Ruby


C 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

Which of these is not an Environment variable present in RUBYLIBRARY


A 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

"-----" exercise the concept You write test cases and


D 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

"----" is an incremental and iterative software


A Agile Waterfall
development model
"----" is a framework for writing and executing high level
C Capybara Calabash
descriptions of your softwares 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 @Test @Scenario
in Ruby Cucumber?

Which of the following is the Object locator used for


B find_by_element find_element
finding objects through Selenium in Ruby Cucumber?

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
variable names.
a text

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


source web application Ruby on Rails is an automation
framework designed for Open source
framework for the Ruby 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
Which of the following is the correct syntax for implementing a implicit wait of objDriver.driver.manage.timeouts.implicit_
A
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?

Which of the following is the correct syntax for reports generation via cucumber features\Opencart.feature
D 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.for :firefox
Selenium WebDriver?
Which of the following is the correct syntax for declaring an implicit timeout objDriver.driver.manage.timeouts.implicit_
C 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"
$driver.open("http://10.207.182.108:81/o
D How can we open a Web URL in Ruby Cucumber?
pencart/")
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
Which of these commands is used to run a particular scenario from a feature
A 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
Which one of the following options is the correct form of writing a feature
D 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.implici objDriver.manage.timeouts.implicit_wai objDriver.manage.timeouts.implicit.wait=5
t_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.implici objDriver.manage.timeouts.implicit_wai objDriver.driver.manage.timeouts.implicit.wait=


t.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 because the value of "i" is not


Error for "i" not initialized Prints 0
increased

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

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


pencart/").click opencart/") rt/")
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 Error because "i" is not initialized
increased

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)

Вам также может понравиться