TestDriven.Me

I hope to spend some time discussing testing with VB.NET. I don't think of myself as an expert, but I have had some experience and certainly some opinions. I will try to share some of those opinions along with some information and hopefully generate some discussion so that we all can improve our skills a bit.

Browse by Tags

All Tags » Web Page Testing (RSS)
Watin API Reference - DIVS
This method is used to make visible the collection of DIV tags on a web page. DIV elements contain a host of properties to help manipulate the information therein. Example of Usage This example utilizes the main.html page that is distributed with WatiN to highlight some of the methods available with the DIV class. ''' <summary> ''' Test behavior of DIVs ''' </summary> ''' <remarks> ''' currentURL is a Private Const = '''...

Posted Friday, September 26, 2008 2:06 PM by ddodgen | with no comments

WatiN API Reference - DIV
This method is used to make visible elements contained within a DIV tag on a web page. It contains a host of properties to help manipulate the information therein. Example of Usage This example utilizes the main.html page that is distributed with WatiN to highlight some of the methods available with the DIV class. ''' <summary> ''' Test behavior of DIV ''' </summary> ''' <remarks> ''' currentURL is a Private Const = '''...

Posted Tuesday, August 26, 2008 10:26 AM by ddodgen | with no comments

WatiN API Reference - Dispose
This method is used to release resources no longer needed by the current instance of the browser. Normally, you can omit this statement since it is called internally by the IE instance when it closes itself. Once Dispose is called, the IE instance is no longer valid and cannot be used. The only valid method to call on the IE instance after Dispose is Close. Example of Usage ''' <summary> ''' Determine dispose will affect the current instance of IE. ''' <...

Posted Wednesday, August 20, 2008 2:16 PM by ddodgen | with no comments

WatiN API - DialogWatcher
The dialog watcher class is used to handle javascript and other dialogs. The IE instance can have a dialog watcher which can have dialog handlers assigned to it to assist in processing pop up dialogs. Example of Usage This is a rework of the TestAddDialogHander2 test that was introduced earlier: ''' <summary> ''' Ensure that an alert dialog will be handled and ''' closed properly. ''' </summary> ''' <remarks> '''...

Posted Monday, August 11, 2008 2:16 PM by ddodgen | with no comments

WatiN API Reference - ContainsText
This method is used to determine if the web page has specific text being displayed. The text to be found must be in the HTML or a label control, but cannot be located within a textbox, button or other control. Example of Usage This is the simplest usage of the method: ''' <summary> ''' Test behavior of ContainsText ''' </summary> ''' <remarks> ''' currentURL is a Private Const = ''' "http://localhost:3587...

Posted Thursday, July 31, 2008 2:45 PM by ddodgen | with no comments

WatiN API Reference - Close
This method is used to close the current instance of the browser. If you want to leave the browser open at the end of the test, you can omit this statement. This will allow you to examine the contents of the browser, but you will have to close it yourself. If you are running more than one test at a time, this can be somewhat aggravating, and fortunately is unnecessary just to see what the browser contains, since you can always capture a screen shot instead. Example of Usage ''' <summary>...

Posted Monday, July 14, 2008 10:29 AM by ddodgen | with no comments

WatiN API - ClearCookies
I could not get this method to work as expected for me. It is designed to clear cookies for either a specific web site or all cookies depending on whether you pass a web site URL as its parameter. When I tried it in the below test, it failed because of no security access to clear the cookie data in IE7. Since I did not want to modify system access because that did not seem proper for testing, I just decided that clearing cookies would probably not be that important. Example of Usage '''...

Posted Thursday, July 03, 2008 9:53 AM by ddodgen | with no comments

WatiN API Reference - ClearCache
This method contains some gotchas. From its method name you would think that it would clear out the system cache, at least for the web page currently being viewed, but this is a bit of a misconception. The documentation on the WatiN site indicates that this method is used to clear the browser cache and gives an example of clearing the cache and then going back to a page that requires a login. Presumably you would have to log in again after the cache was cleared. The documentation also indicates that...

Posted Tuesday, July 01, 2008 11:32 AM by ddodgen | with no comments

WatiN API - Checkboxes
The Checkboxes method allows access to all the checkboxes on the web page. It is primarily used to find a checkbox when you are not able to access it by normal means, such as ID or Name. The following test looks for a checkbox that follows a specific text label, and then tests changing its value. Example of Usage ''' <summary> ''' Test behavior of checkboxes. ''' </summary> ''' <remarks> ''' currentURL is a Private Const...

Posted Thursday, June 26, 2008 11:10 AM by ddodgen | with no comments

WatiN API Reference - CheckBox
The Checkbox method allows access to checkboxes on the web page, as you might expect. As with most controls that WatiN exposes, most of the properties are read only, such as text, tag name, etc. The primary purpose of the method is to allow WatiN to examine the current value or to check or uncheck the value of a checkbox. Example of Usage ''' <summary> ''' Test behavior of checkboxes. ''' </summary> ''' <remarks> ''' currentURL...

Posted Monday, June 23, 2008 9:03 AM by ddodgen | with no comments

WatiN API - CaptureWebPageToFile
This is a very useful method for documentation and reviewing test results. Its purpose is to save a screen shot of the web page in its current state as an image file for later review. The type of image file saved is based on the file extension passed in the parameter. Currently file formats supported are: BMP, GIF, JPG, PNG, TIF. WatiN depends on the image encoders built into Windows, so if a particular encoder is missing, it will save the file in another image format. The title bar and address bar...

Posted Thursday, June 19, 2008 8:50 AM by ddodgen | with no comments

WatiN API Reference - Buttons
This method exposes a collection of all of the buttons on the current page in the current IE instance. Once a button is located, it has its own set of properties which can be examined in addition to just being clicked. WatiN treats the button as a read only object so it is not possible to change the button text or other properties during the test. Example of Usage The following example will look at various aspects of the button collection: ''' <summary> ''' Examine the...

Posted Monday, June 16, 2008 9:48 AM by ddodgen | with no comments

WatiN API Reference - Button
One of the most used methods available from the IE instance. A button on the screen can be examined or clicked with this method. Using WatiN to click a button fires its clicked event, as well as any javascript that may be attached to the button events, just as if a user had clicked the button with the mouse. Once a button is located, it has its own set of properties which can be examined in addition to just being clicked. WatiN treats the button as a read only object so it is not possible to change...

Posted Wednesday, June 11, 2008 11:56 AM by ddodgen | with no comments

WatiN API Reference - BringToFront
This method causes the selected browser to become the top most window on the screen. This is useful if you want to see what is going on during the test and other windows are obscuring the browser. Example of Usage ''' <summary> ''' Test if the browser will become top app on demand. ''' </summary> ''' <remarks> ''' Set AutoClose false on both browsers. ''' Should end with Live.com in browser on top. '''...

Posted Monday, June 09, 2008 4:46 PM by ddodgen | with no comments

WatiN API Reference - Back
This method navigates the browser instance back one URL in the history queue, just like the back button on Internet Explorer or another browser application. Warning: If you call this method before any navigation occurs in the browser or when all history has been exhausted and there is no URL to go back to, you will get the COM exception HRESULT E_FAIL. Example of Usage ''' <summary> ''' Test if the browser back action will return the instance to its prior URL. '''...

Posted Thursday, June 05, 2008 4:43 PM by ddodgen | with no comments

More Posts Next page »