selenium-cucumber 0.0.9 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. data/Example/features/assertion_steps_Ex.feature +121 -0
  2. data/Example/features/click_steps_Ex.feature +28 -0
  3. data/Example/features/configuration_step_Ex.feature +9 -0
  4. data/Example/features/input_steps_Ex.feature +87 -0
  5. data/Example/features/javascript_steps_Ex.feature +19 -0
  6. data/Example/features/navigation_steps_Ex.feature +45 -0
  7. data/Example/features/new.feature +7 -0
  8. data/Example/features/progress_step_Ex.feature +18 -0
  9. data/Example/features/screenshot_step_Ex.feature +11 -0
  10. data/Example/features/step_definitions/custom_steps.rb +14 -0
  11. data/Example/features/support/env.rb +38 -0
  12. data/Example/features/support/hooks.rb +34 -0
  13. data/Example/run_features.rb +40 -0
  14. data/Example/test_page.html +206 -0
  15. data/bin/generate.rb +20 -20
  16. data/bin/helper.rb +50 -50
  17. data/bin/selenium-cucumber +26 -26
  18. data/doc/canned_steps.md +479 -463
  19. data/doc/installation.md +16 -16
  20. data/doc/selenium-cucumber-API.md +81 -81
  21. data/doc/selenium-cucumber-help.md +18 -18
  22. data/features-skeleton/my_first.feature +5 -5
  23. data/features-skeleton/step_definitions/custom_steps.rb +4 -4
  24. data/features-skeleton/support/env.rb +38 -38
  25. data/features-skeleton/support/hooks.rb +33 -33
  26. data/lib/selenium-cucumber.rb +2 -2
  27. data/lib/selenium-cucumber/assertion_steps.rb +7 -2
  28. data/lib/selenium-cucumber/click_elements_steps.rb +7 -0
  29. data/lib/selenium-cucumber/methods/assertion_methods.rb +74 -24
  30. data/lib/selenium-cucumber/methods/click_elements_methods.rb +7 -2
  31. data/lib/selenium-cucumber/methods/configuration_methods.rb +1 -0
  32. data/lib/selenium-cucumber/methods/navigate_methods.rb +22 -32
  33. data/lib/selenium-cucumber/methods/required_files.rb +2 -0
  34. data/lib/selenium-cucumber/navigation_steps.rb +8 -0
  35. data/lib/selenium-cucumber/progress_steps.rb +2 -2
  36. data/lib/selenium-cucumber/version.rb +1 -1
  37. metadata +27 -45
@@ -0,0 +1,40 @@
1
+ #!/usr/bin/env ruby
2
+ require 'selenium-webdriver'
3
+
4
+ OS=Selenium::WebDriver::Platform.os
5
+
6
+ if ENV["OUTPUT"]=="html"
7
+
8
+ puts "\n\n\t###### Running all features on firefox browser ###### \n\n"
9
+ puts "Output result stored in \"result_firefox.html\""
10
+ system("cucumber -f html -o result_firefox.html")
11
+
12
+ puts "\n\n\t###### Running all features on chrome browser ###### \n\n"
13
+ puts "Output result stored in \"result_chrome.html\""
14
+ system("cucumber BROWSER=chrome -f html -o result_chrome.html")
15
+
16
+ if OS.to_s=="windows"
17
+ puts "\n\n\t###### Running all features on internet explorer browser ###### \n\n"
18
+ puts "Output result stored in \"result_ie.html\""
19
+ system("cucumber BROWSER=ie -f html -o result_ie.html")
20
+ else
21
+ puts "\n\n\t###### Running all features on safari browser ###### \n\n"
22
+ puts "Output result stored in \"result_safari.html\""
23
+ system("cucumber BROWSER=safari -f html -o result_safari.html")
24
+ end
25
+ else
26
+
27
+ puts "\n\n\t###### Running all features on firefox browser ######\n\n"
28
+ system("cucumber")
29
+
30
+ puts "\n\n\t###### Running all features on chrome browser ###### \n\n"
31
+ system("cucumber BROWSER=chrome")
32
+
33
+ if OS.to_s=="windows"
34
+ puts "Running all features on internet explorer browser ###### \n\n"
35
+ system("cucumber BROWSER=ie")
36
+ else
37
+ puts "Running all features on safari browser ###### \n\n"
38
+ system("cucumber BROWSER=safari")
39
+ end
40
+ end
@@ -0,0 +1,206 @@
1
+
2
+ <html lang="en">
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5
+ <title>Test Page for selenium-cucumber</title>
6
+
7
+ <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
8
+
9
+ <script type="text/javascript">
10
+ $(function() {
11
+ $("#hiddenElement").hide();
12
+ setTimeout(function() { $("#hiddenElement").fadeIn(1500); }, 10000)
13
+ setTimeout(function() { $("#disabledBt").removeAttr("disabled");}, 20000)
14
+ })
15
+
16
+ </script>
17
+
18
+ <style>
19
+ a:hover
20
+ {
21
+ background-color:yellow;
22
+ }
23
+ </style
24
+ >
25
+ </head>
26
+ <body>
27
+
28
+ <form id="frm" action="" method="post">
29
+
30
+
31
+ <fieldset>
32
+ <legend class="form_name">Simple sample form with input elements</legend>
33
+
34
+ <p>
35
+ <label for="dummy0">Text input (first name)</label><br>
36
+ <input type="text" class="fname_class" name="fname_name" id="f_name" value="">
37
+ </p>
38
+
39
+ <p>
40
+ <label for="dummy1">Text input (last name)</label><br>
41
+ <input type="text" class="lname_class" id="l_name" name="lname_name" value="">
42
+ </p>
43
+
44
+ <p>
45
+ <label for="dummy1">Disabled field</label><br>
46
+ <input type="text" class="df_class" id="df_id" name="df_name" value="" disabled>
47
+ </p>
48
+
49
+ <p>
50
+ <label for="dummy2">Textarea (address)</label><br>
51
+ <textarea name="dummy2" id="address" class="address_class" rows="3" cols="20" value=""></textarea>
52
+ </p>
53
+
54
+ <p>
55
+ <label for="dummy3">A password field (password)</label><br>
56
+ <input type="password" class="cls_pwd" id="pwd" name="nm_pwd" value="">
57
+ </p>
58
+
59
+ <p>
60
+ <label for="dummy4">radio button group (Gender)</label><br>
61
+ <input type="radio" name="radio_gender" value="M">Male</input>
62
+ <input type="radio" name="radio_gender" value="F">Female</input>
63
+ </p>
64
+
65
+ <p>
66
+ <input type="submit" value="Submit" id="submit" name="btn_submit" >
67
+ <input type="reset" value="Reset" id="reset" name="btn_reset">
68
+ <input type="button" value="disabledBt" id="disabledBt_id" name="disabledBt_name" disabled>
69
+ </p>
70
+
71
+ </fieldset>
72
+ </form>
73
+
74
+ </br>
75
+
76
+ <fieldset>
77
+ <legend>Multiselect dropdown</legend>
78
+ <p>
79
+ <select name="cars" multiple>
80
+ <option value="volvo">Volvo</option>
81
+ <option value="saab">Saab</option>
82
+ <option value="opel">Opel</option>
83
+ <option value="audi">Audi</option>
84
+ </select>
85
+ </p>
86
+ </fieldset></br>
87
+
88
+ <fieldset>
89
+ <legend>Dropdown lists</legend>
90
+ <p>
91
+ <label for="dummy3">Select field</label><br>
92
+ <select id="dropdownList1" name="name_select1" value="Please select your choice select">
93
+ <option value="s1">Select_1</option>
94
+ <option value="s2">Select_2</option>
95
+ <option value="s3" selected>Select_3</option>
96
+ <option value="s4">Select_4</option>
97
+ <option value="s5">Select_5</option>
98
+ </select>
99
+ </p>
100
+ </fieldset>
101
+
102
+ </br>
103
+
104
+ <fieldset>
105
+ <legend>Radio Buttons </legend>
106
+ <p>
107
+ <input type="radio" id="rdb1" name="rdb1_name" class="rdb1_class" checked> Radio one<br>
108
+ <input type="radio" id="rdb2" name="rdb2_name" class="rdb2_class"> Radio two<br>
109
+ <input type="radio" id="rdb3" name="rdb3_name" class="rdb3_class"> Radio three<br>
110
+ <input type="radio" id="rdb4" name="rdb4_name" class="rdb4_class"> Radio four<br>
111
+ <input type="radio" id="rdb5" name="rdb5_name" class="rdb5_class" checked> Radio five<br>
112
+ </p>
113
+ </fieldset>
114
+
115
+ </br>
116
+
117
+ <fieldset>
118
+ <legend>Checkbox </legend>
119
+ <p>
120
+ <input type="checkbox" id="chk1" name="chk1_name" class="chk1_class" checked> Check one<br>
121
+ <input type="checkbox" id="chk2" name="chk2_name" class="chk2_class"> Check two<br>
122
+ <input type="checkbox" id="chk3" name="chk3_name" class="chk3_class"> Check three<br>
123
+ <input type="checkbox" id="chk4" name="chk4_name" class="chk4_class"> Check four<br>
124
+ <input type="checkbox" id="chk5" name="chk5_name" class="chk5_class" checked> Check five<br>
125
+ </p>
126
+ </fieldset>
127
+
128
+ </br>
129
+
130
+
131
+ <fieldset>
132
+ <legend>Display element after 10 sec</legend>
133
+ <div id="hiddenElement" name="he_name" class="he_class">This showed after 10 sec</div>
134
+ </fieldset>
135
+
136
+ </br>
137
+ <fieldset>
138
+ <legend>Enable Button after 10 sec</legend>
139
+ <input type="button" value="Button" id="disabledBt" onclick="showText()" disabled>
140
+ <p id="msg"></p>
141
+
142
+ <script>
143
+ function showText()
144
+ {
145
+ document.getElementById("msg").innerHTML = "Now button is enabled";
146
+ }
147
+ </script>
148
+ </fieldset>
149
+
150
+ </br>
151
+
152
+ <fieldset>
153
+ <legend>Images</legend>
154
+ <img id="img1" src="http://shared.ooyala.com.s3.amazonaws.com/dropshadow-flower-pink.png" alt="Image one" style="display:inline-block;">
155
+ </fieldset>
156
+
157
+ </br>
158
+
159
+ <fieldset>
160
+ <legend>Links</legend>
161
+ <p>
162
+ <a href="https://rubygems.org/gems/selenium-cucumber">selenium-cucumber gem</a> <br>
163
+ <a href="http://seleniumcucumber.wordpress.com/" onclick="window.open('http://seleniumcucumber.wordpress.com/', 'newwindow', 'width=500, height=500'); return false;">selenium-cucumber website</a> <br>
164
+ <a href="https://github.com/sameer49/selenium-cucumber/blob/master/doc/canned_steps.md">Predefined-steps</a>
165
+ </p>
166
+ </fieldset>
167
+
168
+ </br>
169
+
170
+ <fieldset>
171
+ <legend>Javascript alert</legend>
172
+ <p name="javascript_alert_msg">Click the button to display a confirm box.</p>
173
+ <button id="try_it" onclick="callAlert()">Try it</button>
174
+ <p id="demo">this is demo line</p>
175
+
176
+ <script>
177
+ function callAlert()
178
+ {
179
+ var x;
180
+ if (confirm("Press a button!") == true)
181
+ x = "You pressed OK!";
182
+ else
183
+ x = "You pressed Cancel!";
184
+ document.getElementById("demo").innerHTML = x;
185
+ }
186
+ </script>
187
+ </p>
188
+ </fieldset>
189
+
190
+ <fieldset>
191
+ <legend>Double click here</legend>
192
+ <p id="dbClick" ondblclick="doubleClick()">Double-click this paragraph to trigger a function.</p>
193
+
194
+ <p id="demo2" name="demo2_name"></p>
195
+
196
+ <script>
197
+ function doubleClick() {
198
+ document.getElementById("demo2").innerHTML = "Hello World";
199
+ }
200
+ </script>
201
+ </p>
202
+ </fieldset>
203
+
204
+ </body>
205
+ </html>
206
+
data/bin/generate.rb CHANGED
@@ -1,20 +1,20 @@
1
-
2
- def selenium_cucumber_scaffold
3
- if File.exists?(@features_dir)
4
- puts "A features directory already exists. Stopping..."
5
- exit 1
6
- end
7
- msg("Question") do
8
- puts "I'm about to create a subdirectory called features."
9
- puts "features will contain all your project tests."
10
- puts "Please hit return to confirm that's what you want."
11
- end
12
- exit 2 unless STDIN.gets.chomp == ''
13
-
14
- FileUtils.cp_r(@source_dir, @features_dir)
15
-
16
- msg("Info") do
17
- puts "features subdirectory created. \n"
18
- end
19
-
20
- end
1
+
2
+ def selenium_cucumber_scaffold
3
+ if File.exists?(@features_dir)
4
+ puts "A features directory already exists. Stopping..."
5
+ exit 1
6
+ end
7
+ msg("Question") do
8
+ puts "I'm about to create a subdirectory called features."
9
+ puts "features will contain all your project tests."
10
+ puts "Please hit return to confirm that's what you want."
11
+ end
12
+ exit 2 unless STDIN.gets.chomp == ''
13
+
14
+ FileUtils.cp_r(@source_dir, @features_dir)
15
+
16
+ msg("Info") do
17
+ puts "features subdirectory created. \n"
18
+ end
19
+
20
+ end
data/bin/helper.rb CHANGED
@@ -1,51 +1,51 @@
1
- require 'tempfile'
2
- require 'json'
3
- require "rubygems"
4
-
5
- def msg(title, &block)
6
- puts "\n" + "-"*10 + title + "-"*10
7
- block.call
8
- puts "-"*10 + "-------" + "-"*10 + "\n"
9
- end
10
-
11
- def print_usage
12
- puts <<EOF
13
-
14
- Usage: selenium-cucumber <command-name> [parameters] [options]
15
-
16
- <command-name> can be one of
17
- help
18
- prints more detailed help information.
19
- gen
20
- generate a features folder structure.
21
- version
22
- prints the gem version
23
-
24
- <options> can be
25
- -v, --verbose Turns on verbose logging
26
- EOF
27
- end
28
-
29
- def print_help
30
- puts <<EOF
31
-
32
- Usage: selenium-cucumber <command-name> [parameters] [options]
33
-
34
- <command-name> can be one of
35
- help
36
- gen
37
- version
38
-
39
- Commands:
40
- help : prints more detailed help information.
41
-
42
- gen : creates a skeleton features dir. This is usually used once when
43
- setting up selnium-cucumber to ensure that the features folder contains
44
- the right step definitions and environment to run with cucumber.
45
-
46
- version : prints the gem version
47
-
48
- <Options>
49
- -v, --verbose Turns on verbose logging
50
- EOF
1
+ require 'tempfile'
2
+ require 'json'
3
+ require "rubygems"
4
+
5
+ def msg(title, &block)
6
+ puts "\n" + "-"*10 + title + "-"*10
7
+ block.call
8
+ puts "-"*10 + "-------" + "-"*10 + "\n"
9
+ end
10
+
11
+ def print_usage
12
+ puts <<EOF
13
+
14
+ Usage: selenium-cucumber <command-name> [parameters] [options]
15
+
16
+ <command-name> can be one of
17
+ help
18
+ prints more detailed help information.
19
+ gen
20
+ generate a features folder structure.
21
+ version
22
+ prints the gem version
23
+
24
+ <options> can be
25
+ -v, --verbose Turns on verbose logging
26
+ EOF
27
+ end
28
+
29
+ def print_help
30
+ puts <<EOF
31
+
32
+ Usage: selenium-cucumber <command-name> [parameters] [options]
33
+
34
+ <command-name> can be one of
35
+ help
36
+ gen
37
+ version
38
+
39
+ Commands:
40
+ help : prints more detailed help information.
41
+
42
+ gen : creates a skeleton features dir. This is usually used once when
43
+ setting up selnium-cucumber to ensure that the features folder contains
44
+ the right step definitions and environment to run with cucumber.
45
+
46
+ version : prints the gem version
47
+
48
+ <Options>
49
+ -v, --verbose Turns on verbose logging
50
+ EOF
51
51
  end
@@ -1,26 +1,26 @@
1
- #!/usr/bin/env ruby
2
-
3
- require_relative 'helper.rb'
4
- require_relative 'generate.rb'
5
- require 'selenium-cucumber/version'
6
-
7
- @features_dir = File.join(FileUtils.pwd, "features")
8
- @support_dir = File.join(@features_dir, "support")
9
- @source_dir = File.join(File.dirname(__FILE__), '..', 'features-skeleton')
10
-
11
- if (ARGV.length == 0)
12
- print_usage
13
- else
14
- cmd = ARGV.shift
15
-
16
- if cmd == "help"
17
- print_help
18
- elsif cmd == "gen"
19
- selenium_cucumber_scaffold
20
- elsif cmd == "version"
21
- puts Selenium::Cucumber::VERSION
22
- else
23
- print_usage
24
- end
25
- end
26
-
1
+ #!/usr/bin/env ruby
2
+
3
+ require_relative 'helper.rb'
4
+ require_relative 'generate.rb'
5
+ require 'selenium-cucumber/version'
6
+
7
+ @features_dir = File.join(FileUtils.pwd, "features")
8
+ @support_dir = File.join(@features_dir, "support")
9
+ @source_dir = File.join(File.dirname(__FILE__), '..', 'features-skeleton')
10
+
11
+ if (ARGV.length == 0)
12
+ print_usage
13
+ else
14
+ cmd = ARGV.shift
15
+
16
+ if cmd == "help"
17
+ print_help
18
+ elsif cmd == "gen"
19
+ selenium_cucumber_scaffold
20
+ elsif cmd == "version"
21
+ puts Selenium::Cucumber::VERSION
22
+ else
23
+ print_usage
24
+ end
25
+ end
26
+
data/doc/canned_steps.md CHANGED
@@ -1,463 +1,479 @@
1
- # Canned Steps
2
-
3
- selenium-cucumber comes with the following set of predefined steps.
4
- You can add your own steps or change the ones you see here.
5
-
6
- ## Navigation Steps
7
-
8
- To open/close URL and to navigate between pages use following steps :
9
-
10
- Then I navigate to "([^\"]*)"
11
- Then I navigate forward
12
- Then I navigate back
13
- Then I refresh page
14
-
15
- To interact with browser use following steps :
16
-
17
- Then I resize browser window size to width (\d+) and height (\d+)
18
- Then I maximize browser window
19
- Then I close browser
20
-
21
- To zoom in/out webpage use following steps :
22
-
23
- Then I zoom in page
24
- Then I zoom out page
25
-
26
- To zoom out webpage till necessary element displays use following steps :
27
-
28
- Then I zoom out page till I see element having id "(.*?)"
29
- Then I zoom out page till I see element having name "(.*?)"
30
- Then I zoom out page till I see element having class "(.*?)"
31
- Then I zoom out page till I see element having xpath "(.*?)"
32
- Then I zoom out page till I see element having css "(.*?)"
33
-
34
- To reset webpage view use following step :
35
-
36
- Then I reset page view
37
-
38
- To scroll webpage use following steps :
39
-
40
- Then I scroll to top of page
41
- Then I scroll to end of page
42
-
43
- To scroll webpage to specific element use following steps :
44
-
45
- Then I scroll to element having id "(.*?)"
46
- Then I scroll to element having name "(.*?)"
47
- Then I scroll to element having class "(.*?)"
48
- Then I scroll to element having xpath "(.*?)"
49
- Then I scroll to element having css "(.*?)"
50
-
51
- To hover over a element use following steps :
52
-
53
- Then I hover over element having id "(.*?)"
54
- Then I hover over element having name "(.*?)"
55
- Then I hover over element having class "(.*?)"
56
- Then I hover over element having xpath "(.*?)"
57
- Then I hover over element having css "(.*?)"
58
-
59
-
60
- Assertion Steps
61
- ---------------
62
- To assert that page title can be found use following step :
63
-
64
- Then I should see page title as "(.*?)"
65
-
66
- #### Steps For Asserting Element Text
67
-
68
- To assert element text use any of the following steps :
69
-
70
- Then element having id "([^\"]*)" should have text as "(.*?)"
71
- Then element having name "([^\"]*)" should have text as "(.*?)"
72
- Then element having class "([^\"]*)" should have text as "(.*?)"
73
- Then element having xpath "([^\"]*)" should have text as "(.*?)"
74
- Then element having css "([^\"]*)" should have text as "(.*?)"
75
-
76
- Then element having id "([^\"]*)" should not have text as "(.*?)"
77
- Then element having name "([^\"]*)" should not have text as "(.*?)"
78
- Then element having class "([^\"]*)" should not have text as "(.*?)"
79
- Then element having xpath "([^\"]*)" should not have text as "(.*?)"
80
- Then element having css "([^\"]*)" should not have text as "(.*?)"
81
-
82
- #### Steps For Asserting Element Attribute
83
-
84
- To assert element attribute use any of the following steps :
85
-
86
- Then element having id "([^\"]*)" should have attribute "(.*?)" with value "(.*?)"
87
- Then element having name "([^\"]*)" should have attribute "(.*?)" with value "(.*?)"
88
- Then element having class "([^\"]*)" should have attribute "(.*?)" with value "(.*?)"
89
- Then element having xpath "([^\"]*)" should have attribute "(.*?)" with value "(.*?)"
90
- Then element having css "([^\"]*)" should have attribute "(.*?)" with value "(.*?)"
91
-
92
- Then element having id "([^\"]*)" should not have attribute "(.*?)" with value "(.*?)"
93
- Then element having name "([^\"]*)" should not have attribute "(.*?)" with value "(.*?)"
94
- Then element having class "([^\"]*)" should not have attribute "(.*?)" with value "(.*?)"
95
- Then element having xpath "([^\"]*)" should not have attribute "(.*?)" with value "(.*?)"
96
- Then element having css "([^\"]*)" should not have attribute "(.*?)" with value "(.*?)"
97
-
98
-
99
- #### Steps For Asserting Element Accesibility
100
-
101
- To assert that element is enabled use any of the following steps :
102
-
103
- Then element having id "([^\"]*)" should be enabled
104
- Then element having name "([^\"]*)" should be enabled
105
- Then element having class "([^\"]*)" should be enabled
106
- Then element having xpath "([^\"]*)" should be enabled
107
- Then element having css "([^\"]*)" should be enabled
108
-
109
- To assert that element is disabled use any of the following steps :
110
-
111
- Then element having id "([^\"]*)" should be disabled
112
- Then element having name "([^\"]*)" should be disabled
113
- Then element having class "([^\"]*)" should be disabled
114
- Then element having xpath "([^\"]*)" should be disabled
115
- Then element having css "([^\"]*)" should be disabled
116
-
117
- #### Steps For Asserting Element Visibility
118
-
119
- To assert that element is present use any of the following steps :
120
-
121
- Then element having id "([^\"]*)" should be present
122
- Then element having name "([^\"]*)" should be present
123
- Then element having class "([^\"]*)" should be present
124
- Then element having xpath "([^\"]*)" should be present
125
- Then element having css "([^\"]*)" should be present
126
-
127
- To assert that element is not present use any of the following steps:
128
-
129
- Then element having id "([^\"]*)" should not be present
130
- Then element having name "([^\"]*)" should not be present
131
- Then element having class "([^\"]*)" should not be present
132
- Then element having xpath "([^\"]*)" should not be present
133
- Then element having css "([^\"]*)" should not be present
134
-
135
- #### Steps For Asserting Checkbox
136
-
137
- To assert that checkbox is checked use any of the following steps :
138
-
139
- Then checkbox having id "(.*?)" should be checked
140
- Then checkbox having name "(.*?)" should be checked
141
- Then checkbox having class "(.*?)" should be checked
142
- Then checkbox having xpath "(.*?)" should be checked
143
- Then checkbox having css "(.*?)" should be checked
144
-
145
- To assert that checkbox is unchecked use any of the following steps :
146
-
147
- Then checkbox having id "(.*?)" should be unchecked
148
- Then checkbox having name "(.*?)" should be unchecked
149
- Then checkbox having class "(.*?)" should be unchecked
150
- Then checkbox having xpath "(.*?)" should be unchecked
151
- Then checkbox having css "(.*?)" should be unchecked
152
-
153
- #### Steps For Asserting Dropdown List
154
-
155
- To assert that option by text from dropdown list selected use following steps :
156
-
157
- Then option "(.*?)" by text from dropdown having id "(.*?)" should be selected
158
- Then option "(.*?)" by text from dropdown having name "(.*?)" should be selected
159
- Then option "(.*?)" by text from dropdown having class "(.*?)" should be selected
160
- Then option "(.*?)" by text from dropdown having xpath "(.*?)" should be selected
161
- Then option "(.*?)" by text from dropdown having css "(.*?)" should be selected
162
-
163
- To assert that option by value from dropdown list selected use following steps :
164
-
165
- Then option "(.*?)" by value from dropdown having id "(.*?)" should be selected
166
- Then option "(.*?)" by value from dropdown having name "(.*?)" should be selected
167
- Then option "(.*?)" by value from dropdown having class "(.*?)" should be selected
168
- Then option "(.*?)" by value from dropdown having xpath "(.*?)" should be selected
169
- Then option "(.*?)" by value from dropdown having css "(.*?)" should be selected
170
-
171
- To assert that option by text from dropdown list unselected use following steps :
172
-
173
- Then option "(.*?)" by text from dropdown having id "(.*?)" should be unselected
174
- Then option "(.*?)" by text from dropdown having name "(.*?)" should be unselected
175
- Then option "(.*?)" by text from dropdown having class "(.*?)" should be unselected
176
- Then option "(.*?)" by text from dropdown having xpath "(.*?)" should be unselected
177
- Then option "(.*?)" by text from dropdown having css "(.*?)" should be unselected
178
-
179
- To assert that option by value from dropdown list unselected use following steps :
180
-
181
- Then option "(.*?)" by value from dropdown having id "(.*?)" should be unselected
182
- Then option "(.*?)" by value from dropdown having name "(.*?)" should be unselected
183
- Then option "(.*?)" by value from dropdown having class "(.*?)" should be unselected
184
- Then option "(.*?)" by value from dropdown having xpath "(.*?)" should be unselected
185
- Then option "(.*?)" by value from dropdown having css "(.*?)" should be unselected
186
-
187
- #### Steps For Asserting Radio Button
188
-
189
- To assert that radio button selected use any of the following steps :
190
-
191
- Then radio button having id "(.*?)" should be selected
192
- Then radio button having name "(.*?)" should be selected
193
- Then radio button having class "(.*?)" should be selected
194
- Then radio button having xpath "(.*?)" should be selected
195
- Then radio button having css "(.*?)" should be selected
196
-
197
- To assert that radio button not selected use any of the following steps :
198
-
199
- Then radio button having id "(.*?)" should be unselected
200
- Then radio button having name "(.*?)" should be unselected
201
- Then radio button having class "(.*?)" should be unselected
202
- Then radio button having xpath "(.*?)" should be unselected
203
- Then radio button having css "(.*?)" should be unselected
204
-
205
- To assert that radio button group selected by text use any of the following steps :
206
-
207
- Then option "(.*?)" by text from radio button group having id "(.*?)" should be selected
208
- Then option "(.*?)" by text from radio button group having name "(.*?)" should be selected
209
- Then option "(.*?)" by text from radio button group having class "(.*?)" should be selected
210
- Then option "(.*?)" by text from radio button group having xpath "(.*?)" should be selected
211
- Then option "(.*?)" by text from radio button group having css "(.*?)" should be selected
212
-
213
- To assert that radio button group selected by value use any of the following steps :
214
-
215
- Then option "(.*?)" by value from radio button group having id "(.*?)" should be selected
216
- Then option "(.*?)" by value from radio button group having name "(.*?)" should be selected
217
- Then option "(.*?)" by value from radio button group having class "(.*?)" should be selected
218
- Then option "(.*?)" by value from radio button group having xpath "(.*?)" should be selected
219
- Then option "(.*?)" by value from radio button group having css "(.*?)" should be selected
220
-
221
- To assert that radio button group not selected by text use any of the following steps :
222
-
223
- Then option "(.*?)" by text from radio button group having id "(.*?)" should be unselected
224
- Then option "(.*?)" by text from radio button group having name "(.*?)" should be unselected
225
- Then option "(.*?)" by text from radio button group having class "(.*?)" should be unselected
226
- Then option "(.*?)" by text from radio button group having xpath "(.*?)" should be unselected
227
- Then option "(.*?)" by text from radio button group having css "(.*?)" should be unselected
228
-
229
- To assert that radio button group not selected by value use any of the following steps :
230
-
231
- Then option "(.*?)" by value from radio button group having id "(.*?)" should be unselected
232
- Then option "(.*?)" by value from radio button group having name "(.*?)" should be unselected
233
- Then option "(.*?)" by value from radio button group having class "(.*?)" should be unselected
234
- Then option "(.*?)" by value from radio button group having xpath "(.*?)" should be unselected
235
- Then option "(.*?)" by value from radio button group having css "(.*?)" should be unselected
236
-
237
- #### Steps For Asserting Links
238
-
239
- To assert that link is present use following steps :
240
-
241
- Then link having text "(.*?)" should be present
242
- Then link having partial text "(.*?)" should be present
243
-
244
- To assert that link is not present use following steps :
245
-
246
- Then link having text "(.*?)" should not be present
247
- Then link having partial text "(.*?)" should not be present
248
-
249
- #### Steps For Asserting Javascript Pop-Up Alert
250
-
251
- To assert text on javascipt pop-up alert use following step :
252
-
253
- Then I should see alert text as "(.*?)"
254
-
255
-
256
- Input Steps
257
- -----------
258
-
259
- #### Steps For TextFields
260
-
261
- To enter text into input field use following steps :
262
-
263
- Then I enter "([^\"]*)" into input field having id "([^\"]*)"
264
- Then I enter "([^\"]*)" into input field having name "([^\"]*)"
265
- Then I enter "([^\"]*)" into input field having class "([^\"]*)"
266
- Then I enter "([^\"]*)" into input field having xpath "([^\"]*)"
267
- Then I enter "([^\"]*)" into input field having css "([^\"]*)"
268
-
269
- To clear input field use following steps :
270
-
271
- Then I clear input field having id "([^\"]*)"
272
- Then I clear input field having name "([^\"]*)"
273
- Then I clear input field having class "([^\"]*)"
274
- Then I clear input field having xpath "([^\"]*)"
275
- Then I clear input field having css "([^\"]*)"
276
-
277
- #### Steps For Dropdown List
278
-
279
- To select option by text from dropdown use following steps :
280
-
281
- Then I select "(.*?)" option by text from dropdown having id "(.*?)"
282
- Then I select "(.*?)" option by text from dropdown having name "(.*?)"
283
- Then I select "(.*?)" option by text from dropdown having class "(.*?)"
284
- Then I select "(.*?)" option by text from dropdown having xpath "(.*?)"
285
- Then I select "(.*?)" option by text from dropdown having css "(.*?)"
286
-
287
- To select option by index from dropdown use following steps :
288
-
289
- Then I select (\d+) option by index from dropdown having id "(.*?)"
290
- Then I select (\d+) option by index from dropdown having name "(.*?)"
291
- Then I select (\d+) option by index from dropdown having class "(.*?)"
292
- Then I select (\d+) option by index from dropdown having xpath "(.*?)"
293
- Then I select (\d+) option by index from dropdown having css "(.*?)"
294
-
295
- To select option by value from dropdown use following steps :
296
-
297
- Then I select "(.*?)" option by value from dropdown having id "(.*?)"
298
- Then I select "(.*?)" option by value from dropdown having name "(.*?)"
299
- Then I select "(.*?)" option by value from dropdown having class "(.*?)"
300
- Then I select "(.*?)" option by value from dropdown having xpath "(.*?)"
301
- Then I select "(.*?)" option by value from dropdown having css "(.*?)"
302
-
303
- #### Steps For Multiselect List
304
-
305
- To select option by text from multiselect dropdown use following steps :
306
-
307
- Then I select "(.*?)" option by text from multiselect dropdown having id "(.*?)"
308
- Then I select "(.*?)" option by text from multiselect dropdown having name "(.*?)"
309
- Then I select "(.*?)" option by text from multiselect dropdown having class "(.*?)"
310
- Then I select "(.*?)" option by text from multiselect dropdown having xpath "(.*?)"
311
- Then I select "(.*?)" option by text from multiselect dropdown having css "(.*?)"
312
-
313
- To select option by index from multiselect dropdown use following steps :
314
-
315
- Then I select (\d+) option by index from multiselect dropdown having id "(.*?)"
316
- Then I select (\d+) option by index from multiselect dropdown having name "(.*?)"
317
- Then I select (\d+) option by index from multiselect dropdown having class "(.*?)"
318
- Then I select (\d+) option by index from multiselect dropdown having xpath "(.*?)"
319
- Then I select (\d+) option by index from multiselect dropdown having css "(.*?)"
320
-
321
- To select option by value from multiselect dropdown use following steps :
322
-
323
- Then I select "(.*?)" option by value from multiselect dropdown having id "(.*?)"
324
- Then I select "(.*?)" option by value from multiselect dropdown having name "(.*?)"
325
- Then I select "(.*?)" option by value from multiselect dropdown having class "(.*?)"
326
- Then I select "(.*?)" option by value from multiselect dropdown having xpath "(.*?)"
327
- Then I select "(.*?)" option by value from multiselect dropdown having css "(.*?)"
328
-
329
- To select all options from multiselect use following steps :
330
-
331
- Then I select all options from multiselect dropdown having id "(.*?)"
332
- Then I select all options from multiselect dropdown having name "(.*?)"
333
- Then I select all options from multiselect dropdown having class "(.*?)"
334
- Then I select all options from multiselect dropdown having xpath "(.*?)"
335
- Then I select all options from multiselect dropdown having css "(.*?)"
336
-
337
- To unselect all options from multiselect use following steps :
338
-
339
- Then I unselect all options from mutliselect dropdown having id "(.*?)"
340
- Then I unselect all options from mutliselect dropdown having name "(.*?)"
341
- Then I unselect all options from mutliselect dropdown having class "(.*?)"
342
- Then I unselect all options from mutliselect dropdown having xpath "(.*?)"
343
- Then I unselect all options from mutliselect dropdown having css "(.*?)"
344
-
345
- #### Steps For Checkboxes
346
-
347
- To check the checkbox use following steps :
348
-
349
- Then I check the checkbox having id "(.*?)"
350
- Then I check the checkbox having name "(.*?)"
351
- Then I check the checkbox having class "(.*?)"
352
- Then I check the checkbox having xpath "(.*?)"
353
- Then I check the checkbox having css "(.*?)"
354
-
355
- To uncheck the checkbox use following steps :
356
-
357
- Then I uncheck the checkbox having id "(.*?)"
358
- Then I uncheck the checkbox having name "(.*?)"
359
- Then I uncheck the checkbox having class "(.*?)"
360
- Then I uncheck the checkbox having xpath "(.*?)"
361
- Then I uncheck the checkbox having css "(.*?)"
362
-
363
- To toggle checkbox use following steps
364
-
365
- Then I toggle checkbox having id "(.*?)"
366
- Then I toggle checkbox having name "(.*?)"
367
- Then I toggle checkbox having class "(.*?)"
368
- Then I toggle checkbox having xpath "(.*?)"
369
- Then I toggle checkbox having css "(.*?)"
370
-
371
- #### Steps For Radio Buttons
372
-
373
- To select radio button use following steps :
374
-
375
- Then I select radio button having id "(.*?)"
376
- Then I select radio button having name "(.*?)"
377
- Then I select radio button having class "(.*?)"
378
- Then I select radio button having xpath "(.*?)"
379
- Then I select radio button having css "(.*?)"
380
-
381
-
382
- To select one radio button by text from radio button group use following steps :
383
-
384
- Then I select "(.*?)" option by text from radio button group having id "(.*?)"
385
- Then I select "(.*?)" option by text from radio button group having name "(.*?)"
386
- Then I select "(.*?)" option by text from radio button group having class "(.*?)"
387
- Then I select "(.*?)" option by text from radio button group having xpath "(.*?)"
388
- Then I select "(.*?)" option by text from radio button group having css "(.*?)"
389
-
390
- To select one radio button by value from radio button group use following steps :
391
-
392
- Then I select "(.*?)" option by value from radio button group having id "(.*?)"
393
- Then I select "(.*?)" option by value from radio button group having name "(.*?)"
394
- Then I select "(.*?)" option by value from radio button group having class "(.*?)"
395
- Then I select "(.*?)" option by value from radio button group having xpath "(.*?)"
396
- Then I select "(.*?)" option by value from radio button group having css "(.*?)"
397
-
398
-
399
- Click Steps
400
- -----------
401
- To click on web element use following steps :
402
-
403
- Then I click on element having id "(.*?)"
404
- Then I click on element having name "(.*?)"
405
- Then I click on element having class "(.*?)"
406
- Then I click on element having xpath "(.*?)"
407
- Then I click on element having css "(.*?)"
408
-
409
- To forcefully click on web element use following steps (if above steps do not work) :
410
-
411
- Then I forcefully click on element having id "(.*?)"
412
- Then I forcefully click on element having name "(.*?)"
413
- Then I forcefully click on element having class "(.*?)"
414
- Then I forcefully click on element having xpath "(.*?)"
415
- Then I forcefully click on element having css "(.*?)"
416
-
417
- To click on links use following steps :
418
-
419
- Then I click on link having text "(.*?)"
420
- Then I click on link having partial text "(.*?)"
421
-
422
- Progress Steps
423
- --------------
424
- To wait for specific time use following step :
425
-
426
- Then I wait for (\d+) sec
427
-
428
- To wait for specific element to display use following steps :
429
-
430
- Then I wait (\d+) seconds for element to display having id "(.*?)"
431
- Then I wait (\d+) seconds for element to display having name "(.*?)"
432
- Then I wait (\d+) seconds for element to display having class "(.*?)"
433
- Then I wait (\d+) seconds for element to display having xpath "(.*?)"
434
- Then I wait (\d+) seconds for element to display having css "(.*?)"
435
-
436
- To wait for specific element to enable use following steps :
437
-
438
- Then I wait (\d+) seconds for element to enable having id "(.*?)"
439
- Then I wait (\d+) seconds for element to enable having name "(.*?)"
440
- Then I wait (\d+) seconds for element to enable having class "(.*?)"
441
- Then I wait (\d+) seconds for element to enable having xpath "(.*?)"
442
- Then I wait (\d+) seconds for element to enable having css "(.*?)"
443
-
444
- Javascript Handling Steps
445
- -------------------------
446
- To handle javascript pop-up use following steps :
447
-
448
- Then I accept alert
449
- Then I dismiss alert
450
-
451
-
452
- Screenshot Steps
453
- ----------------
454
- To take screenshot use following step :
455
-
456
- Then I take screenshot
457
-
458
-
459
- Configuration Steps
460
- -------------------
461
- To print testing configuration use following step :
462
-
463
- Then I print configuration
1
+ # Canned Steps
2
+
3
+ selenium-cucumber comes with the following set of predefined steps.
4
+ You can add your own steps or change the ones you see here.
5
+
6
+ ## Navigation Steps
7
+
8
+ To open/close URL and to navigate between pages use following steps :
9
+
10
+ Then I navigate to "([^\"]*)"
11
+ Then I navigate forward
12
+ Then I navigate back
13
+ Then I refresh page
14
+ Then I switch to new window
15
+ Then I switch to previous window
16
+
17
+ To interact with browser use following steps :
18
+
19
+ Then I resize browser window size to width (\d+) and height (\d+)
20
+ Then I maximize browser window
21
+ Then I close browser
22
+
23
+ To zoom in/out webpage use following steps :
24
+
25
+ Then I zoom in page
26
+ Then I zoom out page
27
+
28
+ To zoom out webpage till necessary element displays use following steps :
29
+
30
+ Then I zoom out page till I see element having id "(.*?)"
31
+ Then I zoom out page till I see element having name "(.*?)"
32
+ Then I zoom out page till I see element having class "(.*?)"
33
+ Then I zoom out page till I see element having xpath "(.*?)"
34
+ Then I zoom out page till I see element having css "(.*?)"
35
+
36
+ To reset webpage view use following step :
37
+
38
+ Then I reset page view
39
+
40
+ To scroll webpage use following steps :
41
+
42
+ Then I scroll to top of page
43
+ Then I scroll to end of page
44
+
45
+ To scroll webpage to specific element use following steps :
46
+
47
+ Then I scroll to element having id "(.*?)"
48
+ Then I scroll to element having name "(.*?)"
49
+ Then I scroll to element having class "(.*?)"
50
+ Then I scroll to element having xpath "(.*?)"
51
+ Then I scroll to element having css "(.*?)"
52
+
53
+ To hover over a element use following steps :
54
+
55
+ Then I hover over element having id "(.*?)"
56
+ Then I hover over element having name "(.*?)"
57
+ Then I hover over element having class "(.*?)"
58
+ Then I hover over element having xpath "(.*?)"
59
+ Then I hover over element having css "(.*?)"
60
+
61
+
62
+ Assertion Steps
63
+ ---------------
64
+ To assert that page title can be found use following step :
65
+
66
+ Then I should see page title as "(.*?)"
67
+
68
+ #### Steps For Asserting Element Text
69
+
70
+ To assert element text use any of the following steps :
71
+
72
+ Then element having id "([^\"]*)" should have text as "(.*?)"
73
+ Then element having name "([^\"]*)" should have text as "(.*?)"
74
+ Then element having class "([^\"]*)" should have text as "(.*?)"
75
+ Then element having xpath "([^\"]*)" should have text as "(.*?)"
76
+ Then element having css "([^\"]*)" should have text as "(.*?)"
77
+
78
+ Then element having id "([^\"]*)" should not have text as "(.*?)"
79
+ Then element having name "([^\"]*)" should not have text as "(.*?)"
80
+ Then element having class "([^\"]*)" should not have text as "(.*?)"
81
+ Then element having xpath "([^\"]*)" should not have text as "(.*?)"
82
+ Then element having css "([^\"]*)" should not have text as "(.*?)"
83
+
84
+ #### Steps For Asserting Element Attribute
85
+
86
+ To assert element attribute use any of the following steps :
87
+
88
+ Then element having id "([^\"]*)" should have attribute "(.*?)" with value "(.*?)"
89
+ Then element having name "([^\"]*)" should have attribute "(.*?)" with value "(.*?)"
90
+ Then element having class "([^\"]*)" should have attribute "(.*?)" with value "(.*?)"
91
+ Then element having xpath "([^\"]*)" should have attribute "(.*?)" with value "(.*?)"
92
+ Then element having css "([^\"]*)" should have attribute "(.*?)" with value "(.*?)"
93
+
94
+ Then element having id "([^\"]*)" should not have attribute "(.*?)" with value "(.*?)"
95
+ Then element having name "([^\"]*)" should not have attribute "(.*?)" with value "(.*?)"
96
+ Then element having class "([^\"]*)" should not have attribute "(.*?)" with value "(.*?)"
97
+ Then element having xpath "([^\"]*)" should not have attribute "(.*?)" with value "(.*?)"
98
+ Then element having css "([^\"]*)" should not have attribute "(.*?)" with value "(.*?)"
99
+
100
+
101
+ #### Steps For Asserting Element Accesibility
102
+
103
+ To assert that element is enabled use any of the following steps :
104
+
105
+ Then element having id "([^\"]*)" should be enabled
106
+ Then element having name "([^\"]*)" should be enabled
107
+ Then element having class "([^\"]*)" should be enabled
108
+ Then element having xpath "([^\"]*)" should be enabled
109
+ Then element having css "([^\"]*)" should be enabled
110
+
111
+ To assert that element is disabled use any of the following steps :
112
+
113
+ Then element having id "([^\"]*)" should be disabled
114
+ Then element having name "([^\"]*)" should be disabled
115
+ Then element having class "([^\"]*)" should be disabled
116
+ Then element having xpath "([^\"]*)" should be disabled
117
+ Then element having css "([^\"]*)" should be disabled
118
+
119
+ #### Steps For Asserting Element Visibility
120
+
121
+ To assert that element is present use any of the following steps :
122
+
123
+ Then element having id "([^\"]*)" should be present
124
+ Then element having name "([^\"]*)" should be present
125
+ Then element having class "([^\"]*)" should be present
126
+ Then element having xpath "([^\"]*)" should be present
127
+ Then element having css "([^\"]*)" should be present
128
+
129
+ To assert that element is not present use any of the following steps:
130
+
131
+ Then element having id "([^\"]*)" should not be present
132
+ Then element having name "([^\"]*)" should not be present
133
+ Then element having class "([^\"]*)" should not be present
134
+ Then element having xpath "([^\"]*)" should not be present
135
+ Then element having css "([^\"]*)" should not be present
136
+
137
+ #### Steps For Asserting Checkbox
138
+
139
+ To assert that checkbox is checked use any of the following steps :
140
+
141
+ Then checkbox having id "(.*?)" should be checked
142
+ Then checkbox having name "(.*?)" should be checked
143
+ Then checkbox having class "(.*?)" should be checked
144
+ Then checkbox having xpath "(.*?)" should be checked
145
+ Then checkbox having css "(.*?)" should be checked
146
+
147
+ To assert that checkbox is unchecked use any of the following steps :
148
+
149
+ Then checkbox having id "(.*?)" should be unchecked
150
+ Then checkbox having name "(.*?)" should be unchecked
151
+ Then checkbox having class "(.*?)" should be unchecked
152
+ Then checkbox having xpath "(.*?)" should be unchecked
153
+ Then checkbox having css "(.*?)" should be unchecked
154
+
155
+ #### Steps For Asserting Dropdown List
156
+
157
+ To assert that option by text from dropdown list selected use following steps :
158
+
159
+ Then option "(.*?)" by text from dropdown having id "(.*?)" should be selected
160
+ Then option "(.*?)" by text from dropdown having name "(.*?)" should be selected
161
+ Then option "(.*?)" by text from dropdown having class "(.*?)" should be selected
162
+ Then option "(.*?)" by text from dropdown having xpath "(.*?)" should be selected
163
+ Then option "(.*?)" by text from dropdown having css "(.*?)" should be selected
164
+
165
+ To assert that option by value from dropdown list selected use following steps :
166
+
167
+ Then option "(.*?)" by value from dropdown having id "(.*?)" should be selected
168
+ Then option "(.*?)" by value from dropdown having name "(.*?)" should be selected
169
+ Then option "(.*?)" by value from dropdown having class "(.*?)" should be selected
170
+ Then option "(.*?)" by value from dropdown having xpath "(.*?)" should be selected
171
+ Then option "(.*?)" by value from dropdown having css "(.*?)" should be selected
172
+
173
+ To assert that option by text from dropdown list unselected use following steps :
174
+
175
+ Then option "(.*?)" by text from dropdown having id "(.*?)" should be unselected
176
+ Then option "(.*?)" by text from dropdown having name "(.*?)" should be unselected
177
+ Then option "(.*?)" by text from dropdown having class "(.*?)" should be unselected
178
+ Then option "(.*?)" by text from dropdown having xpath "(.*?)" should be unselected
179
+ Then option "(.*?)" by text from dropdown having css "(.*?)" should be unselected
180
+
181
+ To assert that option by value from dropdown list unselected use following steps :
182
+
183
+ Then option "(.*?)" by value from dropdown having id "(.*?)" should be unselected
184
+ Then option "(.*?)" by value from dropdown having name "(.*?)" should be unselected
185
+ Then option "(.*?)" by value from dropdown having class "(.*?)" should be unselected
186
+ Then option "(.*?)" by value from dropdown having xpath "(.*?)" should be unselected
187
+ Then option "(.*?)" by value from dropdown having css "(.*?)" should be unselected
188
+
189
+ #### Steps For Asserting Radio Button
190
+
191
+ To assert that radio button selected use any of the following steps :
192
+
193
+ Then radio button having id "(.*?)" should be selected
194
+ Then radio button having name "(.*?)" should be selected
195
+ Then radio button having class "(.*?)" should be selected
196
+ Then radio button having xpath "(.*?)" should be selected
197
+ Then radio button having css "(.*?)" should be selected
198
+
199
+ To assert that radio button not selected use any of the following steps :
200
+
201
+ Then radio button having id "(.*?)" should be unselected
202
+ Then radio button having name "(.*?)" should be unselected
203
+ Then radio button having class "(.*?)" should be unselected
204
+ Then radio button having xpath "(.*?)" should be unselected
205
+ Then radio button having css "(.*?)" should be unselected
206
+
207
+ To assert that radio button group selected by text use any of the following steps :
208
+
209
+ Then option "(.*?)" by text from radio button group having id "(.*?)" should be selected
210
+ Then option "(.*?)" by text from radio button group having name "(.*?)" should be selected
211
+ Then option "(.*?)" by text from radio button group having class "(.*?)" should be selected
212
+ Then option "(.*?)" by text from radio button group having xpath "(.*?)" should be selected
213
+ Then option "(.*?)" by text from radio button group having css "(.*?)" should be selected
214
+
215
+ To assert that radio button group selected by value use any of the following steps :
216
+
217
+ Then option "(.*?)" by value from radio button group having id "(.*?)" should be selected
218
+ Then option "(.*?)" by value from radio button group having name "(.*?)" should be selected
219
+ Then option "(.*?)" by value from radio button group having class "(.*?)" should be selected
220
+ Then option "(.*?)" by value from radio button group having xpath "(.*?)" should be selected
221
+ Then option "(.*?)" by value from radio button group having css "(.*?)" should be selected
222
+
223
+ To assert that radio button group not selected by text use any of the following steps :
224
+
225
+ Then option "(.*?)" by text from radio button group having id "(.*?)" should be unselected
226
+ Then option "(.*?)" by text from radio button group having name "(.*?)" should be unselected
227
+ Then option "(.*?)" by text from radio button group having class "(.*?)" should be unselected
228
+ Then option "(.*?)" by text from radio button group having xpath "(.*?)" should be unselected
229
+ Then option "(.*?)" by text from radio button group having css "(.*?)" should be unselected
230
+
231
+ To assert that radio button group not selected by value use any of the following steps :
232
+
233
+ Then option "(.*?)" by value from radio button group having id "(.*?)" should be unselected
234
+ Then option "(.*?)" by value from radio button group having name "(.*?)" should be unselected
235
+ Then option "(.*?)" by value from radio button group having class "(.*?)" should be unselected
236
+ Then option "(.*?)" by value from radio button group having xpath "(.*?)" should be unselected
237
+ Then option "(.*?)" by value from radio button group having css "(.*?)" should be unselected
238
+
239
+ #### Steps For Asserting Links
240
+
241
+ To assert that link is present use following steps :
242
+
243
+ Then link having text "(.*?)" should be present
244
+ Then link having partial text "(.*?)" should be present
245
+
246
+ To assert that link is not present use following steps :
247
+
248
+ Then link having text "(.*?)" should not be present
249
+ Then link having partial text "(.*?)" should not be present
250
+
251
+ #### Steps For Asserting Javascript Pop-Up Alert
252
+
253
+ To assert text on javascipt pop-up alert use following step :
254
+
255
+ Then I should see alert text as "(.*?)"
256
+
257
+ #### Steps For Asserting Difference in images
258
+
259
+ To assert difference in actual image and expected image use following step :
260
+
261
+ Then actual image "(.*?)" and expected image "(.*?)" should be similar
262
+
263
+
264
+ Input Steps
265
+ -----------
266
+
267
+ #### Steps For TextFields
268
+
269
+ To enter text into input field use following steps :
270
+
271
+ Then I enter "([^\"]*)" into input field having id "([^\"]*)"
272
+ Then I enter "([^\"]*)" into input field having name "([^\"]*)"
273
+ Then I enter "([^\"]*)" into input field having class "([^\"]*)"
274
+ Then I enter "([^\"]*)" into input field having xpath "([^\"]*)"
275
+ Then I enter "([^\"]*)" into input field having css "([^\"]*)"
276
+
277
+ To clear input field use following steps :
278
+
279
+ Then I clear input field having id "([^\"]*)"
280
+ Then I clear input field having name "([^\"]*)"
281
+ Then I clear input field having class "([^\"]*)"
282
+ Then I clear input field having xpath "([^\"]*)"
283
+ Then I clear input field having css "([^\"]*)"
284
+
285
+ #### Steps For Dropdown List
286
+
287
+ To select option by text from dropdown use following steps :
288
+
289
+ Then I select "(.*?)" option by text from dropdown having id "(.*?)"
290
+ Then I select "(.*?)" option by text from dropdown having name "(.*?)"
291
+ Then I select "(.*?)" option by text from dropdown having class "(.*?)"
292
+ Then I select "(.*?)" option by text from dropdown having xpath "(.*?)"
293
+ Then I select "(.*?)" option by text from dropdown having css "(.*?)"
294
+
295
+ To select option by index from dropdown use following steps :
296
+
297
+ Then I select (\d+) option by index from dropdown having id "(.*?)"
298
+ Then I select (\d+) option by index from dropdown having name "(.*?)"
299
+ Then I select (\d+) option by index from dropdown having class "(.*?)"
300
+ Then I select (\d+) option by index from dropdown having xpath "(.*?)"
301
+ Then I select (\d+) option by index from dropdown having css "(.*?)"
302
+
303
+ To select option by value from dropdown use following steps :
304
+
305
+ Then I select "(.*?)" option by value from dropdown having id "(.*?)"
306
+ Then I select "(.*?)" option by value from dropdown having name "(.*?)"
307
+ Then I select "(.*?)" option by value from dropdown having class "(.*?)"
308
+ Then I select "(.*?)" option by value from dropdown having xpath "(.*?)"
309
+ Then I select "(.*?)" option by value from dropdown having css "(.*?)"
310
+
311
+ #### Steps For Multiselect List
312
+
313
+ To select option by text from multiselect dropdown use following steps :
314
+
315
+ Then I select "(.*?)" option by text from multiselect dropdown having id "(.*?)"
316
+ Then I select "(.*?)" option by text from multiselect dropdown having name "(.*?)"
317
+ Then I select "(.*?)" option by text from multiselect dropdown having class "(.*?)"
318
+ Then I select "(.*?)" option by text from multiselect dropdown having xpath "(.*?)"
319
+ Then I select "(.*?)" option by text from multiselect dropdown having css "(.*?)"
320
+
321
+ To select option by index from multiselect dropdown use following steps :
322
+
323
+ Then I select (\d+) option by index from multiselect dropdown having id "(.*?)"
324
+ Then I select (\d+) option by index from multiselect dropdown having name "(.*?)"
325
+ Then I select (\d+) option by index from multiselect dropdown having class "(.*?)"
326
+ Then I select (\d+) option by index from multiselect dropdown having xpath "(.*?)"
327
+ Then I select (\d+) option by index from multiselect dropdown having css "(.*?)"
328
+
329
+ To select option by value from multiselect dropdown use following steps :
330
+
331
+ Then I select "(.*?)" option by value from multiselect dropdown having id "(.*?)"
332
+ Then I select "(.*?)" option by value from multiselect dropdown having name "(.*?)"
333
+ Then I select "(.*?)" option by value from multiselect dropdown having class "(.*?)"
334
+ Then I select "(.*?)" option by value from multiselect dropdown having xpath "(.*?)"
335
+ Then I select "(.*?)" option by value from multiselect dropdown having css "(.*?)"
336
+
337
+ To select all options from multiselect use following steps :
338
+
339
+ Then I select all options from multiselect dropdown having id "(.*?)"
340
+ Then I select all options from multiselect dropdown having name "(.*?)"
341
+ Then I select all options from multiselect dropdown having class "(.*?)"
342
+ Then I select all options from multiselect dropdown having xpath "(.*?)"
343
+ Then I select all options from multiselect dropdown having css "(.*?)"
344
+
345
+ To unselect all options from multiselect use following steps :
346
+
347
+ Then I unselect all options from mutliselect dropdown having id "(.*?)"
348
+ Then I unselect all options from mutliselect dropdown having name "(.*?)"
349
+ Then I unselect all options from mutliselect dropdown having class "(.*?)"
350
+ Then I unselect all options from mutliselect dropdown having xpath "(.*?)"
351
+ Then I unselect all options from mutliselect dropdown having css "(.*?)"
352
+
353
+ #### Steps For Checkboxes
354
+
355
+ To check the checkbox use following steps :
356
+
357
+ Then I check the checkbox having id "(.*?)"
358
+ Then I check the checkbox having name "(.*?)"
359
+ Then I check the checkbox having class "(.*?)"
360
+ Then I check the checkbox having xpath "(.*?)"
361
+ Then I check the checkbox having css "(.*?)"
362
+
363
+ To uncheck the checkbox use following steps :
364
+
365
+ Then I uncheck the checkbox having id "(.*?)"
366
+ Then I uncheck the checkbox having name "(.*?)"
367
+ Then I uncheck the checkbox having class "(.*?)"
368
+ Then I uncheck the checkbox having xpath "(.*?)"
369
+ Then I uncheck the checkbox having css "(.*?)"
370
+
371
+ To toggle checkbox use following steps
372
+
373
+ Then I toggle checkbox having id "(.*?)"
374
+ Then I toggle checkbox having name "(.*?)"
375
+ Then I toggle checkbox having class "(.*?)"
376
+ Then I toggle checkbox having xpath "(.*?)"
377
+ Then I toggle checkbox having css "(.*?)"
378
+
379
+ #### Steps For Radio Buttons
380
+
381
+ To select radio button use following steps :
382
+
383
+ Then I select radio button having id "(.*?)"
384
+ Then I select radio button having name "(.*?)"
385
+ Then I select radio button having class "(.*?)"
386
+ Then I select radio button having xpath "(.*?)"
387
+ Then I select radio button having css "(.*?)"
388
+
389
+
390
+ To select one radio button by text from radio button group use following steps :
391
+
392
+ Then I select "(.*?)" option by text from radio button group having id "(.*?)"
393
+ Then I select "(.*?)" option by text from radio button group having name "(.*?)"
394
+ Then I select "(.*?)" option by text from radio button group having class "(.*?)"
395
+ Then I select "(.*?)" option by text from radio button group having xpath "(.*?)"
396
+ Then I select "(.*?)" option by text from radio button group having css "(.*?)"
397
+
398
+ To select one radio button by value from radio button group use following steps :
399
+
400
+ Then I select "(.*?)" option by value from radio button group having id "(.*?)"
401
+ Then I select "(.*?)" option by value from radio button group having name "(.*?)"
402
+ Then I select "(.*?)" option by value from radio button group having class "(.*?)"
403
+ Then I select "(.*?)" option by value from radio button group having xpath "(.*?)"
404
+ Then I select "(.*?)" option by value from radio button group having css "(.*?)"
405
+
406
+
407
+ Click Steps
408
+ -----------
409
+ To click on web element use following steps :
410
+
411
+ Then I click on element having id "(.*?)"
412
+ Then I click on element having name "(.*?)"
413
+ Then I click on element having class "(.*?)"
414
+ Then I click on element having xpath "(.*?)"
415
+ Then I click on element having css "(.*?)"
416
+
417
+ To forcefully click on web element use following steps (if above steps do not work) :
418
+
419
+ Then I forcefully click on element having id "(.*?)"
420
+ Then I forcefully click on element having name "(.*?)"
421
+ Then I forcefully click on element having class "(.*?)"
422
+ Then I forcefully click on element having xpath "(.*?)"
423
+ Then I forcefully click on element having css "(.*?)"
424
+
425
+ To double click on web element use following steps :
426
+
427
+ Then I double click on element having id "(.*?)"
428
+ Then I double click on element having name "(.*?)"
429
+ Then I double click on element having class "(.*?)"
430
+ Then I double click on element having xpath "(.*?)"
431
+ Then I double click on element having css "(.*?)"
432
+
433
+ To click on links use following steps :
434
+
435
+ Then I click on link having text "(.*?)"
436
+ Then I click on link having partial text "(.*?)"
437
+
438
+ Progress Steps
439
+ --------------
440
+ To wait for specific time use following step :
441
+
442
+ Then I wait for (\d+) sec
443
+
444
+ To wait for specific element to display use following steps :
445
+
446
+ Then I wait (\d+) seconds for element having id "(.*?)" to display
447
+ Then I wait (\d+) seconds for element having name "(.*?)" to display
448
+ Then I wait (\d+) seconds for element having class "(.*?)" to display
449
+ Then I wait (\d+) seconds for element having xpath "(.*?)" to display
450
+ Then I wait (\d+) seconds for element having css "(.*?)" to display
451
+
452
+ To wait for specific element to enable use following steps :
453
+
454
+ Then I wait (\d+) seconds for element having id "(.*?)" to enable
455
+ Then I wait (\d+) seconds for element having name "(.*?)" to enable
456
+ Then I wait (\d+) seconds for element having class "(.*?)" to enable
457
+ Then I wait (\d+) seconds for element having xpath "(.*?)" to enable
458
+ Then I wait (\d+) seconds for element having css "(.*?)" to enable
459
+
460
+ Javascript Handling Steps
461
+ -------------------------
462
+ To handle javascript pop-up use following steps :
463
+
464
+ Then I accept alert
465
+ Then I dismiss alert
466
+
467
+
468
+ Screenshot Steps
469
+ ----------------
470
+ To take screenshot use following step :
471
+
472
+ Then I take screenshot
473
+
474
+
475
+ Configuration Steps
476
+ -------------------
477
+ To print testing configuration use following step :
478
+
479
+ Then I print configuration