Page 1 of 1

Compare "" to null in recorded module

Posted: Fri Jan 24, 2014 12:45 pm
by schemer1
Hi

We're trying to validate using a recorded module a screen value that returns (null) and an expected database value which is "". The validation fails whereas it we would like it to pass. Any suggestions would be helpful.

Thanks

Re: Compare "" to null in recorded module

Posted: Mon Jan 27, 2014 3:27 pm
by rprehm
Hi schemer1,

Unfortunately I’m not exactly sure how you handle the validation. In the code or in your recording?
As a workaround I would suggest to use a module variable which sets the database value to null().

Code: Select all

public void Validate1(string varDatabaseValue)
        {
         varDatabaseValue = null;
         Validate.AreEqual("Element which returns null",varDatabaseValue);
}
Regards,
Robert