Ans Question Option 1 Option 2
Ans Question Option 1 Option 2
A Which of the following is the correct syntax for invoking a firefox Watir::Browser.new :firefox Watir::Browser.Launch :firefox
browser?
B What are the library files in Ruby/Cucumber called? JAR Utils
D What is the language used for expressing scenario in feature file? Java VB
C Which keyword is used to call a library file in your script? import include
B Which of the following gem is required for accessing an CSV file? signet csv
A What are the 2 files required to execute a Cucumber test features,step_definiton features,support
scenario?
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 the Cucumber tags are used to give
D Why we use the tags for scenarios in Cucumber ?
scenarios a scenario a layout
A What is the syntax of executing all the feature files in a project cucumber features cucumber features/all
from command line?
C Where does the Cucumber execution starts from? step_definition hooks
C "____" is the file extension for a ruby file cucumber? .feature .ruby
B Which testing model is best suited for the BDD framework? Waterfall Agile
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 can we a parameterize any input in the feature file in Ruby Write the parameter in single quotes Write the parameter in double
Cucumber? quotes
Which one of the following is used to select a checkbox in Ruby
C .set .select
Cucumber?
C Which of the following is not part of a "feature" file in Ruby Feature Scenario
Cucumber?
B Cucumber is used for "------------" Testing? System & Unit Testing System & Integration Testing
D Which of these we do NOT need to run a Cucumber Web Test? Gems Ruby
D What is cucumber.yml file in Ruby cucumber? It is used to write step definitions It is used to write features
A Command used for installing a Gem file gem install gemfile gem install gems
"???" 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
"-----" exercise the concept – “ You write test cases and then
D develop the product that suits them" BDD Gherkin
"-----" criteria for the feature can be defined as when The Product
C Owner, a Programmer and a Tester collaborate on system BDD TDD
behaviour.
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 find_by_element find_element
objects through Selenium in Ruby Cucumber?
Gems Lib
require call
Win32OLE yaml
uuidtools redcard
When Also
support,step_definitions feature,step_definition
| _
& $
Poltergeist Phantom
Ctrl+S Alt+S
Tags Drivers
@ %
support WebDriver
.rb .exe
Iterative V model
Concatenation L value
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
Watir Hooks
Features/ support file contains the Features/ support file contains the
scenario. scenario outline.
Pipe(||) And(&&)
RUBYPATH RUBYLIB_PREFIX
WATIR Excel
AfterStep BeforeStep
AfterStep BeforeStep
Require_Method() Watir
Acceptance Regression
Gherkin BDD
Iterative BDD
mspec nspec
@selenium @selenium-cucumber
find xpath
* %
AnsQuestion
Which of the following is the correct syntax for implementing a implicit wait of 5
A
seconds?
Which of the following is the correct syntax for command line execution of a feature
A
file named 'MyScript' assuming 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
A named 'MyScript' which has a tag named '@smoke' assuming we are at the project
folder in Command Prompt?
D Which of the following is the correct syntax for reports generation via command
prompt?
Which of the following is the correct syntax for invoking a browser using Selenium
A
WebDriver?
C Which of the following is the correct syntax for declaring an implicit timeout using
Selenium WebDriver?
A Which of these commands is used to run a particular scenario from a feature file?
What is missing in the following command used to generate report using Ruby
Cucumber?
B
D Which one of the followin is the correct way of reading data from a CSV file?
D Which one of the following options is the correct form of writing a feature file?
B
empdata={"Emp ID"=>"010","Name"=>"Kumar"}
puts empdata["Name"]
What is the output of the following code:
10.downto(7) do
puts "Hello"
A end
objDriver.driver.manage.timeouts.implicit_wait objDriver.driver.manage.timeouts.implicit_wait
=5 =5000
driver.link(:href="") driver.weblink(:href="")
driver.text_field(:name=>"") driver.text(:name=>"")
objDriver.driver.manage.timeouts.implicit_wait objDriver.driver.manage.timeouts.implicit.wait=
=5 5
driver.webbutton(:name=>"") driver.button(:name=>"")
driver.radio(:name=>"") driver.radio_button(:value=>"")
driver.select_list(:name=>"") driver.select(:name=>"")
$objBrowser.manage.max $objBrowser.manage.maximize
:name=>"";:class="" :name=>""+:class=>""
Parameters Step_definition
Prints the value of "i" 7 times Error for "i" not initialized
:name=> :link=>
$driver.open("http://10.207.182.108:81/openca $driver.link("http://10.207.182.108:81/opencart
rt/") /").click
Cucumber features –dryrun Cucumber features –dry-run
$objFile=File.Open("Path") $objFile=OpenFile("Path",'r')
|variable| |line|
-- --format
:xpath XPATH
foreach("path") do CSV.for("path") do
|row| |row|
puts row puts row
end end
objSheet=objExcel.workbooks.open("Path").wor objSheet=objExcel.open("Path").worksheets("Sh
ksheets("Sheet1") eet1")
Feature: Visit XYZ page in abc.com Feature: Visit XYZ page in abc.com
Scenario : Visit abc.com
Given: I am on abc.com
When: I click on XYZ page When: I click on XYZ 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
I click on login & I click on login
In End
In Begin
Error as END is preceding the BEGIN command
middle
hello hello
hello hello
hello
010 Kumar Kumar
Hello Hello
Hello Hello
Hello Hello
Hello Hello
Hello
Hello
Hello
objDriver.manage.timeouts.implicit_wait=5000 objDriver.manage.timeouts.implicit.wait=5
driver.link(:href=>"") driver.link(href=>"")
driver.text(name=>"") driver.text_field(:name="")
objDriver.driver.manage.timeouts.implicit.wait=
objDriver.manage.timeouts.implicit_wait=5
5000
driver.button(name=>"") driver.webbutton(:name="")
driver.radio(:value=>"") driver.radio_button(:name=>"")
driver.list(:name=>"") driver.selectlist(:name=>"")
$objBrowser.manage.window.maximize $objBrowser.driver.manage.window.maximize
:name=>""&:class=>"" :name=>"",:class=>""
Scenario TestCase
:value=> :id=>
$driver.run("http://10.207.182.108:81/opencart $driver.goto("http://10.207.182.108:81/openca
/") rt/")
Cucumber features dry-run Cucumber features –Dry-Run
$objFile=File.Open("Path",'r') $objFile=Open("Path",'r')
|arg| |nextarg|
:xpath=> :XPATH
CSV.foreach("path") CSV.foreach("path") do
|row| |row|
puts row puts row
end end
objSheet=objExcel.workbooks("Path").workshee
objSheet=objExcel.workbooks.open("Path")
ts("Sheet1")
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
When: I click on XYZ page When: I click on XYZ 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
*I click on login --I click on login
In Begin In End
middle middle
In END In Begin
Hello
Hello
Hello
Error as For/while is not implemented
Error because the value of "i" is not increased Error because "i" is not initialized
Hello - infinite times Error because the value of "i" is not increased