<commit_before>!1 Website testing using ''scenario'' and !-BrowserTest-!


On this page we test whether we check the prices of a couple of houses for sale in Utrecht, The Netherlands. 
This test continues where ScriptTest left of. It uses a [[Slim scenario][.FitNesse.UserGuide.WritingAcceptanceTests.SliM.ScenarioTable]] to define a parameterized script.
This is then invoked multiple times from a [[Decision table][.FitNesse.UserGuide.WritingAcceptanceTests.SliM.DecisionTable]], once for each row.


The configuration of Selenium (i.e. which browser to use) and starting the browser session is done in the SuiteSetup. Which allows this configuration to be shared between tests. Closing the browser is done in SuiteTearDown, which happens after all tests are completed.

|scenario|check original price _|address, city              |
|open    |http://www.funda.nl                               |
|enter   |@{address}, @{city}   |as|Plaats, buurt, adres etc|
|note    |select option from autocomplete                   |
|press   |down                                              |
|press   |enter                                             |
|click   |Zoek                                              |
|click   |@{address}                                        |
|$price= |value of              |Vraagprijs                 |
|$state= |value of              |Status                     |

|script|browser test|

|check original price                             |
|address       |city   |price?        |state?     |
|Maliebaan 73 D|Utrecht|€ 295.000 k.k.|Beschikbaar|
|Gageldijk 104 |Utrecht|€ 900.000 k.k.|Beschikbaar|



Writing the scenario like this can become a bit cumbersome when many parameters are needed. They are repeated in: the scenario's first row, the scenario rows where they are used and the table headers where the scenario is invoked.
Repeating the parameters in the first row of the scenario definition can be omitted using a custom extension to Slim. This is shown in TableTemplateTest.<commit_msg>Ensure we are not limited by choices for min/max prices by tests run previously<commit_after>!1 Website testing using ''scenario'' and !-BrowserTest-!


On this page we test whether we check the prices of a couple of houses for sale in Utrecht, The Netherlands. 
This test continues where ScriptTest left of. It uses a [[Slim scenario][.FitNesse.UserGuide.WritingAcceptanceTests.SliM.ScenarioTable]] to define a parameterized script.
This is then invoked multiple times from a [[Decision table][.FitNesse.UserGuide.WritingAcceptanceTests.SliM.DecisionTable]], once for each row.


The configuration of Selenium (i.e. which browser to use) and starting the browser session is done in the SuiteSetup. Which allows this configuration to be shared between tests. Closing the browser is done in SuiteTearDown, which happens after all tests are completed.

|scenario|check original price _|address, city               |
|open    |http://www.funda.nl                                |
|enter   |@{address}, @{city}   |as |Plaats, buurt, adres etc|
|note    |select option from autocomplete                    |
|press   |down                                               |
|press   |enter                                              |
|select  |€ 200.000             |for|van                     |
|select  |€ 1.000.000           |for|tot                     |
|click   |Zoek                                               |
|click   |@{address}                                         |
|$price= |value of              |Vraagprijs                  |
|$state= |value of              |Status                      |

|script|browser test|

|check original price                             |
|address       |city   |price?        |state?     |
|Maliebaan 73 D|Utrecht|€ 295.000 k.k.|Beschikbaar|
|Gageldijk 104 |Utrecht|€ 900.000 k.k.|Beschikbaar|



Writing the scenario like this can become a bit cumbersome when many parameters are needed. They are repeated in: the scenario's first row, the scenario rows where they are used and the table headers where the scenario is invoked.
Repeating the parameters in the first row of the scenario definition can be omitted using a custom extension to Slim. This is shown in TableTemplateTest.
{'fraction_non_alphanumeric': 0.07058823529411765, 'fraction_numerical': 0.011529411764705882, 'mean_word_length': 2.093886462882096, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 14, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3143664', 'n_tokens_mistral': 1128, 'n_tokens_neox': 1036, 'n_words': 459}