Sahi is one of the popular automated web test tool these days. Recently a comment was made by Mr Tom Heintzberger on my blog post here on Use of variables, arrays and complex types in Generic Fixture regarding use of Sahi with Generic Fixture and the problems he’s facing while trying to build DSL around it. So I decided to look into it and ended up creating a DSL myself to be used with Sahi.
Refer to Jump Start FitNesse with Selenium using Generic Fixture for detailed steps to download and install FitNesse & Generix Fixture.
Create a page on FitNesse for Sahi Web Test using Generic Fixture
- Open your browser and goto the URL http://localhost:8000/FrontPage. Look for the Edit button on the left hand navigation column. If Edit button is not present then goto the URL http://localhost:8000/FrontPage?properties and select the “Edit”check box and click on Save Properties. Now click on Edit button and once on the Edit Page add a new line at the end of all the text already there and save your changes.
- Now on the Front Page it will display a text like “Sahi Web Test Suites?” with ? as hyper link. Click on ? link.
- Once in the Edit Page, copy paste following text into text area and save your changes:
- You will notice 3 ? links on the page indicating missing pages. Now lets create each and every missing page.
- Click on the ? link next to SetUp text and on the “Edit Page” text area copy-paste following code and finally save your changes.
- Go back to the page: http://localhost:8000/FitNesse.SahiTestSuite
- Click on the ? link next to TearDown text and on the “Edit Page” text area copy-paste following code and finally save your changes.
- Again go back to the page: http://localhost:8000/FitNesse.SahiTestSuite
- Now click on ? link next to GoogleSahiTest text and on the “Edit Page” text area copy-paste following code an save your changes.
- After saving your changes click on Properties button from the left hand navigation menu and click on check box left to Test property and save your changes. Now you should see Test button available on the top lest navigation menu.
Execute your Google Sahi Test Page on FitNesse using Selenium
Just click on the Test click on this page: http://localhost:8000/FitNesse.GenericFixture.SahiTestSuite.GoogleSahiTest and watch how your Sahi automated web test is being run. Test will open a new Firefox browser and go to http://www.google.com and search Google with query text “sahi forums“
Upon completion of test you should see this on the top of the results page:
Assertions: 3 right, 0 wrong, 0 ignored, 0 exceptions
Hope this post will help some readers trying to use Sahi Automation Testing with Generic Fixture or people facing similar issues while using other frameworks with Generic Fixture.