Contributions
Re: Sorting data in JSON response for comparison
HelloTN I tried with Example 1 and it's working as expected. Thank you for the solution. In the code, after the step // sorted line by sorted line check... I am getting Assertion fail message -java.lang.AssertionError: Mismatch - At index 0 the referece value '"{\n' does not match the comparison value '"{\"Drivers\":[{\"ContactId\":501017,\"LicenseNumber\":\"'. Expression: refValue.equals(compValue) error at line: 66 Instead of Assertion, I would like tolog results for Pass/Fail based on comparison and add logic of adding the Mismatch field and Key value to Temp Msg which I can use to log the results in DataSink excel spreadsheet. I tried below code but it's giving error - // sorted line by sorted line check... refStrListSorted.eachWithIndex { refValue, idx -> def tempmssg = ""; def compValue = compStrListSorted[idx]; if ( refValue != compValue ) { tempmssg = "refValue=" + refValue + " " + idx +tempmssg; } else{ tempmssg = "compValue=" + compValue + " " + idx +tempmssg; }; };3 years agoPlace ReadyAPI QuestionsReadyAPI Questions3.8KViews0likes0CommentsRe: Sorting data in JSON response for comparison
Hi Rao, Yes, Driver Number is unique. But, I want to sort the Expected Response json Response based on Driver Number 1,2,3 before comparison so that my existing script for 1 on 1 comparison passes. Can you please send the code to use to sort the response?3 years agoPlace ReadyAPI QuestionsReadyAPI Questions3.8KViews0likes3CommentsSorting data in JSON response for comparison
I am trying to compare 2 full JSON responses - expected and actual for Pass/Fail status. After running the REST request, I get Actual response that does not return the field in same sequence as in Expected Response which causes 1 on 1 comparison to fail. To solve this issue, I need to sort the data in Actual Response to match it to Expected Response format before comparison. Below is the Expected and Actual response for reference. Can anyone help with this? Expected Response - { "Drivers": [ { "ContactId": 797952, "LicenseNumber": "123WT45TY1234", "LicenseState": "DE", "DriverNumber": 2, "DriverStatus": "Active", "DriverTerminationDate": null, "DriverUsed": true, "PolicyDateTimeDriverAdd": "2021-01-06T14:27:34", "PolicyDateTimeMax": "2021-01-06T14:27:34" }, { "ContactId": 797949, "LicenseNumber": "N677DG8906VB7", "LicenseState": "DE", "DriverNumber": 1, "DriverStatus": "Active", "DriverTerminationDate": null, "DriverUsed": true, "PolicyDateTimeDriverAdd": "2021-01-06T14:27:34", "PolicyDateTimeMax": "2021-01-06T14:27:34" } ] Actual Response - { "Drivers": [ { "ContactId": 797949, "LicenseNumber": "N677DG8906VB7", "LicenseState": "DE", "DriverNumber": 1, "DriverStatus": "Active", "DriverTerminationDate": null, "DriverUsed": true, "PolicyDateTimeDriverAdd": "2021-01-06T14:27:34", "PolicyDateTimeMax": "2021-01-06T14:27:34" }, { "ContactId": 797952, "LicenseNumber": "123WT45TY1234", "LicenseState": "DE", "DriverNumber": 2, "DriverStatus": "Active", "DriverTerminationDate": null, "DriverUsed": true, "PolicyDateTimeDriverAdd": "2021-01-06T14:27:34", "PolicyDateTimeMax": "2021-01-06T14:27:34" } ] I have highlighted field DriverNumber that I would like to sort the data before comparison in descending order 2,1,0.Solved3 years agoPlace ReadyAPI QuestionsReadyAPI Questions4KViews0likes5CommentsJenkins file code to send email notification on error
I need to run my test project in TestComplete14 every night, and I need to be able to send result (Succeeded/Error(s) occurred) as a part of a email subject. Currently, I run the test project in Jenkins as a scheduled nightly job and also use Jenkins file to send email notification for pass/fail build status .I want to go a step further and code Jenkins file to send email notification of Success if all test cases passed and Fail if there is given percentage of errors. I am having trouble to accomplish that. Can anyone help? Below is the Jenkins file code, which I use currently for email notification for Build status - post { always { echo "Notifying build result by email" } success { mail to: 'email address', subject: "SUCCESS: ${currentBuild.fullDisplayName}", body: "Test Complete Build passed." } failure { mail to: 'email address', subject:"FAILURE: ${currentBuild.fullDisplayName}", body: "Test Complete Build failed." }Solved4KViews0likes2CommentsHow to resolve Access to Remote License Managers configuration for constantly changing ip address?
I have Test Execute installed on Windows server and in config forAccess to Remote License Managers , I have included 2 Search Parameters computer name and ip address. But for some reason, if I just have computer name in there, it does not find License Manager PC and I get error -The License Manager PC that was used last time is not available and no other accessible License Manager PC was found in your network. If I add ip address, it does find License Manager PC but I would like it to work with computer name as ip address changes constantly on my local and updating it on regular basis is a pain. Can anyone help me to find a solution to this problem?Solved2.2KViews0likes5CommentsRe: Getting "The window was destroyed during method execution" error in TestExecute on windows server
HiRobert, Thank you for sending modified code. But unfortunately, it didn't work , still getting same error after the page loads and before clicking Account Initialization link. See attached TC logs.2.5KViews0likes9CommentsRe: Getting "The window was destroyed during method execution" error in TestExecute on windows server
The error happens after navigating to url. In IE, it works fine. Seeing this issue in chrome only, before clicking on link, it fails. Below is my script - function Test2() { Browsers.Item(btChrome).Run("url"); aqUtils.Delay(10000, "Delaying Test Run"); Aliases.browser.pagePita3.navNavLeft.linkAccountInitialization.Click(); Aliases.browser.pagePita.Wait(); Aliases.browser.BrowserWindow.Close(); }2.5KViews0likes12CommentsRe: Getting "The window was destroyed during method execution" error in TestExecute on windows server
Thankstristaanogrefor the quick reply. I understood the reason why I am getting the error but how should I resolve this? I tried addingaqUtils.Delay(5000, "Delaying Test Run"); to delay execution and wait for page load but still getting same error. Any other solution recommended by you?2.5KViews0likes14CommentsGetting "The window was destroyed during method execution" error in TestExecute on windows server
When trying to run TC script on Windows server 2016 getting error -The window was destroyed during method execution" after the url opens in chrome browser. Script runs fine in my desktop but in server it returns this error. Can anyone help?Solved3.3KViews0likes16Comments