Compare "" to null in recorded module

Ask general questions here.
Posts: 16
Joined: Mon Feb 11, 2013 12:05 pm

Compare "" to null in recorded module

Post by schemer1 » Fri Jan 24, 2014 12:45 pm


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.



Re: Compare "" to null in recorded module

Post by rprehm » Mon Jan 27, 2014 3:27 pm

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);