ERROR: An error occurred [empty String], see error log for details

Hi i have a need to validate two data sources using nested loop on multiple records in several tables Steps

  1. Build a Rest Request
  2. get the datasource
  3. getting the data from db as expected result
  4. write a groovy script inorder to get a value to be validated with db
  5. Asert the values are equal

Issue : I have multiple empty values in the data sources from the api(actual value) and expected value db Question : When i run my script i am getting this error ERROR: An error occurred [empty String], see error log for details for empty values asserted . Please help as i am on a deadline and am unable to find a solution online .

double commitmentqauterQ1 = commitmentQ1 ?  commitmentQ1.toDouble() :1 ;
double ContractDomainqauterQ1 = contractDomainQ1 ? contractDomainQ1.toDouble() : 1 ;
double tierPriceqauterQ1 = tierPriceQ1 ? tierPriceQ1.toDouble()  : 1 ;
int prorateddaysQ1 = proratedQ1.toInteger();
int QtyQ1 = planqtyQ1? planqtyQ1.toInteger() : 0 ;
double PriceQ1 =  tierPriceQ1 ? tierPriceqauterQ1 : intelPrice.toDouble()
def planCostQ1 = (PriceQ1.toDouble() * QtyQ1.toInteger() * prorateddaysQ1.toInteger()  * ContractDomainqauterQ1.toDouble() * commitmentqauterQ1.toDouble()).round(1)
def expectedCostQ1 = queryplancostQ1.toDouble().round(1)
//log.info("planCostQ1  $planCostQ1")
//log.info("expectedCostQ1 $expectedCostQ1" )
assert planCostQ1 == expectedCostQ1
log.info("Assertion passed !! $planCostQ1 | $expectedCostQ1")


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.