Attached will be some code that our company (Webmetrics Inc. you can find us at
http://www.webmetrics.com) has found relevant and useful in monitoring. This submission is a contribution to the community as sort of a monitoring package that can be distributed. These functions provide useful features such as:
1. The ability to have timeouts (step timeouts as well as transaction timeouts)
2. A function to close dialogs. This is threaded so it should be called before a dialog appears.
3. The ability to set cookies for a domain and modify form data (especially hidden form data)
4. The ability to easily randomize a test such as using multiple logins for the same script, etc.
5. Ability to use dates in tests (including timezones, provided the correct packages are installed, TZInfo). This is useful when trying to get times or dates in other timezones or even making sure that the date used is x days or x hours ahead of the current time in a specific timezone.
6. The ability to easily throw an exception upon detection of a certain string (error string)
7. Performing matches and nth matches on the html of the page. (Useful when doing a first match or an nth match to a given pattern or regex)
Improvements to IE.new_process
I've read many posts on the forums relating to how one can run a test without having to worry about dealing with the cookie space or temporary internet files, basically a new user experience.
I've modified IE.new_process to create a temporary folder that IE will use to output all cookies and temporary internet files(cached files) to during the running of the test. When IE.kill is called, it will delete this directory to clear the space on the hard disk. This temporary folder will be created in the path defined by the TEMP system variable on that machine.
Code
I will attach the code to this ticket. The functions I described above will be found in the file wm.zip. On my machine, this file is placed in C:\ruby\lib\ruby\1.8 so you can unzip wm.zip to that directory. This of course can change if someone can suggest a better place to put it. Perhaps in the gems folder?
Also the improvements to IE.new_process will attached as itself. To view the changes, perform a diff on the file.
We are currently working on more functionality so please look forward to more from us.
Bach Le
Software Engineer
Webmetrics Inc.
bmle@webmetrics.com
877-524-8299 x 450