rubySelenium 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/rubyselenium-seed +25 -0
- data/documentation/output/css/style.css +36 -0
- data/documentation/output/documentation.html +197 -0
- data/documentation/output/files/rdoc/classes/Batch_Generator.html +274 -0
- data/documentation/output/files/rdoc/classes/Batch_Generator.src/M000062.html +19 -0
- data/documentation/output/files/rdoc/classes/Batch_Generator.src/M000063.html +26 -0
- data/documentation/output/files/rdoc/classes/Batch_Generator.src/M000064.html +22 -0
- data/documentation/output/files/rdoc/classes/Batch_Generator.src/M000065.html +20 -0
- data/documentation/output/files/rdoc/classes/Batch_Generator.src/M000066.html +23 -0
- data/documentation/output/files/rdoc/classes/Batch_Generator.src/M000067.html +18 -0
- data/documentation/output/files/rdoc/classes/Batch_Generator.src/M000068.html +20 -0
- data/documentation/output/files/rdoc/classes/Batch_Generator.src/M000069.html +18 -0
- data/documentation/output/files/rdoc/classes/Batch_Generator.src/M000070.html +23 -0
- data/documentation/output/files/rdoc/classes/Batch_Generator.src/M000071.html +20 -0
- data/documentation/output/files/rdoc/classes/GenerateCommand.html +137 -0
- data/documentation/output/files/rdoc/classes/GenerateCommand.src/M000001.html +54 -0
- data/documentation/output/files/rdoc/classes/HTML_File_Generator.html +229 -0
- data/documentation/output/files/rdoc/classes/HTML_File_Generator.src/M000072.html +23 -0
- data/documentation/output/files/rdoc/classes/HTML_File_Generator.src/M000073.html +20 -0
- data/documentation/output/files/rdoc/classes/HTML_File_Generator.src/M000074.html +18 -0
- data/documentation/output/files/rdoc/classes/HTML_File_Generator.src/M000075.html +19 -0
- data/documentation/output/files/rdoc/classes/HTML_File_Generator.src/M000076.html +18 -0
- data/documentation/output/files/rdoc/classes/HTML_File_Generator.src/M000077.html +18 -0
- data/documentation/output/files/rdoc/classes/HTML_File_Generator.src/M000078.html +18 -0
- data/documentation/output/files/rdoc/classes/MissingConfigurationFile.html +111 -0
- data/documentation/output/files/rdoc/classes/MissingRubyTestFiles.html +111 -0
- data/documentation/output/files/rdoc/classes/RubySelenium.html +1523 -0
- data/documentation/output/files/rdoc/classes/RubySelenium.src/M000002.html +20 -0
- data/documentation/output/files/rdoc/classes/RubySelenium.src/M000003.html +18 -0
- data/documentation/output/files/rdoc/classes/RubySelenium.src/M000004.html +18 -0
- data/documentation/output/files/rdoc/classes/RubySelenium.src/M000005.html +18 -0
- data/documentation/output/files/rdoc/classes/RubySelenium.src/M000006.html +18 -0
- data/documentation/output/files/rdoc/classes/RubySelenium.src/M000007.html +18 -0
- data/documentation/output/files/rdoc/classes/RubySelenium.src/M000008.html +18 -0
- data/documentation/output/files/rdoc/classes/RubySelenium.src/M000009.html +18 -0
- data/documentation/output/files/rdoc/classes/RubySelenium.src/M000010.html +18 -0
- data/documentation/output/files/rdoc/classes/RubySelenium.src/M000011.html +18 -0
- data/documentation/output/files/rdoc/classes/RubySelenium.src/M000012.html +18 -0
- data/documentation/output/files/rdoc/classes/RubySelenium.src/M000013.html +18 -0
- data/documentation/output/files/rdoc/classes/RubySelenium.src/M000014.html +18 -0
- data/documentation/output/files/rdoc/classes/RubySelenium.src/M000015.html +18 -0
- data/documentation/output/files/rdoc/classes/RubySelenium.src/M000016.html +18 -0
- data/documentation/output/files/rdoc/classes/RubySelenium.src/M000017.html +18 -0
- data/documentation/output/files/rdoc/classes/RubySelenium.src/M000018.html +18 -0
- data/documentation/output/files/rdoc/classes/RubySelenium.src/M000019.html +18 -0
- data/documentation/output/files/rdoc/classes/RubySelenium.src/M000020.html +18 -0
- data/documentation/output/files/rdoc/classes/RubySelenium.src/M000021.html +18 -0
- data/documentation/output/files/rdoc/classes/RubySelenium.src/M000022.html +18 -0
- data/documentation/output/files/rdoc/classes/RubySelenium.src/M000023.html +18 -0
- data/documentation/output/files/rdoc/classes/RubySelenium.src/M000024.html +18 -0
- data/documentation/output/files/rdoc/classes/RubySelenium.src/M000025.html +18 -0
- data/documentation/output/files/rdoc/classes/RubySelenium.src/M000026.html +18 -0
- data/documentation/output/files/rdoc/classes/RubySelenium.src/M000027.html +18 -0
- data/documentation/output/files/rdoc/classes/RubySelenium.src/M000028.html +18 -0
- data/documentation/output/files/rdoc/classes/RubySelenium.src/M000029.html +18 -0
- data/documentation/output/files/rdoc/classes/RubySelenium.src/M000030.html +18 -0
- data/documentation/output/files/rdoc/classes/RubySelenium.src/M000031.html +18 -0
- data/documentation/output/files/rdoc/classes/RubySelenium.src/M000032.html +18 -0
- data/documentation/output/files/rdoc/classes/RubySelenium.src/M000033.html +18 -0
- data/documentation/output/files/rdoc/classes/RubySelenium.src/M000034.html +18 -0
- data/documentation/output/files/rdoc/classes/RubySelenium.src/M000035.html +18 -0
- data/documentation/output/files/rdoc/classes/RubySelenium.src/M000036.html +18 -0
- data/documentation/output/files/rdoc/classes/RubySelenium.src/M000037.html +18 -0
- data/documentation/output/files/rdoc/classes/RubySelenium.src/M000038.html +18 -0
- data/documentation/output/files/rdoc/classes/RubySelenium.src/M000039.html +18 -0
- data/documentation/output/files/rdoc/classes/RubySelenium.src/M000040.html +18 -0
- data/documentation/output/files/rdoc/classes/RubySelenium.src/M000041.html +18 -0
- data/documentation/output/files/rdoc/classes/RubySelenium.src/M000042.html +18 -0
- data/documentation/output/files/rdoc/classes/RubySelenium.src/M000043.html +18 -0
- data/documentation/output/files/rdoc/classes/RubySelenium.src/M000044.html +18 -0
- data/documentation/output/files/rdoc/classes/RubySelenium.src/M000045.html +18 -0
- data/documentation/output/files/rdoc/classes/RubySelenium.src/M000046.html +18 -0
- data/documentation/output/files/rdoc/classes/RubySelenium.src/M000047.html +18 -0
- data/documentation/output/files/rdoc/classes/RubySelenium.src/M000048.html +18 -0
- data/documentation/output/files/rdoc/classes/RubySelenium.src/M000049.html +18 -0
- data/documentation/output/files/rdoc/classes/RubySelenium.src/M000050.html +18 -0
- data/documentation/output/files/rdoc/classes/RubySelenium.src/M000051.html +18 -0
- data/documentation/output/files/rdoc/classes/RubySelenium.src/M000052.html +18 -0
- data/documentation/output/files/rdoc/classes/RubySelenium.src/M000053.html +18 -0
- data/documentation/output/files/rdoc/classes/RubySelenium.src/M000054.html +18 -0
- data/documentation/output/files/rdoc/classes/RubySelenium.src/M000055.html +18 -0
- data/documentation/output/files/rdoc/classes/RubySelenium.src/M000056.html +21 -0
- data/documentation/output/files/rdoc/classes/RubySelenium.src/M000057.html +20 -0
- data/documentation/output/files/rdoc/classes/RubySeleniumConfig.html +182 -0
- data/documentation/output/files/rdoc/classes/RubySeleniumConfig.src/M000093.html +22 -0
- data/documentation/output/files/rdoc/classes/RubySeleniumConfig.src/M000094.html +27 -0
- data/documentation/output/files/rdoc/classes/RubySeleniumConfig.src/M000095.html +25 -0
- data/documentation/output/files/rdoc/classes/RubySeleniumGenerator.html +334 -0
- data/documentation/output/files/rdoc/classes/RubySeleniumGenerator.src/M000079.html +18 -0
- data/documentation/output/files/rdoc/classes/RubySeleniumGenerator.src/M000080.html +18 -0
- data/documentation/output/files/rdoc/classes/RubySeleniumGenerator.src/M000081.html +18 -0
- data/documentation/output/files/rdoc/classes/RubySeleniumGenerator.src/M000082.html +18 -0
- data/documentation/output/files/rdoc/classes/RubySeleniumGenerator.src/M000083.html +18 -0
- data/documentation/output/files/rdoc/classes/RubySeleniumGenerator.src/M000084.html +18 -0
- data/documentation/output/files/rdoc/classes/RubySeleniumGenerator.src/M000085.html +21 -0
- data/documentation/output/files/rdoc/classes/RubySeleniumGenerator.src/M000086.html +21 -0
- data/documentation/output/files/rdoc/classes/RubySeleniumGenerator.src/M000087.html +21 -0
- data/documentation/output/files/rdoc/classes/RubySeleniumGenerator.src/M000088.html +21 -0
- data/documentation/output/files/rdoc/classes/RubySeleniumGenerator.src/M000089.html +21 -0
- data/documentation/output/files/rdoc/classes/RubySeleniumGenerator.src/M000090.html +21 -0
- data/documentation/output/files/rdoc/classes/RubySeleniumGenerator.src/M000091.html +21 -0
- data/documentation/output/files/rdoc/classes/RubySeleniumGenerator.src/M000092.html +21 -0
- data/documentation/output/files/rdoc/classes/String.html +137 -0
- data/documentation/output/files/rdoc/classes/String.src/M000096.html +20 -0
- data/documentation/output/files/rdoc/classes/Templates.html +184 -0
- data/documentation/output/files/rdoc/classes/Templates.src/M000058.html +20 -0
- data/documentation/output/files/rdoc/classes/Templates.src/M000059.html +18 -0
- data/documentation/output/files/rdoc/classes/Templates.src/M000060.html +18 -0
- data/documentation/output/files/rdoc/classes/Templates.src/M000061.html +18 -0
- data/documentation/output/files/rdoc/created.rid +1 -0
- data/documentation/output/files/rdoc/files/lib/RubySeleniumGenerator_rb.html +101 -0
- data/documentation/output/files/rdoc/files/lib/RubySelenium_rb.html +352 -0
- data/documentation/output/files/rdoc/fr_class_index.html +36 -0
- data/documentation/output/files/rdoc/fr_file_index.html +28 -0
- data/documentation/output/files/rdoc/fr_method_index.html +122 -0
- data/documentation/output/files/rdoc/index.html +24 -0
- data/documentation/output/files/rdoc/rdoc-style.css +208 -0
- data/documentation/output/images/background.jpg +0 -0
- data/documentation/output/images/blanklogo_noswirl.jpg +0 -0
- data/documentation/output/images/blanklogo_withswirl.jpg +0 -0
- data/documentation/output/images/left1.jpg +0 -0
- data/documentation/output/images/left1bg.jpg +0 -0
- data/documentation/output/images/mainbackground.jpg +0 -0
- data/documentation/output/images/menudivider.jpg +0 -0
- data/documentation/output/images/tempheadline.jpg +0 -0
- data/documentation/output/images/templogo.jpg +0 -0
- data/documentation/output/images/toplogobg.jpg +0 -0
- data/documentation/output/images/welcome.jpg +0 -0
- data/documentation/output/index.html +108 -0
- data/documentation/output/menu/my_menu.css +1 -0
- data/documentation/output/menu/my_menu.js +1 -0
- data/documentation/src/css/style.css +36 -0
- data/documentation/src/documentation.template.txt +51 -0
- data/documentation/src/files/rdoc/classes/Batch_Generator.html +274 -0
- data/documentation/src/files/rdoc/classes/Batch_Generator.src/M000062.html +19 -0
- data/documentation/src/files/rdoc/classes/Batch_Generator.src/M000063.html +26 -0
- data/documentation/src/files/rdoc/classes/Batch_Generator.src/M000064.html +22 -0
- data/documentation/src/files/rdoc/classes/Batch_Generator.src/M000065.html +20 -0
- data/documentation/src/files/rdoc/classes/Batch_Generator.src/M000066.html +23 -0
- data/documentation/src/files/rdoc/classes/Batch_Generator.src/M000067.html +18 -0
- data/documentation/src/files/rdoc/classes/Batch_Generator.src/M000068.html +20 -0
- data/documentation/src/files/rdoc/classes/Batch_Generator.src/M000069.html +18 -0
- data/documentation/src/files/rdoc/classes/Batch_Generator.src/M000070.html +23 -0
- data/documentation/src/files/rdoc/classes/Batch_Generator.src/M000071.html +20 -0
- data/documentation/src/files/rdoc/classes/GenerateCommand.html +137 -0
- data/documentation/src/files/rdoc/classes/GenerateCommand.src/M000001.html +54 -0
- data/documentation/src/files/rdoc/classes/HTML_File_Generator.html +229 -0
- data/documentation/src/files/rdoc/classes/HTML_File_Generator.src/M000072.html +23 -0
- data/documentation/src/files/rdoc/classes/HTML_File_Generator.src/M000073.html +20 -0
- data/documentation/src/files/rdoc/classes/HTML_File_Generator.src/M000074.html +18 -0
- data/documentation/src/files/rdoc/classes/HTML_File_Generator.src/M000075.html +19 -0
- data/documentation/src/files/rdoc/classes/HTML_File_Generator.src/M000076.html +18 -0
- data/documentation/src/files/rdoc/classes/HTML_File_Generator.src/M000077.html +18 -0
- data/documentation/src/files/rdoc/classes/HTML_File_Generator.src/M000078.html +18 -0
- data/documentation/src/files/rdoc/classes/MissingConfigurationFile.html +111 -0
- data/documentation/src/files/rdoc/classes/MissingRubyTestFiles.html +111 -0
- data/documentation/src/files/rdoc/classes/RubySelenium.html +1523 -0
- data/documentation/src/files/rdoc/classes/RubySelenium.src/M000002.html +20 -0
- data/documentation/src/files/rdoc/classes/RubySelenium.src/M000003.html +18 -0
- data/documentation/src/files/rdoc/classes/RubySelenium.src/M000004.html +18 -0
- data/documentation/src/files/rdoc/classes/RubySelenium.src/M000005.html +18 -0
- data/documentation/src/files/rdoc/classes/RubySelenium.src/M000006.html +18 -0
- data/documentation/src/files/rdoc/classes/RubySelenium.src/M000007.html +18 -0
- data/documentation/src/files/rdoc/classes/RubySelenium.src/M000008.html +18 -0
- data/documentation/src/files/rdoc/classes/RubySelenium.src/M000009.html +18 -0
- data/documentation/src/files/rdoc/classes/RubySelenium.src/M000010.html +18 -0
- data/documentation/src/files/rdoc/classes/RubySelenium.src/M000011.html +18 -0
- data/documentation/src/files/rdoc/classes/RubySelenium.src/M000012.html +18 -0
- data/documentation/src/files/rdoc/classes/RubySelenium.src/M000013.html +18 -0
- data/documentation/src/files/rdoc/classes/RubySelenium.src/M000014.html +18 -0
- data/documentation/src/files/rdoc/classes/RubySelenium.src/M000015.html +18 -0
- data/documentation/src/files/rdoc/classes/RubySelenium.src/M000016.html +18 -0
- data/documentation/src/files/rdoc/classes/RubySelenium.src/M000017.html +18 -0
- data/documentation/src/files/rdoc/classes/RubySelenium.src/M000018.html +18 -0
- data/documentation/src/files/rdoc/classes/RubySelenium.src/M000019.html +18 -0
- data/documentation/src/files/rdoc/classes/RubySelenium.src/M000020.html +18 -0
- data/documentation/src/files/rdoc/classes/RubySelenium.src/M000021.html +18 -0
- data/documentation/src/files/rdoc/classes/RubySelenium.src/M000022.html +18 -0
- data/documentation/src/files/rdoc/classes/RubySelenium.src/M000023.html +18 -0
- data/documentation/src/files/rdoc/classes/RubySelenium.src/M000024.html +18 -0
- data/documentation/src/files/rdoc/classes/RubySelenium.src/M000025.html +18 -0
- data/documentation/src/files/rdoc/classes/RubySelenium.src/M000026.html +18 -0
- data/documentation/src/files/rdoc/classes/RubySelenium.src/M000027.html +18 -0
- data/documentation/src/files/rdoc/classes/RubySelenium.src/M000028.html +18 -0
- data/documentation/src/files/rdoc/classes/RubySelenium.src/M000029.html +18 -0
- data/documentation/src/files/rdoc/classes/RubySelenium.src/M000030.html +18 -0
- data/documentation/src/files/rdoc/classes/RubySelenium.src/M000031.html +18 -0
- data/documentation/src/files/rdoc/classes/RubySelenium.src/M000032.html +18 -0
- data/documentation/src/files/rdoc/classes/RubySelenium.src/M000033.html +18 -0
- data/documentation/src/files/rdoc/classes/RubySelenium.src/M000034.html +18 -0
- data/documentation/src/files/rdoc/classes/RubySelenium.src/M000035.html +18 -0
- data/documentation/src/files/rdoc/classes/RubySelenium.src/M000036.html +18 -0
- data/documentation/src/files/rdoc/classes/RubySelenium.src/M000037.html +18 -0
- data/documentation/src/files/rdoc/classes/RubySelenium.src/M000038.html +18 -0
- data/documentation/src/files/rdoc/classes/RubySelenium.src/M000039.html +18 -0
- data/documentation/src/files/rdoc/classes/RubySelenium.src/M000040.html +18 -0
- data/documentation/src/files/rdoc/classes/RubySelenium.src/M000041.html +18 -0
- data/documentation/src/files/rdoc/classes/RubySelenium.src/M000042.html +18 -0
- data/documentation/src/files/rdoc/classes/RubySelenium.src/M000043.html +18 -0
- data/documentation/src/files/rdoc/classes/RubySelenium.src/M000044.html +18 -0
- data/documentation/src/files/rdoc/classes/RubySelenium.src/M000045.html +18 -0
- data/documentation/src/files/rdoc/classes/RubySelenium.src/M000046.html +18 -0
- data/documentation/src/files/rdoc/classes/RubySelenium.src/M000047.html +18 -0
- data/documentation/src/files/rdoc/classes/RubySelenium.src/M000048.html +18 -0
- data/documentation/src/files/rdoc/classes/RubySelenium.src/M000049.html +18 -0
- data/documentation/src/files/rdoc/classes/RubySelenium.src/M000050.html +18 -0
- data/documentation/src/files/rdoc/classes/RubySelenium.src/M000051.html +18 -0
- data/documentation/src/files/rdoc/classes/RubySelenium.src/M000052.html +18 -0
- data/documentation/src/files/rdoc/classes/RubySelenium.src/M000053.html +18 -0
- data/documentation/src/files/rdoc/classes/RubySelenium.src/M000054.html +18 -0
- data/documentation/src/files/rdoc/classes/RubySelenium.src/M000055.html +18 -0
- data/documentation/src/files/rdoc/classes/RubySelenium.src/M000056.html +21 -0
- data/documentation/src/files/rdoc/classes/RubySelenium.src/M000057.html +20 -0
- data/documentation/src/files/rdoc/classes/RubySeleniumConfig.html +182 -0
- data/documentation/src/files/rdoc/classes/RubySeleniumConfig.src/M000093.html +22 -0
- data/documentation/src/files/rdoc/classes/RubySeleniumConfig.src/M000094.html +27 -0
- data/documentation/src/files/rdoc/classes/RubySeleniumConfig.src/M000095.html +25 -0
- data/documentation/src/files/rdoc/classes/RubySeleniumGenerator.html +334 -0
- data/documentation/src/files/rdoc/classes/RubySeleniumGenerator.src/M000079.html +18 -0
- data/documentation/src/files/rdoc/classes/RubySeleniumGenerator.src/M000080.html +18 -0
- data/documentation/src/files/rdoc/classes/RubySeleniumGenerator.src/M000081.html +18 -0
- data/documentation/src/files/rdoc/classes/RubySeleniumGenerator.src/M000082.html +18 -0
- data/documentation/src/files/rdoc/classes/RubySeleniumGenerator.src/M000083.html +18 -0
- data/documentation/src/files/rdoc/classes/RubySeleniumGenerator.src/M000084.html +18 -0
- data/documentation/src/files/rdoc/classes/RubySeleniumGenerator.src/M000085.html +21 -0
- data/documentation/src/files/rdoc/classes/RubySeleniumGenerator.src/M000086.html +21 -0
- data/documentation/src/files/rdoc/classes/RubySeleniumGenerator.src/M000087.html +21 -0
- data/documentation/src/files/rdoc/classes/RubySeleniumGenerator.src/M000088.html +21 -0
- data/documentation/src/files/rdoc/classes/RubySeleniumGenerator.src/M000089.html +21 -0
- data/documentation/src/files/rdoc/classes/RubySeleniumGenerator.src/M000090.html +21 -0
- data/documentation/src/files/rdoc/classes/RubySeleniumGenerator.src/M000091.html +21 -0
- data/documentation/src/files/rdoc/classes/RubySeleniumGenerator.src/M000092.html +21 -0
- data/documentation/src/files/rdoc/classes/String.html +137 -0
- data/documentation/src/files/rdoc/classes/String.src/M000096.html +20 -0
- data/documentation/src/files/rdoc/classes/Templates.html +184 -0
- data/documentation/src/files/rdoc/classes/Templates.src/M000058.html +20 -0
- data/documentation/src/files/rdoc/classes/Templates.src/M000059.html +18 -0
- data/documentation/src/files/rdoc/classes/Templates.src/M000060.html +18 -0
- data/documentation/src/files/rdoc/classes/Templates.src/M000061.html +18 -0
- data/documentation/src/files/rdoc/created.rid +1 -0
- data/documentation/src/files/rdoc/files/lib/RubySeleniumGenerator_rb.html +101 -0
- data/documentation/src/files/rdoc/files/lib/RubySelenium_rb.html +352 -0
- data/documentation/src/files/rdoc/fr_class_index.html +36 -0
- data/documentation/src/files/rdoc/fr_file_index.html +28 -0
- data/documentation/src/files/rdoc/fr_method_index.html +122 -0
- data/documentation/src/files/rdoc/index.html +24 -0
- data/documentation/src/files/rdoc/rdoc-style.css +208 -0
- data/documentation/src/images/background.jpg +0 -0
- data/documentation/src/images/blanklogo_noswirl.jpg +0 -0
- data/documentation/src/images/blanklogo_withswirl.jpg +0 -0
- data/documentation/src/images/left1.jpg +0 -0
- data/documentation/src/images/left1bg.jpg +0 -0
- data/documentation/src/images/mainbackground.jpg +0 -0
- data/documentation/src/images/menudivider.jpg +0 -0
- data/documentation/src/images/tempheadline.jpg +0 -0
- data/documentation/src/images/templogo.jpg +0 -0
- data/documentation/src/images/toplogobg.jpg +0 -0
- data/documentation/src/images/welcome.jpg +0 -0
- data/documentation/src/index.template.txt +50 -0
- data/documentation/src/keywords/documentation_user_guide_content.keyword.txt +134 -0
- data/documentation/src/keywords/generic_browser_title.keyword.txt +1 -0
- data/documentation/src/keywords/generic_published.keyword.rb +1 -0
- data/documentation/src/keywords/index_content.keyword.txt +51 -0
- data/documentation/src/menu/default_menu/default_menu.css +44 -0
- data/documentation/src/menu/default_menu/default_menu.html.txt +28 -0
- data/documentation/src/menu/default_menu/default_menu.js +19 -0
- data/documentation/src/menu/menu_config.txt +1 -0
- data/documentation/src/menu/my_menu/my_menu.html.txt +15 -0
- data/lib/RubySelenium.rb +1088 -0
- data/lib/RubySeleniumGenerator.rb +570 -0
- data/rubySelenium.gemspec +48 -0
- data/unittests/TODO.txt +10 -0
- data/unittests/all_tests.rb +5 -0
- data/unittests/rubySeleniumConfig.txt +41 -0
- data/unittests/test-structure/001_MyFirstTest.rb +15 -0
- data/unittests/test-structure/002_MySecondTest.rb +15 -0
- data/unittests/test-structure/003_MyThirdTest.rb +15 -0
- data/unittests/test-structure/execute_all_tests.rb +2 -0
- data/unittests/test-structure/generate_all_tests.rb +2 -0
- data/unittests/test-structure/rubySeleniumConfig.txt +41 -0
- data/unittests/test_batch_generator.rb +58 -0
- data/unittests/test_command_line_execution.rb +17 -0
- data/unittests/test_config_file.rb +28 -0
- data/unittests/test_html_file_creation.rb +93 -0
- data/unittests/test_selenium_core_api.rb +108 -0
- metadata +374 -0
@@ -0,0 +1,134 @@
|
|
1
|
+
render=bluecloth
|
2
|
+
|
3
|
+
rubySelenium User Guide
|
4
|
+
==================
|
5
|
+
|
6
|
+
Contents
|
7
|
+
---------
|
8
|
+
|
9
|
+
1. [Introduction to rubySelenium](#intro)
|
10
|
+
2. [Downloading & Local Installation](#install)
|
11
|
+
3. [Configuring rubySelenium](#config)
|
12
|
+
4. [Writing your First rubySelenium Test](#create)
|
13
|
+
|
14
|
+
<h2 id="intro">Introduction to rubySelenium</h2>
|
15
|
+
|
16
|
+
rubySelenium is esentially an HTML generation tool for the FitRunner version of Selenium. In my opinion the FitRunner version of Selenium is stable and reliable, executes quickly and feels nice to use.
|
17
|
+
|
18
|
+
However it is very time consuming to type out HTML constantly when you have a large number of scripts to create and maintain. Which is where rubySelenium fits in.
|
19
|
+
|
20
|
+
The Benefits of rubySelenium:
|
21
|
+
|
22
|
+
* Write tests programmatically gaining the benefit of using a fully featured OO programming language.
|
23
|
+
|
24
|
+
* Easier to write tests by functionally decomposing sections of functionality into logical chunks, e.g. Login may be executed on every script - by having one login function it saves typing out the html or code in every script.
|
25
|
+
|
26
|
+
* Maintaining test scripts can be a huge problem if a change needs to be made 100 different scripts rather than in just 1 place. Also it's far easier to maintain Ruby code than verbose HTML.
|
27
|
+
|
28
|
+
* Backwards compatibility with the scripts written in HTML by hand as the tests can sit along side exisiting tests.
|
29
|
+
|
30
|
+
<h2 id="install">Downloading and Local Installation</h2>
|
31
|
+
|
32
|
+
### Install rubySelenium Gem
|
33
|
+
|
34
|
+
Download the latest rubySelenium gem, open a cmd window in the same directory as the gem file and then install as below:
|
35
|
+
|
36
|
+
gem install rubySelenium
|
37
|
+
|
38
|
+
Next create a folder (e.g. rubySeleniumScripts) that will contain yor ruby tests from where you will generate the HTML tests. Using a cmd window change directory into your new folder.
|
39
|
+
|
40
|
+
Now type: rubyselenium-seed
|
41
|
+
|
42
|
+
You will see a stack of files and folder have been generated that are the core rubySelenium files required. You are now fully installed.
|
43
|
+
|
44
|
+
<h2 id="config">Configuring rubySelenium</h2>
|
45
|
+
|
46
|
+
There is a file called rubySeleniumConfig.txt in your newly created rubySelenium folder. there are a number of settings in here of which the most important is the TEST_LOCATION setting.
|
47
|
+
|
48
|
+
This sets the path that is followed when you execute one of the scripts locally. The path should point to the location of the tests folder inside the rubySeleniumScripts folder that resides on your local server.
|
49
|
+
|
50
|
+
e.g. if you navigate to http://localhost:9081/Selenium/tests/rubySeleniumScripts/tests/seleniumTestRunner.html to find your tests then you should set this property to http://localhost:9081/Selenium/tests/rubySeleniumScripts
|
51
|
+
|
52
|
+
After editing the file save the changes
|
53
|
+
|
54
|
+
|
55
|
+
<h2 id="create">Writing your First rubySelenium Test</h2>
|
56
|
+
|
57
|
+
Now you are ready to write your first test.
|
58
|
+
|
59
|
+
Make sure that your project web server on your local machine is up and running.
|
60
|
+
Now create a new file inside the rubySeleniumScripts folder called 001_myTest.rb
|
61
|
+
(I find it most best to use the scite editor that comes with Ruby - right click the file and select edit and it open in Scite by default) You must create the test with following notation: 3 digits underscore testname fullstop rb => 001_mytestname.rb
|
62
|
+
|
63
|
+
Copy and paste the following code into that file: (without the numbers down the side!)
|
64
|
+
|
65
|
+
1 require 'RubySelenium'
|
66
|
+
2 require 'methods/seleniumMethods'
|
67
|
+
3
|
68
|
+
4 # Create new SeleniumMethods and RubySelenium instances
|
69
|
+
5 t = SeleniumMethods.new(s = RubySelenium.new)
|
70
|
+
6
|
71
|
+
7 # Start the test and supply a name for the test
|
72
|
+
8 s.start("001_myTest")
|
73
|
+
9
|
74
|
+
10 loginType = "DirectInvestor"
|
75
|
+
11
|
76
|
+
12 # begin test
|
77
|
+
13 t.login(loginType)
|
78
|
+
14
|
79
|
+
15 # complete test
|
80
|
+
16 s.complete
|
81
|
+
17 s.go
|
82
|
+
|
83
|
+
|
84
|
+
Lets go through the main points of this script to understand what each part does.
|
85
|
+
|
86
|
+
Line 1 you require the rubySelenium API
|
87
|
+
|
88
|
+
Line 2 you require the additional methods that live in the methods directory (you can put your own methods in here)
|
89
|
+
|
90
|
+
Line 5 you create the RubySelenium object and the SeleniumMethods object so you can use them. Here the SelemiumMethods
|
91
|
+
object wants the RubySelenium object to be passed into to it so we can access the API inside the additional methods.
|
92
|
+
|
93
|
+
Line 8 tells rubySelenium that the test is starting and you must give it the name of the test without the .rb
|
94
|
+
|
95
|
+
Line 10 is a variable that hols a string with the type of user we want to login to the system with
|
96
|
+
|
97
|
+
Line 13 refers to the additional user defined helper method that is in the methods folder. It takes a string that specifies the type of user to login with.
|
98
|
+
|
99
|
+
Line 16 tells rubySelenium that the test ends here
|
100
|
+
|
101
|
+
Line 17 instructs rubySelenium to execute this test locally when you execute this script
|
102
|
+
|
103
|
+
|
104
|
+
To run the test locally you can either double click on the 001_myTest.rb file or from the cmd you can type:
|
105
|
+
ruby 001_myTest.rb and also you from within Scite you can hit F5 to run the test.
|
106
|
+
|
107
|
+
Now if you are unable to run this example you can try writing and running your own simlpe script to get an idea of how it works. So make a new file in the rubySeleniumScripts directory called 002_myFirstTest.rb and write something such as:
|
108
|
+
|
109
|
+
1 require 'RubySelenium'
|
110
|
+
2
|
111
|
+
3 # Create new RubySelenium instance
|
112
|
+
4 s = RubySelenium.new
|
113
|
+
5
|
114
|
+
6 # Start the test and supply a name for the test
|
115
|
+
7 s.start("002_myFirstTest")
|
116
|
+
8
|
117
|
+
9 # begin test
|
118
|
+
10 s.open("path/to/your/project")
|
119
|
+
11 s.type("username", "myusername")
|
120
|
+
12 s.type("password", "mypassword")
|
121
|
+
13 s.clickAndWait("loginbutton")
|
122
|
+
14 s.verifyTextPresent("mytext")
|
123
|
+
15
|
124
|
+
16 # complete test
|
125
|
+
17 s.complete
|
126
|
+
18 s.go
|
127
|
+
|
128
|
+
|
129
|
+
You access the rubySelenium API through the object you created called s
|
130
|
+
So now all the selenium commands are available by using s.command
|
131
|
+
e.g. s.clickAndWait("login")
|
132
|
+
|
133
|
+
When you created the SeleniumMethods object you assigned it to t so to access user defined methods from that object you access them via t.login("DirectInvestor2) etc.
|
134
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
rubySelenium
|
@@ -0,0 +1 @@
|
|
1
|
+
"Copyright � 2004 Kingsley Hendrickse. All rights reserved -last published #{Time.now}"
|
@@ -0,0 +1,51 @@
|
|
1
|
+
render=bluecloth
|
2
|
+
Welcome to the rubySelenium Homepage
|
3
|
+
====================================
|
4
|
+
|
5
|
+
rubySelenium 0.0.8
|
6
|
+
------------------
|
7
|
+
|
8
|
+
rubySelenium 0.0.8 is available for [download](http://rubyforge.org/frs/?group_id=825).
|
9
|
+
|
10
|
+
This release works with Selenium version 0.5.0:
|
11
|
+
* Everything seems usable / No major problems
|
12
|
+
* Only works with version 0.5.0 of Selenium (next version coming soon)
|
13
|
+
* Website and documentation is still in progress - this is just a rough set of documentation to get going
|
14
|
+
* Only works on windows at the moment
|
15
|
+
|
16
|
+
rubySelenium
|
17
|
+
------------
|
18
|
+
|
19
|
+
rubySelenium is esentially an HTML generation tool for the FitRunner version of Selenium. In my opinion the FitRunner version of Selenium is stable and reliable, executes quickly and feels nice to use.
|
20
|
+
|
21
|
+
However it is very time consuming to type out HTML constantly when you have a large number of scripts to create and maintain. Which is where rubySelenium fits in.
|
22
|
+
|
23
|
+
|
24
|
+
License
|
25
|
+
-------
|
26
|
+
|
27
|
+
rubySelenium is released under the Ruby License.
|
28
|
+
|
29
|
+
|
30
|
+
Documentation
|
31
|
+
-------------
|
32
|
+
|
33
|
+
You can view the documentation for the current release [online](documentation.html). Documentation is also included in the source distribution.
|
34
|
+
|
35
|
+
|
36
|
+
CVS Access
|
37
|
+
----------
|
38
|
+
|
39
|
+
You can access the rubySelenium CVS. Check out the module RubySelenium from the server. The details are available at the [RubyForge project](http://rubyforge.org/projects/staticweb/) site.
|
40
|
+
|
41
|
+
|
42
|
+
Getting Help
|
43
|
+
------------
|
44
|
+
|
45
|
+
Please use rubySelenium help [forum](http://rubyforge.org/forum/?group_id=825).
|
46
|
+
|
47
|
+
|
48
|
+
Getting Involved
|
49
|
+
----------------
|
50
|
+
|
51
|
+
The development related discussions takes place on the [developer's mailing list](http://rubyforge.org/mail/?group_id=825). Follow the link to subscribe.
|
@@ -0,0 +1,44 @@
|
|
1
|
+
#nav {
|
2
|
+
font: normal 11px verdana;
|
3
|
+
}
|
4
|
+
|
5
|
+
ul {
|
6
|
+
margin: 0;
|
7
|
+
padding: 0;
|
8
|
+
list-style: none;
|
9
|
+
width: 150px; /* Width of Menu Items */
|
10
|
+
border-bottom: 1px solid #ccc;
|
11
|
+
}
|
12
|
+
|
13
|
+
ul li {
|
14
|
+
position: relative;
|
15
|
+
}
|
16
|
+
|
17
|
+
li ul {
|
18
|
+
position: absolute;
|
19
|
+
left: 149px; /* Set 1px less than menu width */
|
20
|
+
top: 0;
|
21
|
+
display: none;
|
22
|
+
}
|
23
|
+
|
24
|
+
/* Styles for Menu Items */
|
25
|
+
ul li a {
|
26
|
+
display: block;
|
27
|
+
text-decoration: none;
|
28
|
+
color: #777;
|
29
|
+
background: #fff; /* IE6 Bug */
|
30
|
+
padding: 5px;
|
31
|
+
border: 1px solid #ccc;
|
32
|
+
border-bottom: 0;
|
33
|
+
}
|
34
|
+
|
35
|
+
/* Fix IE. Hide from IE Mac */
|
36
|
+
* html ul li { float: left; height: 1%; }
|
37
|
+
* html ul li a { height: 1%; }
|
38
|
+
/* End */
|
39
|
+
|
40
|
+
ul li a:hover { color: #E2144A; background: #f9f9f9; } /* Hover Styles */
|
41
|
+
|
42
|
+
li ul li a { padding: 2px 5px; } /* Sub Menu Styles */
|
43
|
+
|
44
|
+
li:hover ul, li.over ul { display: block; } /* The magic */
|
@@ -0,0 +1,28 @@
|
|
1
|
+
<ul id="nav">
|
2
|
+
<li><a href="#">Home</a></li>
|
3
|
+
<li><a href="#">About</a>
|
4
|
+
<ul>
|
5
|
+
<li><a href="#">History</a></li>
|
6
|
+
<li><a href="#">Team</a></li>
|
7
|
+
<li><a href="#">Offices</a></li>
|
8
|
+
</ul>
|
9
|
+
</li>
|
10
|
+
<li><a href="#">Services</a>
|
11
|
+
<ul>
|
12
|
+
<li><a href="#">Web Design</a></li>
|
13
|
+
<li><a href="#">Internet Marketing</a></li>
|
14
|
+
<li><a href="#">Hosting</a></li>
|
15
|
+
<li><a href="#">Domain Names</a></li>
|
16
|
+
<li><a href="#">Broadband</a></li>
|
17
|
+
</ul>
|
18
|
+
</li>
|
19
|
+
<li><a href="#">Contact Us</a>
|
20
|
+
<ul>
|
21
|
+
<li><a href="#">United Kingdom</a></li>
|
22
|
+
<li><a href="#">France</a></li>
|
23
|
+
<li><a href="#">USA</a></li>
|
24
|
+
<li><a href="#">Australia</a></li>
|
25
|
+
</ul>
|
26
|
+
</li>
|
27
|
+
|
28
|
+
</ul>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
// JavaScript Document
|
2
|
+
|
3
|
+
startList = function() {
|
4
|
+
if (document.all&&document.getElementById) {
|
5
|
+
navRoot = document.getElementById("nav");
|
6
|
+
for (i=0; i<navRoot.childNodes.length; i++) {
|
7
|
+
node = navRoot.childNodes[i];
|
8
|
+
if (node.nodeName=="LI") {
|
9
|
+
node.onmouseover=function() {
|
10
|
+
this.className+=" over";
|
11
|
+
}
|
12
|
+
node.onmouseout=function() {
|
13
|
+
this.className=this.className.replace(" over", "");
|
14
|
+
}
|
15
|
+
}
|
16
|
+
}
|
17
|
+
}
|
18
|
+
}
|
19
|
+
window.onload=startList;
|
@@ -0,0 +1 @@
|
|
1
|
+
MENU = my_menu
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<img src="images/menudivider.jpg" width="150" height="6" border="0" alt=""><BR>
|
2
|
+
<a href="index.html">Home</a><BR>
|
3
|
+
<img src="images/menudivider.jpg" width="150" height="6" border="0" alt=""><BR>
|
4
|
+
<a href="documentation.html">Documentation</a><BR>
|
5
|
+
<img src="images/menudivider.jpg" width="150" height="6" border="0" alt=""><BR>
|
6
|
+
<a href="files/rdoc/index.html">rubySelenium API</a><BR>
|
7
|
+
<img src="images/menudivider.jpg" width="150" height="6" border="0" alt=""><BR>
|
8
|
+
<!--
|
9
|
+
<a href="http://www.webaddresshere.com">Services</a><BR>
|
10
|
+
<img src="images/menudivider.jpg" width="150" height="6" border="0" alt=""><BR>
|
11
|
+
<a href="http://www.webaddresshere.com">Contact us</a><BR>
|
12
|
+
<img src="images/menudivider.jpg" width="150" height="6" border="0" alt=""><BR>
|
13
|
+
<a href="http://www.webaddresshere.com">Bookmark</a><BR>
|
14
|
+
<img src="images/menudivider.jpg" width="150" height="6" border="0" alt=""><BR>
|
15
|
+
-->
|
data/lib/RubySelenium.rb
ADDED
@@ -0,0 +1,1088 @@
|
|
1
|
+
=begin rdoc
|
2
|
+
rubySelenium is a html generation tool for Selenium.
|
3
|
+
|
4
|
+
Selenium Reference
|
5
|
+
-----------------------------------------------------
|
6
|
+
A command is what tells Selenium what to do. Selenium commands come in two 'flavors', Actions and Assertions.
|
7
|
+
Each command call is one line in the test table of the form:
|
8
|
+
|
9
|
+
command target value
|
10
|
+
|
11
|
+
Actions are commands that generally manipulate the state of the application.
|
12
|
+
They do things like "click this link" and "select that option".
|
13
|
+
If an Action fails, or has an error, the execution of the current test is stopped.
|
14
|
+
|
15
|
+
Checks verify the state of the application conforms to what is expected.
|
16
|
+
Examples include "make sure the page title is X" and "check that this checkbox is checked".
|
17
|
+
It is possible to tell Selenium to stop the test when an Assertion fails,
|
18
|
+
or to simply record the failure and continue.
|
19
|
+
|
20
|
+
Element Locators tell Selenium which HTML element a command refers to.
|
21
|
+
Many commands require an Element Locator as the "target" attribute.
|
22
|
+
Examples of Element Locators include "elementId" and "document.forms[0].element".
|
23
|
+
These are described more clearly in the next section.
|
24
|
+
|
25
|
+
Element Locators
|
26
|
+
-----------------------------------------------------
|
27
|
+
|
28
|
+
Element Locators allow Selenium to identify which HTML element a command refers to.
|
29
|
+
There are several forms of Element Locators.
|
30
|
+
|
31
|
+
id
|
32
|
+
------------
|
33
|
+
|
34
|
+
locates an element based on the id or name attribute of the element.
|
35
|
+
If an element with a matching id is found, it is chosen.
|
36
|
+
|
37
|
+
* id=TheElementId
|
38
|
+
|
39
|
+
name
|
40
|
+
------------
|
41
|
+
|
42
|
+
locates an element based on the name attribute of the element. The first element with a matching name is chosen.
|
43
|
+
|
44
|
+
* name=TheElementName
|
45
|
+
|
46
|
+
identifier
|
47
|
+
------------
|
48
|
+
|
49
|
+
locates an element based on the id or name attribute of the element. If an element with a matching id is found, it is chosen. Otherwise, the first element with a matching name is chosen.
|
50
|
+
|
51
|
+
* name=TheElementName
|
52
|
+
|
53
|
+
dom
|
54
|
+
------------
|
55
|
+
|
56
|
+
finds an element using the built-in DOM traversal syntax of HTML. DOM Traversal locators must begin with "document.".
|
57
|
+
|
58
|
+
* dom=document.forms['myForm'].myDropdown
|
59
|
+
* dom=document.images[56]
|
60
|
+
|
61
|
+
xpath
|
62
|
+
------------
|
63
|
+
|
64
|
+
locates an element using a defined XPath expression. XPath locators must begin with "//".
|
65
|
+
|
66
|
+
* xpath=//img[@alt='The image alt text']
|
67
|
+
* xpath=//table[@id='table1']//tr[4]/td[2]
|
68
|
+
|
69
|
+
link
|
70
|
+
------------
|
71
|
+
|
72
|
+
finds a link with the specified text.
|
73
|
+
|
74
|
+
* link=The link text
|
75
|
+
|
76
|
+
Without a locator prefix, a default set of locators will be used. The default set of locators is:
|
77
|
+
|
78
|
+
1. identifier
|
79
|
+
2. dom
|
80
|
+
3. xpath
|
81
|
+
|
82
|
+
Select Option Specifiers
|
83
|
+
-----------------------------------------------------
|
84
|
+
|
85
|
+
Select Option Specifiers provide different ways of specifying options of an HTML Select element (e.g. for selecting a specific option, or for asserting that the selected option satisfies a specification). There are several forms of Select Option Specifier.
|
86
|
+
|
87
|
+
label
|
88
|
+
------------
|
89
|
+
|
90
|
+
matches options based on their labels, i.e. the visible text. Does glob matching so that, for example, "fo*r" will match <option>foobar</option>.
|
91
|
+
|
92
|
+
* label=TheLabel
|
93
|
+
|
94
|
+
value
|
95
|
+
------------
|
96
|
+
|
97
|
+
matches options based on their values. Does glob matching so that, for example, "fo*r" will match <option value="foobar">Some option</option>.
|
98
|
+
|
99
|
+
* value=TheValue
|
100
|
+
|
101
|
+
id
|
102
|
+
------------
|
103
|
+
|
104
|
+
matches options based on their ids. Does glob matching so that, for example, "opt*1" will match <option id="option1" value="foobar">Some option</option>.
|
105
|
+
|
106
|
+
* id=option1
|
107
|
+
|
108
|
+
index
|
109
|
+
------------
|
110
|
+
|
111
|
+
matches an option based on its index (offset from zero).
|
112
|
+
|
113
|
+
* index=2
|
114
|
+
|
115
|
+
Without a prefix, the default is to only match on labels.
|
116
|
+
|
117
|
+
Selenium Actions
|
118
|
+
-----------------------------------------------------
|
119
|
+
|
120
|
+
Actions tell Selenium to do something in the application. They generally represent something a user would do.
|
121
|
+
|
122
|
+
Many Actions can be called with the "AndWait" suffix.
|
123
|
+
This suffix tells Selenium that the action will cause the browser to make a call to the server,
|
124
|
+
and that Selenium should wait for a new page to load.The exceptions to this pattern
|
125
|
+
are the "open" and "click" actions, which will both wait for a page to load by default.
|
126
|
+
|
127
|
+
Selenium Checks
|
128
|
+
-----------------------------------------------------
|
129
|
+
|
130
|
+
Checks are used to verify the state of the application. They can be used to check the value of a form field,
|
131
|
+
the presense of some text, or the URL of the current page.
|
132
|
+
|
133
|
+
All Selenium Checks can be used in 2 modes, "assert" and "verify". These behave identically,
|
134
|
+
except that when an "assert" check fails, the test is aborted. When a "verify" check fails,
|
135
|
+
the test will continue execution. This allows a single "assert" to ensure that the application
|
136
|
+
is on the correct page, followed by a bunch of "verify" checks to test form field values, labels, etc.
|
137
|
+
|
138
|
+
=end
|
139
|
+
|
140
|
+
require 'optparse'
|
141
|
+
require 'ostruct'
|
142
|
+
|
143
|
+
RUBY_SELENIUM_VERSION = "RubySelenium 0.0.7"
|
144
|
+
DEFAULT_CONFIG_FILE = "rubySeleniumConfig.txt"
|
145
|
+
DEFAULT_RUBY_TEST_LOCATION = "."
|
146
|
+
|
147
|
+
class MissingConfigurationFile < ArgumentError ; end
|
148
|
+
class MissingRubyTestFiles < ArgumentError ; end
|
149
|
+
|
150
|
+
class String
|
151
|
+
|
152
|
+
def _h(target,value = " ")
|
153
|
+
if value== " " || value == nil || value.empty? == true then value = " " elsif value == "[empty]" then value = "" end
|
154
|
+
if target == "[empty]" then target = "" end
|
155
|
+
"<tr><td>#{self}</td><td>#{target}</td><td>#{value}</td></tr>"
|
156
|
+
end
|
157
|
+
|
158
|
+
end
|
159
|
+
|
160
|
+
class RubySeleniumConfig
|
161
|
+
|
162
|
+
SeleniumConfig = Struct.new("SeleniumConfig", :property, :value)
|
163
|
+
|
164
|
+
def initialize(config_file)
|
165
|
+
begin
|
166
|
+
@config = File.readlines(config_file)
|
167
|
+
rescue
|
168
|
+
raise MissingConfigurationFile, "Can't find rubySeleniumConfig.txt file - please check it's in the same directory as your ruby tests"
|
169
|
+
end
|
170
|
+
end
|
171
|
+
|
172
|
+
def parse_config_file
|
173
|
+
rem_array = []
|
174
|
+
prop_array = []
|
175
|
+
@config.each do |line|
|
176
|
+
if line.match(/^#/)
|
177
|
+
rem_array << line
|
178
|
+
else
|
179
|
+
unless line.match(/^\n$/) then prop_array << line.chomp end
|
180
|
+
end
|
181
|
+
end
|
182
|
+
return prop_array - rem_array
|
183
|
+
end
|
184
|
+
|
185
|
+
def properties
|
186
|
+
config_hash = {}
|
187
|
+
parse_config_file.each do |data|
|
188
|
+
split = data.split("=")
|
189
|
+
property = split[0].gsub(/\s*/, "")
|
190
|
+
value = split[1].gsub(/$\s*/, "").gsub(/^\s*/, "")
|
191
|
+
config_hash.store(property,SeleniumConfig.new(property, value))
|
192
|
+
end
|
193
|
+
return config_hash
|
194
|
+
end
|
195
|
+
|
196
|
+
end
|
197
|
+
|
198
|
+
rubySeleniumConfig = RubySeleniumConfig.new(DEFAULT_CONFIG_FILE).properties
|
199
|
+
GENERATE_LOCATION = rubySeleniumConfig['GENERATE_LOCATION'].value
|
200
|
+
LOGGING = eval(rubySeleniumConfig['LOGGING'].value)
|
201
|
+
GO_PATH = rubySeleniumConfig['TEST_LOCATION'].value
|
202
|
+
IE_PATH = rubySeleniumConfig['IE_LOCATION'].value
|
203
|
+
FF_PATH = rubySeleniumConfig['FF_LOCATION'].value
|
204
|
+
|
205
|
+
class GenerateCommand
|
206
|
+
|
207
|
+
def self.parse(args)
|
208
|
+
|
209
|
+
options = OpenStruct.new
|
210
|
+
options.html_generate_location = GENERATE_LOCATION
|
211
|
+
options.webservice_location = "http://localhost:2001"
|
212
|
+
|
213
|
+
opts = OptionParser.new do |opts|
|
214
|
+
opts.banner = "Usage: generate.rb [options]"
|
215
|
+
|
216
|
+
opts.separator ""
|
217
|
+
opts.separator "Specific options:"
|
218
|
+
|
219
|
+
opts.on("-g", "--html_generate_location LOCATION", "Specify a location to generate the html tests") do |loc|
|
220
|
+
options.html_generate_location = loc
|
221
|
+
end
|
222
|
+
|
223
|
+
opts.separator ""
|
224
|
+
|
225
|
+
opts.on("-w", "--webservice_location LOCATION", "Specify a location to find the webservice") do |loc|
|
226
|
+
options.webservice_location = loc
|
227
|
+
end
|
228
|
+
|
229
|
+
opts.separator ""
|
230
|
+
opts.separator "Common options:"
|
231
|
+
|
232
|
+
opts.on_tail("-h", "--help", "Show this message") do
|
233
|
+
puts opts
|
234
|
+
exit
|
235
|
+
end
|
236
|
+
|
237
|
+
opts.on_tail("-v", "--version", "Show version") do
|
238
|
+
puts RUBY_SELENIUM_VERSION
|
239
|
+
exit
|
240
|
+
end
|
241
|
+
end
|
242
|
+
|
243
|
+
opts.parse!(args)
|
244
|
+
options
|
245
|
+
end
|
246
|
+
end
|
247
|
+
|
248
|
+
command_line_options = GenerateCommand.parse(ARGV)
|
249
|
+
COMMAND_GENERATE_LOCATION = command_line_options.html_generate_location
|
250
|
+
WEBSERVICE_LOCATION = command_line_options.webservice_location
|
251
|
+
|
252
|
+
class RubySelenium
|
253
|
+
|
254
|
+
attr_accessor :rubyWebService
|
255
|
+
SeleniumCommand = Struct.new("SeleniumCommand", :command)
|
256
|
+
SeleniumScript = Struct.new("SeleniumScript", :name, :commands)
|
257
|
+
|
258
|
+
def initialize(test_script_name)
|
259
|
+
@test_script_name = test_script_name
|
260
|
+
@test_script_commands = []
|
261
|
+
@rubyWebService = WEBSERVICE_LOCATION
|
262
|
+
end
|
263
|
+
|
264
|
+
# Opens a URL in the test frame. This accepts both relative and absolute URLs.
|
265
|
+
# Note: The URL must be on the same site as Selenium due to security restrictions in the browser (Cross Site Scripting).
|
266
|
+
# target: The URL to open.
|
267
|
+
# value: ignored
|
268
|
+
#
|
269
|
+
# examples:
|
270
|
+
#
|
271
|
+
# selenium.open("/mypage")
|
272
|
+
# selenium.open("http://localhost/")
|
273
|
+
def open(target,value = " ")
|
274
|
+
@test_script_commands << SeleniumCommand.new( "open"._h(target,value) )
|
275
|
+
end
|
276
|
+
|
277
|
+
# Types (enters) text into an input field. This works for text fields, combo boxes, check boxes, etc.
|
278
|
+
# target: The id of the element where the text should be typed.
|
279
|
+
# value: The text that will be typed, or the value of the option selected (not the visible text).
|
280
|
+
#
|
281
|
+
# examples:
|
282
|
+
#
|
283
|
+
# selenium.type("nameField","John Smith"
|
284
|
+
def type(target,value = " ")
|
285
|
+
@test_script_commands << SeleniumCommand.new( "type"._h(target,value) )
|
286
|
+
end
|
287
|
+
|
288
|
+
# examples:
|
289
|
+
#
|
290
|
+
# selenium.typeAndWait("textBoxThatSubmitsOnChange", "newValue"
|
291
|
+
def typeAndWait(target,value = " ")
|
292
|
+
@test_script_commands << SeleniumCommand.new( "typeAndWait"._h(target,value) )
|
293
|
+
end
|
294
|
+
|
295
|
+
# Clicks on a link, button, checkbox or radio button. If the click action causes a new page to load (like a link usually does), use "clickAndWait".
|
296
|
+
# target: The id of the element that should be clicked.
|
297
|
+
# value: ignored
|
298
|
+
#
|
299
|
+
# examples:
|
300
|
+
#
|
301
|
+
# selenium.click("aCheckbox")
|
302
|
+
#
|
303
|
+
# Selenium will always automatically click on a popup dialog raised by the alert() or confirm() methods.
|
304
|
+
# (The exception is those raised during 'onload', which are not yet handled by Selenium).
|
305
|
+
# You must use [verify|assert]Alert or [verify|assert]Confirmation to tell Selenium that you expect the popup dialog.
|
306
|
+
# You may use chooseCancelOnNextConfirmation to click 'cancel' on the next confirmation dialog instead of clicking 'OK'.
|
307
|
+
def click(target,value = " ")
|
308
|
+
@test_script_commands << SeleniumCommand.new( "click"._h(target,value) )
|
309
|
+
end
|
310
|
+
|
311
|
+
# examples:
|
312
|
+
#
|
313
|
+
# selenium.clickAndWait("submitButton")
|
314
|
+
def clickAndWait(target,value = " ")
|
315
|
+
@test_script_commands << SeleniumCommand.new( "clickAndWait"._h(target,value) )
|
316
|
+
end
|
317
|
+
|
318
|
+
# Select an option from a drop-down, based on a Select Option Specifier.
|
319
|
+
# target: An Element Locator specifying an HTML Select element.
|
320
|
+
# value: An Option Specifier. If more than one option matches (e.g. due to the use of globs like "f*b*",
|
321
|
+
# or due to more than one option having the same label or value), then the first option that matches is selected.
|
322
|
+
#
|
323
|
+
# examples:
|
324
|
+
#
|
325
|
+
# selenium.select("dropDown", "Australian Dollars")
|
326
|
+
def select(target,value = " ")
|
327
|
+
@test_script_commands << SeleniumCommand.new( "select"._h(target,value) )
|
328
|
+
end
|
329
|
+
|
330
|
+
# examples:
|
331
|
+
#
|
332
|
+
# selenium.selectAndWait("currencySelector","AUD")
|
333
|
+
def selectAndWait(target,value = " ")
|
334
|
+
@test_script_commands << SeleniumCommand.new( "selectAndWait"._h(target,value) )
|
335
|
+
end
|
336
|
+
|
337
|
+
# Selects a popup window. Once a popup window has been selected, all commands go to that window.
|
338
|
+
# To select the main window again, use "null" as the target.
|
339
|
+
# target: The id of the window to select.
|
340
|
+
# value: ignored
|
341
|
+
#
|
342
|
+
# examples:
|
343
|
+
#
|
344
|
+
# selenium.selectWindow("myPopupWindow")
|
345
|
+
def selectWindow(target,value = " ")
|
346
|
+
@test_script_commands << SeleniumCommand.new( "selectWindow"._h(target,value) )
|
347
|
+
end
|
348
|
+
|
349
|
+
# Pauses the execution of the test script for a specified amount of time. This is useful for debugging a script or pausing to wait for some server side action.
|
350
|
+
# target: The number of milliseconds to pause.
|
351
|
+
# value: ignored
|
352
|
+
#
|
353
|
+
# examples:
|
354
|
+
#
|
355
|
+
# selenium.pause("5000")
|
356
|
+
def pause(target,value = " ")
|
357
|
+
@test_script_commands << SeleniumCommand.new( "pause"._h(target,value) )
|
358
|
+
end
|
359
|
+
|
360
|
+
# Waits for a specified input (e.g. a hidden field) to have a specified value. Will succeed immediately if the input already has the value. Is implemented by polling for the value. Warning: can block indefinitely if the input never has the specified value.
|
361
|
+
# target: The input field.
|
362
|
+
# value: The value the input field must have before continuing.
|
363
|
+
#
|
364
|
+
# example:
|
365
|
+
#
|
366
|
+
# selenium.waitForValue("finishIndication", "isfinished")
|
367
|
+
def waitForValue(target,value = " ")
|
368
|
+
@test_script_commands << SeleniumCommand.new( "waitForValue"._h(target,value) )
|
369
|
+
end
|
370
|
+
|
371
|
+
# Simulates the user clicking the "back" button on their browser.
|
372
|
+
# target: ignored
|
373
|
+
# value: ignored
|
374
|
+
#
|
375
|
+
# examples:
|
376
|
+
#
|
377
|
+
# selenium.goBack
|
378
|
+
def goBack(target = "[empty]",value = "[empty]")
|
379
|
+
@test_script_commands << SeleniumCommand.new( "goBack"._h(target,value) )
|
380
|
+
end
|
381
|
+
|
382
|
+
# Simulates the user clicking the "close" button in the titlebar of a popup window.
|
383
|
+
# target: ignored
|
384
|
+
# value: ignored
|
385
|
+
#
|
386
|
+
# examples:
|
387
|
+
#
|
388
|
+
# selenium.close
|
389
|
+
def close(target = "[empty]",value = "[empty]")
|
390
|
+
@test_script_commands << SeleniumCommand.new( "close"._h(target,value) )
|
391
|
+
end
|
392
|
+
|
393
|
+
# Stores the value of a parameter into a variable
|
394
|
+
# target: The value to store. This can be constructed using either variable substitution or
|
395
|
+
# javascript evaluation, as detailed in 'Parameter construction and Variables' (below).
|
396
|
+
# value: Name of the variable to store the value into.
|
397
|
+
#
|
398
|
+
# examples:
|
399
|
+
#
|
400
|
+
# selenium.store("Mr John Smith","fullname")
|
401
|
+
def store(target,value = " ")
|
402
|
+
@test_script_commands << SeleniumCommand.new( "store"._h(target,value) )
|
403
|
+
end
|
404
|
+
|
405
|
+
# Stores the value of an input field into a variable.
|
406
|
+
# target: The id of the input field.
|
407
|
+
# value: Name of the variable to store the field value into.
|
408
|
+
#
|
409
|
+
# examples:
|
410
|
+
#
|
411
|
+
# selenium.storeValue("userName", "userID")
|
412
|
+
def storeValue(target,value = " ")
|
413
|
+
@test_script_commands << SeleniumCommand.new( "storeValue"._h(target,value) )
|
414
|
+
end
|
415
|
+
|
416
|
+
# Stores the text of an element into a variable.
|
417
|
+
# target: The id of the element.
|
418
|
+
# value: Name of the variable to store the element text into.
|
419
|
+
#
|
420
|
+
# examples:
|
421
|
+
#
|
422
|
+
# selenium.storeText("currentDate", "expectedStartDate")
|
423
|
+
# selenium.verifyValue("startDate", "${expectedStartDate}")
|
424
|
+
def storeText(target,value = " ")
|
425
|
+
@test_script_commands << SeleniumCommand.new( "storeText"._h(target,value) )
|
426
|
+
end
|
427
|
+
|
428
|
+
# Verifies the location of the current page being tested.
|
429
|
+
# target: The expected relative location of the page.
|
430
|
+
# value: ignored
|
431
|
+
#
|
432
|
+
# examples:
|
433
|
+
#
|
434
|
+
# selenium.verifyLocation("/mypage")
|
435
|
+
def verifyLocation(target,value = " ")
|
436
|
+
@test_script_commands << SeleniumCommand.new( "verifyLocation"._h(target,value) )
|
437
|
+
end
|
438
|
+
|
439
|
+
# examples:
|
440
|
+
#
|
441
|
+
# selenium.assertLocation("/mypage")
|
442
|
+
def assertLocation(target,value = " ")
|
443
|
+
@test_script_commands << SeleniumCommand.new( "assertLocation"._h(target,value) )
|
444
|
+
end
|
445
|
+
|
446
|
+
# Verifies the title of the current page.
|
447
|
+
# target: The expected page title.
|
448
|
+
# value: ignored
|
449
|
+
#
|
450
|
+
# examples:
|
451
|
+
#
|
452
|
+
# selenium.verifyTitle("My Page")
|
453
|
+
def verifyTitle(target,value = " ")
|
454
|
+
@test_script_commands << SeleniumCommand.new( "verifyTitle"._h(target,value) )
|
455
|
+
end
|
456
|
+
|
457
|
+
# examples:
|
458
|
+
#
|
459
|
+
# selenium.assertTitle("My Page")
|
460
|
+
def assertTitle(target,value = " ")
|
461
|
+
@test_script_commands << SeleniumCommand.new( "assertTitle"._h(target,value) )
|
462
|
+
end
|
463
|
+
|
464
|
+
# Verifies the value of an input field (or anything else with a value parameter).
|
465
|
+
# For checkbox/radio elements, the value will be "on" or "off" depending on whether the element is checked or not.
|
466
|
+
# target: The id of the element to verify.
|
467
|
+
# value: The expected value.
|
468
|
+
#
|
469
|
+
# examples:
|
470
|
+
#
|
471
|
+
# selenium.verifyValue("nameField", "John Smith")
|
472
|
+
def verifyValue(target,value = " ")
|
473
|
+
@test_script_commands << SeleniumCommand.new( "verifyValue"._h(target,value) )
|
474
|
+
end
|
475
|
+
|
476
|
+
# examples:
|
477
|
+
#
|
478
|
+
# selenium.assertValue("document.forms[2].nameField", "John Smith")
|
479
|
+
def assertValue(target,value = " ")
|
480
|
+
@test_script_commands << SeleniumCommand.new( "assertValue"._h(target,value) )
|
481
|
+
end
|
482
|
+
|
483
|
+
# Verifies that the selected option of a drop-down satisfies a specified Select Option Specifier.
|
484
|
+
# target: Locates the drop-down to verify.
|
485
|
+
# value: A Select Option Specifier that the selected option is expected to satisfy.
|
486
|
+
#
|
487
|
+
# examples:
|
488
|
+
#
|
489
|
+
# selenium.verifySelected("dropdown2", "John Smith")
|
490
|
+
def verifySelected(target,value = " ")
|
491
|
+
@test_script_commands << SeleniumCommand.new( "verifySelected"._h(target,value) )
|
492
|
+
end
|
493
|
+
|
494
|
+
# examples:
|
495
|
+
#
|
496
|
+
# selenium.assertSelected("document.forms[2].dropDown", "label=J* Smith")
|
497
|
+
def assertSelected(target,value = " ")
|
498
|
+
@test_script_commands << SeleniumCommand.new( "assertSelected"._h(target,value) )
|
499
|
+
end
|
500
|
+
|
501
|
+
# Verifies the labels of all options in a drop-down against a comma-separated list. Commas in an expected option can be escaped as ",".
|
502
|
+
# target: Locates the drop-down to verify.
|
503
|
+
# value: A comma-separated list of option labels.
|
504
|
+
#
|
505
|
+
# examples:
|
506
|
+
#
|
507
|
+
# selenium.verifySelectOptions("dropdown2", "John Smith,Dave Bird")
|
508
|
+
def verifySelectOptions(target,value = " ")
|
509
|
+
@test_script_commands << SeleniumCommand.new( "verifySelectOptions"._h(target,value) )
|
510
|
+
end
|
511
|
+
|
512
|
+
# examples:
|
513
|
+
#
|
514
|
+
# selenium.assertSelectOptions("document.forms[2].dropDown", "Smith\, J,Bird\, D")
|
515
|
+
def assertSelectOptions(target,value = " ")
|
516
|
+
@test_script_commands << SeleniumCommand.new( "assertSelectOptions"._h(target,value) )
|
517
|
+
end
|
518
|
+
|
519
|
+
# Verifies the text of an element. This works for any element that contains text.
|
520
|
+
# This command uses either the textContent (Mozilla-like browsers) or the innerText (IE-like browsers) of the element,
|
521
|
+
# which is the rendered text shown to the user.
|
522
|
+
# target: The id of the element to verify.
|
523
|
+
# value: The expected text.
|
524
|
+
#
|
525
|
+
# examples:
|
526
|
+
#
|
527
|
+
# selenium.verifyText("statusMessage", "Successful")
|
528
|
+
def verifyText(target,value = " ")
|
529
|
+
@test_script_commands << SeleniumCommand.new( "verifyText"._h(target,value) )
|
530
|
+
end
|
531
|
+
|
532
|
+
# examples:
|
533
|
+
#
|
534
|
+
# selenium.assertText("//div[@id='foo']//h1", "Successful")
|
535
|
+
def assertText(target,value = " ")
|
536
|
+
@test_script_commands << SeleniumCommand.new( "assertText"._h(target,value) )
|
537
|
+
end
|
538
|
+
|
539
|
+
# Verifies the value of an element attribute. An attribute is identified using the syntax <element-locator>@<attribute-name>.
|
540
|
+
# This works for all types of element locators.
|
541
|
+
# target: A locator string of the format <element-locator>@<attribute-name>
|
542
|
+
# value: The expected attribute value.
|
543
|
+
#
|
544
|
+
# examples:
|
545
|
+
#
|
546
|
+
# selenium.verifyAttribute("txt1@class", "bigAndBold")
|
547
|
+
# selenium.verifyAttribute("//img[@id='foo']/@alt", "alt-text")
|
548
|
+
def verifyAttribute(target,value = " ")
|
549
|
+
@test_script_commands << SeleniumCommand.new( "verifyAttribute"._h(target,value) )
|
550
|
+
end
|
551
|
+
|
552
|
+
# examples:
|
553
|
+
#
|
554
|
+
# selenium.assertAttribute("document.images[0]@alt", "alt-text")
|
555
|
+
def assertAttribute(target,value = " ")
|
556
|
+
@test_script_commands << SeleniumCommand.new( "assertAttribute"._h(target,value) )
|
557
|
+
end
|
558
|
+
|
559
|
+
# Verifies that the specified text appears somewhere on the rendered page shown to the user.
|
560
|
+
# target: The text that should be present.
|
561
|
+
# value: ignored
|
562
|
+
#
|
563
|
+
# examples:
|
564
|
+
#
|
565
|
+
# selenium.verifyTextPresent("You are now logged in."
|
566
|
+
def verifyTextPresent(target,value = " ")
|
567
|
+
@test_script_commands << SeleniumCommand.new( "verifyTextPresent"._h(target,value) )
|
568
|
+
end
|
569
|
+
|
570
|
+
# examples:
|
571
|
+
#
|
572
|
+
# selenium.assertTextPresent("You are now logged in."
|
573
|
+
def assertTextPresent(target,value = " ")
|
574
|
+
@test_script_commands << SeleniumCommand.new( "assertTextPresent"._h(target,value) )
|
575
|
+
end
|
576
|
+
|
577
|
+
# Verifies that the specified text does not appears anywhere on the rendered page.
|
578
|
+
# target: The text that should not be present.
|
579
|
+
# value: ignored
|
580
|
+
#
|
581
|
+
# examples:
|
582
|
+
#
|
583
|
+
# selenium.verifyTextNotPresent("You are now logged in."
|
584
|
+
def verifyTextNotPresent(target,value = " ")
|
585
|
+
@test_script_commands << SeleniumCommand.new( "verifyTextNotPresent"._h(target,value) )
|
586
|
+
end
|
587
|
+
|
588
|
+
# examples:
|
589
|
+
#
|
590
|
+
# selenium.assertTextNotPresent("You are now logged in."
|
591
|
+
def assertTextNotPresent(target,value = " ")
|
592
|
+
@test_script_commands << SeleniumCommand.new( "assertTextNotPresent"._h(target,value) )
|
593
|
+
end
|
594
|
+
|
595
|
+
# Verifies that the specified element is somewhere on the page.
|
596
|
+
# target: The element that should be present.
|
597
|
+
# value: ignored
|
598
|
+
#
|
599
|
+
# examples:
|
600
|
+
#
|
601
|
+
# selenium.verifyElementPresent("submitButton")
|
602
|
+
def verifyElementPresent(target,value = " ")
|
603
|
+
@test_script_commands << SeleniumCommand.new( "verifyElementPresent"._h(target,value) )
|
604
|
+
end
|
605
|
+
|
606
|
+
# examples:
|
607
|
+
#
|
608
|
+
# selenium.assertElementPresent("//img[@alt='foo']")
|
609
|
+
def assertElementPresent(target,value = " ")
|
610
|
+
@test_script_commands << SeleniumCommand.new( "assertElementPresent"._h(target,value) )
|
611
|
+
end
|
612
|
+
|
613
|
+
# Verifies that the specified element is not on the page.
|
614
|
+
# target: The element that should not be present.
|
615
|
+
# value: ignored
|
616
|
+
#
|
617
|
+
# examples:
|
618
|
+
#
|
619
|
+
# selenium.verifyElementNotPresent("cancelButton")
|
620
|
+
def verifyElementNotPresent(target,value = " ")
|
621
|
+
@test_script_commands << SeleniumCommand.new( "verifyElementNotPresent"._h(target,value) )
|
622
|
+
end
|
623
|
+
|
624
|
+
# examples:
|
625
|
+
#
|
626
|
+
# selenium.assertElementNotPresent("cancelButton"
|
627
|
+
def assertElementNotPresent(target,value = " ")
|
628
|
+
@test_script_commands << SeleniumCommand.new( "assertElementNotPresent"._h(target,value) )
|
629
|
+
end
|
630
|
+
|
631
|
+
# Verifies the text in a cell of a table. The correct syntax of the target is tableName.row.column, where row and column start at 0.
|
632
|
+
# target: The table, row, and column specified as table.row.col.
|
633
|
+
# value: The expected value of the cell.
|
634
|
+
#
|
635
|
+
# examples:
|
636
|
+
#
|
637
|
+
# selenium.verifyTable("myTable.1.6", "Submitted")
|
638
|
+
def verifyTable(target,value = " ")
|
639
|
+
@test_script_commands << SeleniumCommand.new( "verifyTable"._h(target,value) )
|
640
|
+
end
|
641
|
+
|
642
|
+
# examples:
|
643
|
+
#
|
644
|
+
# selenium.assertTable("results.0.2", "13")
|
645
|
+
def assertTable(target,value = " ")
|
646
|
+
@test_script_commands << SeleniumCommand.new( "assertTable"._h(target,value) )
|
647
|
+
end
|
648
|
+
|
649
|
+
# Verifies that the specified element is both present and visible.
|
650
|
+
# An element can be rendered invisible by setting the CSS "visibility" property to "hidden", or the "display" property to "none",
|
651
|
+
# either for the element itself or one if its ancestors.
|
652
|
+
# target: The element that should be visible.
|
653
|
+
# value: ignored
|
654
|
+
#
|
655
|
+
# examples:
|
656
|
+
#
|
657
|
+
# selenium.verifyVisible("postcode")
|
658
|
+
def verifyVisible(target,value = " ")
|
659
|
+
@test_script_commands << SeleniumCommand.new( "verifyVisible"._h(target,value) )
|
660
|
+
end
|
661
|
+
|
662
|
+
# examples:
|
663
|
+
#
|
664
|
+
# selenium.assertVisible("postcode")
|
665
|
+
def assertVisible(target,value = " ")
|
666
|
+
@test_script_commands << SeleniumCommand.new( "assertVisible"._h(target,value) )
|
667
|
+
end
|
668
|
+
|
669
|
+
# Verifies that the specified element is not visible. Elements that are simply not present are also considered invisible.
|
670
|
+
# target: The element that should not be visible.
|
671
|
+
# value: ignored
|
672
|
+
#
|
673
|
+
# examples:
|
674
|
+
#
|
675
|
+
# selenium.verifyNotVisible("postcode")
|
676
|
+
def verifyNotVisible(target,value = " ")
|
677
|
+
@test_script_commands << SeleniumCommand.new( "verifyNotVisible"._h(target,value) )
|
678
|
+
end
|
679
|
+
|
680
|
+
# examples:
|
681
|
+
#
|
682
|
+
# selenium.assertNotVisible("postcode")
|
683
|
+
def assertNotVisible(target,value = " ")
|
684
|
+
@test_script_commands << SeleniumCommand.new( "assertNotVisible"._h(target,value) )
|
685
|
+
end
|
686
|
+
|
687
|
+
# Verifies that the specified element is editable, ie. it's an input element, and hasn't been disabled.
|
688
|
+
# target: The element that should be editable.
|
689
|
+
# value: ignored
|
690
|
+
#
|
691
|
+
# examples:
|
692
|
+
#
|
693
|
+
# selenium.verifyEditable("shape")
|
694
|
+
def verifyEditable(target,value = " ")
|
695
|
+
@test_script_commands << SeleniumCommand.new( "verifyEditable"._h(target,value) )
|
696
|
+
end
|
697
|
+
|
698
|
+
# examples:
|
699
|
+
#
|
700
|
+
# selenium.assertEditable("shape")
|
701
|
+
def assertEditable(target,value = " ")
|
702
|
+
@test_script_commands << SeleniumCommand.new( "assertEditable"._h(target,value) )
|
703
|
+
end
|
704
|
+
|
705
|
+
# Verifies that the specified element is NOT editable, ie. it's NOT an input element, or has been disabled.
|
706
|
+
# target: The element that should be read-only.
|
707
|
+
# value: ignored
|
708
|
+
#
|
709
|
+
# examples:
|
710
|
+
#
|
711
|
+
# selenium.verifyNotEditable("creditLimit")
|
712
|
+
def verifyNotEditable(target,value = " ")
|
713
|
+
@test_script_commands << SeleniumCommand.new( "verifyNotEditable"._h(target,value) )
|
714
|
+
end
|
715
|
+
|
716
|
+
# examples:
|
717
|
+
#
|
718
|
+
# selenium.assertNotEditable("creditLimit")
|
719
|
+
def assertNotEditable(target,value = " ")
|
720
|
+
@test_script_commands << SeleniumCommand.new( "assertNotEditable"._h(target,value) )
|
721
|
+
end
|
722
|
+
|
723
|
+
# Verifies that a javascript alert was generated and that the text of the alert was as specified. Alerts must be verified in the same order that they were generated.
|
724
|
+
# Verifying an alert has the same effect as manually clicking OK. If an alert is generated but you do not verify it, the next Selenium action will fail.
|
725
|
+
#
|
726
|
+
# NOTE: under Selenium, javascript alerts will NOT pop up a visible alert dialog.
|
727
|
+
#
|
728
|
+
# NOTE: Selenium does NOT support javascript alerts that are generated in a page's onload() event handler.
|
729
|
+
# In this case a visible dialog WILL be generated and Selenium will hang until you manually click OK.
|
730
|
+
#
|
731
|
+
# target: The expected text of the alert.
|
732
|
+
# value: ignored
|
733
|
+
#
|
734
|
+
# examples:
|
735
|
+
#
|
736
|
+
# selenium.verifyAlert("Invalid Phone Number")
|
737
|
+
def verifyAlert(target,value = " ")
|
738
|
+
@test_script_commands << SeleniumCommand.new( "verifyAlert"._h(target,value) )
|
739
|
+
end
|
740
|
+
|
741
|
+
# examples:
|
742
|
+
#
|
743
|
+
# selenium.assertAlert("Invalid Phone Number")
|
744
|
+
def assertAlert(target,value = " ")
|
745
|
+
@test_script_commands << SeleniumCommand.new( "assertAlert"._h(target,value) )
|
746
|
+
end
|
747
|
+
|
748
|
+
# Verifies that a javascript confirmation dialog was generated and that the text of the dialog was as specified.
|
749
|
+
# Confirm dialogs must be verified in the same order that they were generated.
|
750
|
+
# By default, the confirm function will return true, having the same effect as manually clicking OK.
|
751
|
+
# This can be changed by prior execution of the chooseCancelOnNextConfirmation command (see below).
|
752
|
+
# If an confirmation is generated but you do not verify it, the next Selenium action will fail.
|
753
|
+
#
|
754
|
+
# NOTE: under Selenium, javascript confirmations will NOT pop up a visible dialog.
|
755
|
+
#
|
756
|
+
# NOTE: Selenium does NOT support javascript confirmations that are generated in a page's onload() event handler.
|
757
|
+
# In this case a visible dialog WILL be generated and Selenium will hang until you manually click OK.
|
758
|
+
#
|
759
|
+
# target: The expected text of the alert.
|
760
|
+
# value: ignored
|
761
|
+
#
|
762
|
+
# examples:
|
763
|
+
#
|
764
|
+
# selenium.verifyConfirmation("Invalid Phone Number")
|
765
|
+
def verifyConfirmation(target,value = " ")
|
766
|
+
@test_script_commands << SeleniumCommand.new( "verifyConfirmation"._h(target,value) )
|
767
|
+
end
|
768
|
+
|
769
|
+
# examples:
|
770
|
+
#
|
771
|
+
# selenium.assertConfirmation("Invalid Phone Number")
|
772
|
+
def assertConfirmation(target,value = " ")
|
773
|
+
@test_script_commands << SeleniumCommand.new( "assertConfirmation"._h(target,value) )
|
774
|
+
end
|
775
|
+
|
776
|
+
# Instructs Selenium to click Cancel on the next javascript confirmation dialog to be raised.
|
777
|
+
# By default, the confirm function will return true, having the same effect as manually clicking OK.
|
778
|
+
# After running this command, the next confirmation will behave as if the user had clicked Cancel.
|
779
|
+
# target: ignored
|
780
|
+
# value: ignored
|
781
|
+
#
|
782
|
+
# examples:
|
783
|
+
#
|
784
|
+
# selenium.chooseCancelOnNextConfirmation
|
785
|
+
def chooseCancelOnNextConfirmation(target = "[empty]",value = "[empty]")
|
786
|
+
@test_script_commands << SeleniumCommand.new( "chooseCancelOnNextConfirmation"._h(target,value) )
|
787
|
+
end
|
788
|
+
|
789
|
+
def ruby_selenium_script
|
790
|
+
SeleniumScript.new(@test_script_name, @test_script_commands)
|
791
|
+
end
|
792
|
+
|
793
|
+
def complete
|
794
|
+
generator = HTML_File_Generator.new(ruby_selenium_script)
|
795
|
+
generator.create_single_script_file
|
796
|
+
generator.create_test_runner_file
|
797
|
+
generator.create_test_suite_file
|
798
|
+
end
|
799
|
+
|
800
|
+
def go(browser = "IE")
|
801
|
+
if browser == "IE" then myBrowser = IE_PATH elsif browser == "FireFox" then myBrowser = FF_PATH end
|
802
|
+
complete
|
803
|
+
Thread.new{system("#{myBrowser} #{GO_PATH}/tests/seleniumTestRunner.html?auto=true")}
|
804
|
+
end
|
805
|
+
|
806
|
+
end
|
807
|
+
|
808
|
+
class HTML_File_Generator
|
809
|
+
|
810
|
+
def initialize(ruby_selenium_script)
|
811
|
+
#command_line_options = GenerateCommand.parse(ARGV)
|
812
|
+
@ruby_selenium_script = ruby_selenium_script
|
813
|
+
@generate_location = COMMAND_GENERATE_LOCATION
|
814
|
+
#@go_path = rubySeleniumConfig['TEST_LOCATION'].value
|
815
|
+
#@ie_path = rubySeleniumConfig['IE_LOCATION'].value
|
816
|
+
#@ff_path = rubySeleniumConfig['FF_LOCATION'].value
|
817
|
+
end
|
818
|
+
|
819
|
+
def generate_single_script
|
820
|
+
script_content = []
|
821
|
+
@ruby_selenium_script.commands.each{|html| script_content << html.command}
|
822
|
+
Templates.new(@ruby_selenium_script.name, script_content.join("\n")).selenium_test_script
|
823
|
+
end
|
824
|
+
|
825
|
+
def generate_test_runner
|
826
|
+
Templates.new("test_runner", "test_runner").selenium_test_runner
|
827
|
+
end
|
828
|
+
|
829
|
+
def generate_test_suite
|
830
|
+
test_suite_content = "<tr><td><a href=\"#{@ruby_selenium_script.name}.html\">#{@ruby_selenium_script.name}</a></td></tr>"
|
831
|
+
Templates.new("test_suite", "test_suite", test_suite_content).selenium_test_suite
|
832
|
+
end
|
833
|
+
|
834
|
+
def create_single_script_file
|
835
|
+
File.open(@generate_location + "/" + @ruby_selenium_script.name + ".html", "w"){|f| f.print generate_single_script}
|
836
|
+
end
|
837
|
+
|
838
|
+
def create_test_runner_file
|
839
|
+
File.open("#{@generate_location}/seleniumTestRunner.html", "w"){|f| f.print generate_test_runner}
|
840
|
+
end
|
841
|
+
|
842
|
+
def create_test_suite_file
|
843
|
+
File.open("#{@generate_location}/seleniumTestSuite.html", "w"){|f| f.print generate_test_suite}
|
844
|
+
end
|
845
|
+
end
|
846
|
+
|
847
|
+
class Batch_Generator
|
848
|
+
|
849
|
+
def initialize(ruby_tests_location = DEFAULT_RUBY_TEST_LOCATION)
|
850
|
+
@ruby_tests_location = ruby_tests_location
|
851
|
+
@generate_location = COMMAND_GENERATE_LOCATION
|
852
|
+
end
|
853
|
+
|
854
|
+
def build_tests_list
|
855
|
+
test_list = []
|
856
|
+
Dir.entries(@ruby_tests_location).each do |file|
|
857
|
+
if file.match(/^[\d]{3}_/) then test_list << "#{@ruby_tests_location}/#{file}" end
|
858
|
+
end
|
859
|
+
if test_list.size == 0
|
860
|
+
raise MissingRubyTestFiles, "Can't find any rubySelenium tests in directory #{@ruby_tests_location}"
|
861
|
+
else
|
862
|
+
return test_list.sort
|
863
|
+
end
|
864
|
+
end
|
865
|
+
|
866
|
+
def build_tests_array
|
867
|
+
tests_array = []
|
868
|
+
build_tests_list.each do |test|
|
869
|
+
tests_array << File.readlines(test)
|
870
|
+
end
|
871
|
+
tests_array
|
872
|
+
end
|
873
|
+
|
874
|
+
def remove_go_commands_from_tests_array
|
875
|
+
build_tests_array.each do |test|
|
876
|
+
test.each{|line| if line.match(/^\w+\.go/) then test.delete(line) end}
|
877
|
+
end
|
878
|
+
end
|
879
|
+
|
880
|
+
def generate_test_suite_for_all_files
|
881
|
+
test_suite_content = []
|
882
|
+
build_tests_list.each do |filename|
|
883
|
+
test_name = filename.split("/")[1].split(".")[0]
|
884
|
+
test_suite_content << "<tr><td><a href=\"#{test_name}.html\">#{test_name}</a></td></tr>\n"
|
885
|
+
end
|
886
|
+
Templates.new("test_suite", "test_suite", test_suite_content).selenium_test_suite
|
887
|
+
end
|
888
|
+
|
889
|
+
def create_test_suite_file_for_all_files
|
890
|
+
File.open("#{@generate_location}/seleniumTestSuite.html", "w"){|f| f.print generate_test_suite_for_all_files}
|
891
|
+
end
|
892
|
+
|
893
|
+
def find_html_contents_of_generation_directory
|
894
|
+
html_array = []
|
895
|
+
Dir.entries(@generate_location).each{|file| if file.split(".")[1] == "html" then html_array << "#{@generate_location}/#{file}" end }
|
896
|
+
html_array
|
897
|
+
end
|
898
|
+
|
899
|
+
def delete_html_files
|
900
|
+
find_html_contents_of_generation_directory.each{|file| if File.exists?(file) then File.delete(file) end }
|
901
|
+
end
|
902
|
+
|
903
|
+
def create_all_test_files
|
904
|
+
delete_html_files
|
905
|
+
remove_go_commands_from_tests_array.each do |test|
|
906
|
+
if LOGGING then File.open("generate_log.txt","a"){|f| f.puts Time.now, test.to_s} end
|
907
|
+
eval test.to_s
|
908
|
+
end
|
909
|
+
create_test_suite_file_for_all_files
|
910
|
+
end
|
911
|
+
|
912
|
+
def go(browser = "IE")
|
913
|
+
if browser == "IE" then myBrowser = IE_PATH elsif browser == "FireFox" then myBrowser = FF_PATH end
|
914
|
+
create_all_test_files
|
915
|
+
Thread.new{system("#{myBrowser} #{GO_PATH}/tests/seleniumTestRunner.html?auto=true")}
|
916
|
+
end
|
917
|
+
end
|
918
|
+
|
919
|
+
class Templates
|
920
|
+
|
921
|
+
def initialize(script_file_name = "", script_content = "", test_suite_content = "")
|
922
|
+
@script_file_name = script_file_name
|
923
|
+
@script_content = script_content
|
924
|
+
@test_suite_content = test_suite_content
|
925
|
+
end
|
926
|
+
|
927
|
+
def selenium_test_script
|
928
|
+
html = <<-EOF
|
929
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
930
|
+
<html>
|
931
|
+
<head>
|
932
|
+
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
|
933
|
+
<title>#{@script_file_name}</title>
|
934
|
+
</head>
|
935
|
+
<body>
|
936
|
+
<table cellpadding="1" cellspacing="1" border="1">
|
937
|
+
<tbody>
|
938
|
+
<tr>
|
939
|
+
<td rowspan="1" colspan="3">#{@script_file_name}<br>
|
940
|
+
</td>
|
941
|
+
</tr>
|
942
|
+
#{@script_content}
|
943
|
+
</tbody>
|
944
|
+
</table>
|
945
|
+
</body>
|
946
|
+
</html><table>
|
947
|
+
<tr>
|
948
|
+
<td><b>Selenium Id</b></td>
|
949
|
+
<td id="SeleniumKey"></td>
|
950
|
+
</tr>
|
951
|
+
</table>
|
952
|
+
EOF
|
953
|
+
end
|
954
|
+
|
955
|
+
def selenium_test_suite
|
956
|
+
html = <<-EOF
|
957
|
+
<html>
|
958
|
+
<head>
|
959
|
+
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
|
960
|
+
<title>Portal Framework Functional Testing</title>
|
961
|
+
</head>
|
962
|
+
<body>
|
963
|
+
<table cellpadding="1" cellspacing="1" border="1">
|
964
|
+
<tbody>
|
965
|
+
<tr><td><b>seleniumTestSuite</b></td></tr>
|
966
|
+
#{@test_suite_content}
|
967
|
+
</tbody>
|
968
|
+
</table>
|
969
|
+
</body>
|
970
|
+
</html>
|
971
|
+
EOF
|
972
|
+
end
|
973
|
+
|
974
|
+
def selenium_test_runner
|
975
|
+
html = <<-EOF
|
976
|
+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
977
|
+
<html>
|
978
|
+
<head>
|
979
|
+
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type" />
|
980
|
+
|
981
|
+
<title>Selenium Functional Test Runner</title>
|
982
|
+
<script language="JavaScript" type="text/javascript" src="../../../html-xpath/html-xpath-patched.js"></script>
|
983
|
+
<script language="JavaScript" type="text/javascript" src="../../../selenium-browserbot.js"></script>
|
984
|
+
<script language="JavaScript" type="text/javascript" src="../../../selenium-api.js"></script>
|
985
|
+
<script language="JavaScript" type="text/javascript" src="../../../selenium-commandhandlers.js"></script>
|
986
|
+
<script language="JavaScript" type="text/javascript" src="../../../selenium-executionloop.js"></script>
|
987
|
+
<script language="JavaScript" type="text/javascript" src="../../../selenium-fitrunner.js"></script>
|
988
|
+
<script language="JavaScript" type="text/javascript" src="../../../selenium-logging.js"></script>
|
989
|
+
<script language="JavaScript" type="text/javascript" src="../../../htmlutils.js"></script>
|
990
|
+
<script language="JavaScript" type="text/javascript" src="../../../selenium-domviewer.js"></script>
|
991
|
+
<script language="JavaScript" type="text/javascript" src="../../../xpath.js"></script>
|
992
|
+
<script language="JavaScript" type="text/javascript" src="../../../user-extensions.js"></script>
|
993
|
+
<link rel="stylesheet" type="text/css" href="../../../selenium.css" />
|
994
|
+
</head>
|
995
|
+
|
996
|
+
<body onload="start();">
|
997
|
+
|
998
|
+
<table class="layout">
|
999
|
+
<form action="" name="controlPanel">
|
1000
|
+
|
1001
|
+
<!-- Suite, Test, Control Panel -->
|
1002
|
+
|
1003
|
+
<tr class="selenium">
|
1004
|
+
<td width="25%" height="30%" rowspan="2"><iframe name="testSuiteFrame" id="testSuiteFrame" src="seleniumTestSuite.html"></iframe></td>
|
1005
|
+
<td width="50%" height="30%" rowspan="2"><iframe name="testFrame" id="testFrame"></iframe></td>
|
1006
|
+
<th width="25%" height="1" class="header">
|
1007
|
+
<h1><a href="http://selenium.thoughtworks.com" title="The Selenium Project">Selenium</a> TestRunner</h1>
|
1008
|
+
</th>
|
1009
|
+
</tr>
|
1010
|
+
|
1011
|
+
<tr class="selenium">
|
1012
|
+
<td width="25%" height="30%" id="controlPanel">
|
1013
|
+
|
1014
|
+
<table id="controls">
|
1015
|
+
<tr>
|
1016
|
+
<td>
|
1017
|
+
<b>Run:</b>
|
1018
|
+
<button type="button" id="runTest" onclick="runSingleTest();"><em>Selected</em> Test</button>
|
1019
|
+
<button type="button" id="runSuite" onclick="startTestSuite();"><strong>All</strong> Tests</button>
|
1020
|
+
</td>
|
1021
|
+
</tr>
|
1022
|
+
<tr>
|
1023
|
+
<td>
|
1024
|
+
<b>Mode:</b>
|
1025
|
+
<label><input id="modeRun" type="radio" name="runMode" value="0" checked="checked"/>Run</label>
|
1026
|
+
<label><input id="modeWalk" type="radio" name="runMode" value="500" />Walk</label>
|
1027
|
+
<label><input id="modeStep" type="radio" name="runMode" value="-1" />Step</label>
|
1028
|
+
</td>
|
1029
|
+
</tr>
|
1030
|
+
<tr>
|
1031
|
+
<td>
|
1032
|
+
<button type="button" id="domViewer1" onclick="newRoot=getIframeDocument(getElementById('myiframe'));window.open('../../domviewer.html');return false;">View DOM</button>
|
1033
|
+
<button type="button" id="continueTest" disabled="disabled">Next/Continue</button>
|
1034
|
+
</td>
|
1035
|
+
</tr>
|
1036
|
+
</table>
|
1037
|
+
|
1038
|
+
<table id="stats" align="center">
|
1039
|
+
<tr>
|
1040
|
+
<td colspan="2" align="right">Elapsed:</td>
|
1041
|
+
<td id="elapsedTime" colspan="2">00.00</td>
|
1042
|
+
</tr>
|
1043
|
+
<tr>
|
1044
|
+
<th colspan="2">Tests</th>
|
1045
|
+
<th colspan="2">Commands</th>
|
1046
|
+
</tr>
|
1047
|
+
<tr>
|
1048
|
+
<td class="count" id="testRuns">0</td>
|
1049
|
+
<td>run</td>
|
1050
|
+
<td class="count" id="commandPasses">0</td>
|
1051
|
+
<td>passed</td>
|
1052
|
+
</tr>
|
1053
|
+
<tr>
|
1054
|
+
<td class="count" id="testFailures">0</td>
|
1055
|
+
<td>failed</td>
|
1056
|
+
<td class="count" id="commandFailures">0</td>
|
1057
|
+
<td>failed</td>
|
1058
|
+
</tr>
|
1059
|
+
<tr>
|
1060
|
+
<td colspan="2"></td>
|
1061
|
+
<td class="count" id="commandErrors">0</td>
|
1062
|
+
<td>incomplete</td>
|
1063
|
+
</tr>
|
1064
|
+
</table>
|
1065
|
+
</td>
|
1066
|
+
</tr>
|
1067
|
+
|
1068
|
+
<!-- AUT -->
|
1069
|
+
<tr>
|
1070
|
+
<td colspan="3" height="70%"><iframe name="myiframe" id="myiframe" src="../../../TestRunner-splash.html"></iframe></td>
|
1071
|
+
</tr>
|
1072
|
+
</form>
|
1073
|
+
</table>
|
1074
|
+
|
1075
|
+
<div id="logging-console">
|
1076
|
+
<h1>Javascript Log Console (<a id="closeLog" href="javascript:LOG.hide()">Close</a> <a href="javascript:LOG.clear();LOG.hide();">Clear</a>)</h1>
|
1077
|
+
<ul id="log-list"/>
|
1078
|
+
</div>
|
1079
|
+
<script language="javascript">
|
1080
|
+
LOG = new Logger(LEVEL_WARN);
|
1081
|
+
LOG.hide();
|
1082
|
+
</script>
|
1083
|
+
</body>
|
1084
|
+
</html>
|
1085
|
+
EOF
|
1086
|
+
end
|
1087
|
+
|
1088
|
+
end
|