Database Assertion
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2007
01:09 PM
08-24-2007
01:09 PM
Database Assertion
Hello,
would it be possible to have a 'Database assertion' as a new feature. Most of my responses typically have to be validated against some value in a database. If there is a database assertion type, it would make things a lot easier.
In the meantime, what would be the best way to accomplish this.
would it be possible to have a 'Database assertion' as a new feature. Most of my responses typically have to be validated against some value in a database. If there is a database assertion type, it would make things a lot easier.
In the meantime, what would be the best way to accomplish this.
3 REPLIES 3
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2007
01:14 PM
08-24-2007
01:14 PM
Hi!
hmm.. good idea! How would it be configured? Would it be together with the xpath assertion? ie the expected content field would somehow specify a database/table/row/column to match against?
Best bet currently is maybe to create a DataSource step to select the value for comparison and then compare either with a groovy script or a standard property-expansion in the expected value field
Hope this helps!
/Ole
eviware.com
hmm.. good idea! How would it be configured? Would it be together with the xpath assertion? ie the expected content field would somehow specify a database/table/row/column to match against?
Best bet currently is maybe to create a DataSource step to select the value for comparison and then compare either with a groovy script or a standard property-expansion in the expected value field
Hope this helps!
/Ole
eviware.com
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2007
02:07 PM
08-24-2007
02:07 PM
When I am creating a database assertion I am typically checking for a specific value (one column one row). Whereas in the datasource you can get multiple rows and columns, I think a database assertion would only contain one value.
So I guess datasource would be embedded inside the database assertion.
So I guess datasource would be embedded inside the database assertion.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2007
04:35 PM
08-24-2007
04:35 PM
Hi!
You could setup a DataSource teststep with a query that only selects one row (you can even use property-expansion in the sql query field) which would then be fetched when the testcase executes the step.. there is no requirement for you to hactually ave a DataSourceLoop step as well, so this step would only be run once (unless you loop over it in some other way.. )..
ie your TestCase could contain only
- DataSource -> fetch just one row
- Request -> with an xpath-match assertion that references the fetched row and/or its columns in the expected value
Hope this makes sense!
regards,
/Ole
eviware.com
You could setup a DataSource teststep with a query that only selects one row (you can even use property-expansion in the sql query field) which would then be fetched when the testcase executes the step.. there is no requirement for you to hactually ave a DataSourceLoop step as well, so this step would only be run once (unless you loop over it in some other way.. )..
ie your TestCase could contain only
- DataSource -> fetch just one row
- Request -> with an xpath-match assertion that references the fetched row and/or its columns in the expected value
Hope this makes sense!
regards,
/Ole
eviware.com
