[EMAIL PROTECTED] wrote on 24/10/2005 09:06:28 PM:

> Hello all,
>
> maybe my user-extensions.js is wrong.
>
> Selenium.prototype.assertCmd = function (xxx)
> {
>
>    if (xxx)
>         {
>                 return (true);
>         }
>
>         var errorMessage = "error message";
>
>         throw new Error(errorMessage);
> }

Instead of
        throw new Error(errorMessage);
Try
        Assert.fail(errorMessage);


Also, if you are using release 0.6, consider if what you are asserting can be expressed in terms of a locator.  If you can write a method like:

Selenium.prototype.getBlah() or Selenium.prototype.getBlah(locator) that returns a value, then you will automatically have assertBlah, assertNotBlah, verifyBlah, and verifyNotBlah.

assertBlah | value

or, if your function took a locator, then

assertBlah | locator | value


Cheers,
David

David Kemp
ThoughtWorks Australia Pty Ltd
http://www.thoughtworks.com
_______________________________________________
Selenium-users mailing list
Selenium-users@lists.public.thoughtworks.org
http://lists.public.thoughtworks.org/mailman/listinfo/selenium-users

Reply via email to