Contributions
Help uploading excel spreadsheet for processing on server
Testing API that processes excel spreadsheet and populates database from entries. Raw REST request in SoapUI looks like this: POST http://localhost:4200/api/claim/import-claims HTTP/1.1 Content-Type: multipart/form-data; boundary="----=_Part_11_1453044361.1558528114738" MIME-Version: 1.0 Authorization: Bearer <token redacted> Origin: http://localhost:4200 Accept: application/json, text/plain, */* User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36 Referer: http://localhost:4200/authenticated/import-claims Connection: keep-alive Host: localhost:4200 Accept-Encoding: gzip, deflate, br Accept-Language: en-US,en;q=0.9 Content-Length: 44582 ------=_Part_11_1453044361.1558528114738 Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet Content-Transfer-Encoding: binary Content-Disposition: form-data; name="claimSpreadsheet"; filename="Mass Tort Upload Spreadsheet revised.xlsx" PK...... etc.... Raw response looks like this: HTTP/1.1 500 Internal Server Error X-Powered-By: Express access-control-allow-origin: * connection: close date: Wed, 22 May 2019 12:28:34 GMT content-type: application/json; charset=utf-8 server: Kestrel cache-control: no-store transfer-encoding: chunked vary: Origin access-control-allow-credentials: true "An error occurred while processing your request." Uploading In the web page, the request looks like this: POST /api/claim/import-claims HTTP/1.1 Host: localhost:4200 Connection: keep-alive Content-Length: 22238 Accept: application/json, text/plain, */* Origin: http://localhost:4200 Authorization: Bearer <token redacted> User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Safari/537.36 Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryP1io8KIswhlqBXac Referer: http://localhost:4200/authenticated/import-claims Accept-Encoding: gzip, deflate, br Accept-Language: en-US,en;q=0.9 with Form Data looking like this: ------WebKitFormBoundaryP1io8KIswhlqBXac Content-Disposition: form-data; name="claimSpreadsheet"; filename="Mass Tort Upload Spreadsheet revised.xlsx" Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet ------WebKitFormBoundaryP1io8KIswhlqBXac-- and finally, Response looks like this: HTTP/1.1 200 OK X-Powered-By: Express access-control-allow-origin: * connection: close date: Wed, 22 May 2019 12:07:42 GMT content-type: application/json; charset=utf-8 server: Kestrel cache-control: no-store transfer-encoding: chunked vary: Origin access-control-allow-credentials: true I have also tried to have ReadyAPI Discover API with its Internal Browser. I was able to upload the document in this manner, but had to modify the code to allow all filetypes as the Internal browser kept rejecting the allowed filetype as not allowable. The resulting API Discovered request looks like this: POST http://localhost:4200/api/claim/import-claims HTTP/1.1 Origin: http://localhost:4200 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Authorization: Bearer <redacted token> User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/605.1 (KHTML, like Gecko) JavaFX/8.0 Safari/605.1 Referer: http://localhost:4200/authenticated/import-claims Accept-Encoding: gzip Accept-Language: en-us;q=0.8,en;q=0.7 Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryMqG4DL24VSS3By4F Content-Length: 21230 Host: localhost:4200 Connection: Keep-Alive ------WebKitFormBoundaryMqG4DL24VSS3By4F Content-Disposition: form-data; name="claimSpreadsheet"; filename="Mass Tort Upload Spreadsheet revised.xlsx" Content-Type: application/octet-stream PK... etc. The only difference seems to be the Content-Type, as application/octet-stream When I try to run the test from SoapUI Pro TestCase, I still get the error"An error occurred while processing your request.". Question is, what am I setting up incorrectly in REST Method that causes the error? I'm certain this is a REST POST, and not a SOAP Request?5 years agoPlace ReadyAPI QuestionsReadyAPI Questions815Views0likes1CommentHow to test DIME Attachment using ReadyAPI ?
Old web services using DIME binary attachment standard. I have a link to old MSDN documentation: DIME: Sending Binary Data with Your SOAP Messages Last time I checked SoapUI documentation, I could not find support for testing with this attachment type. Now that we are using ReadyAPI, does anyone know if/how we can test using DIME binary attachment type? Thanks, Eric6 years agoPlace ReadyAPI QuestionsReadyAPI Questions938Views0likes1CommentRe: TestComplete does not wait for SQL query results before performing next step
The test is broken again, at this step. I setup the code as suggested in the article. It worked fine the first few times, but today, it is showing the same bug. The test does not wait for SQL query results before performing the next step. Is there and dummy output result that I can setup, even though the stored procedure does not take any parameters? I would like to try and see if this will force TestComplete to wait for the stored procedure to finish before moving on to the next step? Something like: // Adding a return parameter SProc.Parameters.AddParameter(); SProc.Parameters.Items(0).name = "RETURN_VALUE"; SProc.Parameters.Items(0).DataType = adInteger; SProc.Parameters.Items(0).Direction = adParamReturnValue; SProc.Parameters.Items(0).Value = null; ... Log.Message("Result: " + SProc.Parameters.Items(0).Value);2.6KViews0likes0CommentsRe: TypeError: Cannot read property 'push' of null .. well, sometimes
That works, too, but, to solve this issue I found I needed to change the following: if (KeywordTests.Main.Variables.ourArray != null) change to: if (KeywordTests.Main.Variables.ourArray != '') If I use null here, an empty string is passed to the sql query, causing the syntax error. If I use '' instead of null, no worries. Thanks.13KViews0likes0CommentsRe: TypeError: Cannot read property 'push' of null .. well, sometimes
I have tried running the test with that variable initialized, uncommented that line, but I receive a syntax error. The initialization of that variable is read as something other than null, which causes bad data to be sent to the sql query in the next section. This causes a syntax error.13KViews0likes2CommentsTypeError: Cannot read property 'push' of null .. well, sometimes
I have a scenario where I setup a variable of Type Object with Default value:{Object variable [unassigned]} This will be populated with an array of sql query output. On first run of the test, the following code fails with TypeError: Cannot read property 'push' of null. The line with error is where this variable is to be populated: KeywordTests.Main.Variables.ourArray.push(RecSet.Fields.Item("ClaimID").Value); On the 2nd run of this test, I get no errors and the script completes with appropriate log messages. I don't understand why this test will fail the 1st time it is run, but not on consecutive run of the code. Any thoughts are appreciated. Thanks. // Step 9: // This involves running verus_CheckSubrogationClaim, // verus_UpdateSubrogationStatusByClaimID @ClaimID = ..., // verus_UpdateSubrogationNoticeInfo @ClientID = ... function ExecSubrogationCheck() { KeywordTests.Main.Variables.getID.Reset(); //KeywordTests.Main.Variables.ourArray = []; <-- Whenever I try this, I get a value that is read as not null !? var AConnection, RecSet, Cmd, cmdTxt; var clnt = KeywordTests.Main.Variables.getID.Value("ClientID"); var userID = KeywordTests.Main.Variables.getID.Value("Login"); var pWord = KeywordTests.Main.Variables.getID.Value("Password"); // Create a new Connection object AConnection = ADO.CreateConnection(); // Note that you can also create an ADO connection using the following code: // AConnection = getActiveXObject("ADODB.Connection"); // Specify the connection string AConnection.ConnectionString = "Provider=SQLOLEDB;Server=<redacted>;Database=CMS;Uid=" + userID + ";Pwd=" + pWord; // Activate the connection AConnection.Open(); // Create a new Coomnad object Cmd = ADO.CreateCommand(); // To create an ADO command you can also use the following code: // Cmd = getActiveXObject("ADODB.Command"); // Specify the connection Cmd.ActiveConnection = AConnection; // Specify command type and text Cmd.CommandType = adCmdText; // EXEC 1st part of subrogation check cmdTxt = 'EXEC verus_CheckSubrogationClaim'; Log.Message(cmdTxt); Cmd.CommandText = cmdTxt; // Execute the command Cmd.CommandTimeout = 0; RecSet = Cmd.Execute(); // Process the table records if (! RecSet.EOF){ RecSet.MoveFirst(); // Grab ClaimIDs put into variable ourArray while (! RecSet.EOF) { if (RecSet.Fields.Item("ClaimID").Value != null){ KeywordTests.Main.Variables.ourArray.push(RecSet.Fields.Item("ClaimID").Value); } RecSet.MoveNext(); } RecSet.Close(); } else { Log.Warning("No Subrogation Claims found!"); } // change ourArray into an actual array var s = KeywordTests.Main.Variables.ourArray; //var s = [5523598,5523599,5523600]; -- this is here for testing purposes var prevSep = aqString.ListSeparator; aqString.ListSeparator = ","; if (KeywordTests.Main.Variables.ourArray != null){ Log.Message(aqString.GetListLength(s) + " Subrogation Claims found."); Log.Message("EXEC verus_UpdateSubrogationStatusByClaimID @ClaimID = ...") //This reads through the array and EXEC verus_UpdateSubrogationStatusByClaimID @ClaimID = for each claim for (let i = 0; i < aqString.GetListLength(s); i++) { // Create a new Coomnad object Cmd = ADO.CreateCommand(); // Specify the connection Cmd.ActiveConnection = AConnection; // Specify command type and text Cmd.CommandType = adCmdText; // EXEC 2nd part of subrogation check cmdTxt = 'EXEC verus_UpdateSubrogationStatusByClaimID @ClaimID = ' + aqString.GetListItem(s,i); //Log.Message(cmdTxt); Cmd.CommandText = cmdTxt; // Execute the command Cmd.CommandTimeout = 0; RecSet = Cmd.Execute(); } aqString.ListSeparator = prevSep; //RecSet.Close(); -- this gave an error and was commented out Log.Checkpoint("Subrogation Claims status Updated"); } // EXEC 3rd part of subrogationcheck verus_UpdateSubrogationNoticeInfo @ClientID = // Create a new Coommand object Cmd = ADO.CreateCommand(); // To create an ADO command you can also use the following code: // Cmd = getActiveXObject("ADODB.Command"); // Specify the connection Cmd.ActiveConnection = AConnection; // Specify command type and text Cmd.CommandType = adCmdText; // EXEC 3rd part of subrogation check if (KeywordTests.Main.Variables.ourArray != null){ cmdTxt = 'EXEC verus_UpdateSubrogationNoticeInfo @ClientID = 2, @LawFirmID = ' + KeywordTests.Main.Variables.getID.Value("LawFirmID") + ', @SubId = 0, @SubNoticeID = 0'; //Log.Message(cmdTxt); Cmd.CommandText = cmdTxt; // Execute the command Cmd.CommandTimeout = 0; RecSet = Cmd.Execute(); } //Close connections AConnection.Close(); Log.Checkpoint("Subrogation Check for <redacted> Claims completed."); }Solved13KViews0likes5CommentsTestComplete does not wait for SQL query results before performing next step
I have TestComplete step that queries SQL server to run a procedure. I have scripted the query to monitor the status of the procedure and return when complete. I have run this successfully in TestComplete using an Indicator message that will show the status of the SQL procedure, but it now skips monitoring the sql procedure on the first run through of the TestComplete test. I have to re-run the TestComplete test to successfully pause while monitoring the sql procedure before moving to the next step. I cannot understand this behavior, each time I have to run TestComplete twice in order to have the Indicator show the status of the SQL job before moving to the next step. Here is the code from TestComplete and the SQL procedure/job: USE [CMS] GO /****** Object: StoredProcedure [dbo].[Monitor_PopulateQueSys] Script Date: 9/25/2018 2:08:40 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE PROCEDURE [dbo].[Monitor_PopulateQueSys] AS DECLARE @JobName NVARCHAR(128) = N'Verus_PopulateQueueSystem' SET NOCOUNT ON SET XACT_ABORT ON DECLARE @jobID UNIQUEIDENTIFIER, @maxID INT, @status INT, @rc INT SELECT @jobID = job_id FROM msdb..sysjobs WHERE name = @JobName SELECT @maxID = MAX(instance_id) FROM msdb..sysjobhistory WHERE job_id = @jobID AND step_id = 0 SET @maxID = COALESCE(@maxID, -1) RAISERROR ( 'Starting Job: %s', 0, 1, @JobName) WITH NOWAIT EXEC @rc = msdb..sp_start_job @job_name = @JobName WHILE (SELECT MAX(instance_id) FROM msdb..sysjobhistory WHERE job_id = @jobID AND step_id = 0) = @maxID BEGIN RAISERROR ( 'Wait for job to finish', 0, 1) WITH NOWAIT WAITFOR DELAY '00:00:01' END SELECT @maxID = MAX(instance_id) FROM msdb..sysjobhistory WHERE job_id = @jobID AND step_id = 0 SELECT @status = run_status FROM msdb..sysjobhistory WHERE instance_id = @maxID IF @Status <> 1 RAISERROR ( N'Job failed', 15, 1) WITH NOWAIT ELSE RAISERROR ( 'Job succeeded', 0, 1) WITH NOWAIT GO And here is how it is called from TestComplete: function populateQueue() { // Step 13 var AConnection, RecSet, Cmd, cmdTxt; var userID = KeywordTests.Main.Variables.getID.Value("Login"); var pWord = KeywordTests.Main.Variables.getID.Value("Password"); // Create a new Connection object AConnection = ADO.CreateConnection(); // Specify the connection string AConnection.ConnectionString = "Provider=SQLOLEDB;Server=<redacted>;Database=CMS;Uid=" + userID + ";Pwd=" + pWord; // Activate the connection AConnection.Open(); // Create a new Coomnad object Cmd = ADO.CreateCommand(); // To create an ADO command you can also use the following code: // Cmd = getActiveXObject("ADODB.Command"); // Specify the connection Cmd.ActiveConnection = AConnection; // Specify command type and text Cmd.CommandType = adCmdText; // EXEC stored procedure Indicator.PushText("Populate Queue System Procedure can take a few minutes!"); cmdTxt = 'EXEC Monitor_PopulateQueSys'; Log.Message(cmdTxt); Cmd.CommandText = cmdTxt; // Execute the command Cmd.CommandTimeout = 0; RecSet = Cmd.Execute(); // Process the results Log.Checkpoint("Populate Queue System procedure completed."); AConnection.Close(); Indicator.PopText(); } Does anyone have any idea why this will fail to wait for the procedure to complete before moving on to the next step the first time it is run? Thanks for your replies.Solved2.8KViews0likes4CommentsHow to send Indicator and/or Log.Message to Console during TestComplete run from command line?
I run TestComplete project from the command line using a .bat file. I would like the Indicator messages or the Log.Message/Error/Warning/Checkpoint or both to appear in the console window during the run of TestComplete from the command line. How can I do this? Thank you.727Views0likes1CommentRe: test complete getting hanged after message Preparing an object recognition hint. any solution
Version: 12.42.3048.7 x64 License Type: Perpetual Preparing an object recognition hint is taking an extraordinary amount of time after 'Confirm' of Pop-Up window. I have tried to shorten the 'Wait Timeout for Operations' of the confirm, but this has no effect on the Object message that follows. I have also tried to shorten the wait time on the operation after the Confirm. No effect. I do not think it has anything to do with the landing page as I have seen my 'confirm' land on the same page as the current window, or a default page. How can I speed this test up after this 'confirm' of a Pop-Up window? Edit: Change 'Object Search Strategy' in Project Properties to 'Depth-first' has fixed this problem.1.7KViews1like0Comments