Contributions
- 2 years agoPlace ReadyAPI QuestionsReadyAPI Questions472Views0likes0Comments
Script assertion error
I have a script assertion to trigger subsequent assertions within a step based on a value. While executing in a single flow I get the below error sporadically but while executing the test case in a loop, I get it more frequently . although the script is marked as fail, it is enabling and disabling other assertions based on value correctly. This issue is causing the test suite to be in FAIL status all the time. Script editor says "Context" object is available, but when executed it says its not available . can someone help me with this please. ReadyAPI version: 3.40.2521Views0likes2CommentsRe: Validate assertion with XPath field null
i have similar issue but with JDBC and i got my Groovy script to work. this is what i have so far. below is link to my post https://community.smartbear.com/t5/SoapUI-Pro/Compare-EMPTY-TAGS-in-JDBC-response-to-NULL-in-DataSource-as/m-p/174135/thread-id/39693 This groovy works. try it.. def ActualSourceCode = context.expand( '${ABC_XYZ#ResponseAsXml#//Results[1]/ResultSet[1]/Row[1]/SOURCE_CODE[1]}' ) log.info "JDBCSourceCode= $ActualSourceCode" def ExpectedSourceCode = context.expand( '${DataSource#SourceCode1}' ) log.info "EXCELSourceCode= $ExpectedSourceCode" if(ActualSourceCode == 'NOVALUE') { ExpectedSourceCode = 'NOVALUE' assert ExpectedSourceCode == ActualSourceCode log.info "SourceCodeNotEntered = $ActualSourceCode" } else { assert ExpectedSourceCode == ActualSourceCode log.info "SourceCodeEntered = $ActualSourceCode" }6 years agoPlace ReadyAPI QuestionsReadyAPI Questions4.7KViews0likes2CommentsModifying JDBC response to compare with JSON input
Hello, I have aJDBC step, where it returns empty tags if no data is present on the table. Then am comparing this repsosne to excel (datasource) using assertions where my REST input value is NULL. How do i compare an empty tag to a NULL input ? Also the fields are dynamic where they may have data or jus returns empty tags. Can anyone help me with this.?Thanks in advance for your time.. Grrovy that i came up with . Not sure if am on right path or not .. def ActualSourceCode = context.expand( '${CTL_RAD#ResponseAsXml#//Results[1]/ResultSet[1]/Row[1]/SOURCE_CODE[1]}' ) log.info "JDBCSourceCode= $ActualSourceCode" def ExpectedSourceCode = context.expand( '${DataSource#SourceCode1}' ) log.info "EXCELSourceCode= $ExpectedSourceCode" if(ActualSourceCode == 'NOVALUE') { ExpectedSourceCode = 'NOVALUE' assert ExpectedSourceCode == ActualSourceCode log.info "SourceCodeNotEntered = $ActualSourceCode" } else { assert ExpectedSourceCode == ActualSourceCode log.info "SourceCodeEntered = $ActualSourceCode" }6 years agoPlace ReadyAPI QuestionsReadyAPI Questions1.8KViews0likes3Comments