Problem Implementing 0Auth 2.0 Authentication through Javascript Language
Hi . I am working on complex calculation project in Ready APi which has scripting language as"javaScript". We would need to implement Authentication in the Composite Project. Could anyone share the script to retrieve the token automatically through Javascript. I am able to retrieve the details automatically through Groovy but i wont be able to change the project language to groovy as it has more complex language which was implemented using Javascript. It would take more effort to change the language for this issue. Problem Statement: Need support for oAuth 2.0 Implementation using Javascript. Retrieving token automatically. So Please anyone share the code to retrieve the token automatically.2.1KViews0likes7CommentsJavascript equivalent to these Groovy scripts
Below scripts are working fine when I use Groovy, I need same functions to work with JAVASCRIPT in the SOAP UI Pro. //Get Login URL – //"Location" is one of the value returned in the response header of step "REST Request1". Need to add this to a Project/Global property which will be refered in subsequent steps def headerValue = testRunner.testCase.getTestStepByName("REST Request1").httpRequest.response.responseHeaders["Location"][0] projectProperty = testRunner.testCase.testSuite.project.setPropertyValue( "Login_URL", headerValue.toString() ) //Get Cookie 1 – //"Set-Cookie" is one of the value returned in the response header of step "Login URL". Need to split this using regex to get the required part def cookie1 = testRunner.testCase.getTestStepByName("Login URL").httpRequest.response.responseHeaders["Set-Cookie"][1] def (var1, cookieOBconsent, var3) = cookie1.split("t=|;") log.info cookieOBconsent projectProperty = testRunner.testCase.testSuite.project.setPropertyValue( "cookie1", cookieOBconsent.toString() ) For the 1st set of code, I have tried below Javascript - //Get Login URL - var headerValue = context.expand(testRunner.getTestCase().getTestStepByName("REST Request").httpRequest.response.responseHeaders["Location"]()); log.info(headerValue); But it returns a pop up message containing the complete response string including the header "Location" and an error. The log.info dosent work. Below is the contents of pop up window (masked for confidential area) org.mozilla.javascript.EcmaError: TypeError: Cannot find function Location in object Access-Control-Expose-Headers : APIm-Debug-Trans-Id, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-Global-Transaction-ID Access-Control-Allow-Origin : * X-Backside-Transport : FAIL FAIL Connection : close location : https://^^^^^^^^^^^^^^^^^^^^^^^^^^^^ #status# : HTTP/1.1 302 Found Content-Type : application/json .1.9KViews0likes4CommentsUnable to access file names from shared network path in “Directory” Data Source
Detailed problem statement: ReadyAPI Version 2.2.0 composite project has been created with “Javascript” language. We were in need to automate the validation of the output files. When we use Directory and give shared network drive as \\<servername>\<foldername>, we were not getting any output. But if we pass directory path as absolute as “C:\SLP”, we are able to get the output. Would need help to find a way to get the output of fileNames from Directory Datasource when we give "Network path"Solved1.9KViews0likes2Comments