Forum Discussion
AlexeyKolosov
15 years agoStaff
Hi Bernd,
Most probably, the error message you get is caused by the fact that an empty dataset is returned from your database when the comparison is performed. Anyway, the task you need to accomplish (to compare a current DB table value with a current value in a text box) cannot be accomplished via built-in checkpoints. You will need to create a custom script which will retrieve the needed data for you and compare it with the current text displayed in your control. You can find references to sample scripts demonstrating how you can retrieve data from a DB in the "Working With Databases" ( http://www.automatedqa.com/support/viewarticle.aspx?aid=3694 ) help topic. The resulting code should look as follows:
function test()
{
var guiVal = getValueFromGUI(); // Get the current value from the text box
var dbVal = getValueFromDB(); // Get the current value from the DB via the needed SQL statement
if (curVal != dbVal)
{
Log.Error("The values are different", "GUI value: " + guiVal + "; DB value: " + dbVal);
}
}
Related Content
- 12 years ago
Recent Discussions
- 18 hours ago