ContributionsMost RecentMost LikesSolutionsRe: Automation script in ReadyAPI for Authentication Hi Humashankar , Thank you for your reply. I looked into Groovy script. Did you mean something like this? @Grab(group='org.codehaus.groovy.modules.http-builder', module='http-builder', version='0.7.1') import groovyx.net.http.RESTClient def clientId = "a1b2" def redirectUri = "https://readyapi/callback" def authorizationUrl = "https://abc.com/authorize" def authUrl = "${authorizationUrl}?client_id=${clientId}&redirect_uri=${redirectUri}&response_type=token" def accessToken = "" def url = new URL(redirectUri) def params = url.fragment.split('&') params.each { param -> def parts = param.split('=') if (parts[0] == 'access_token') { accessToken = parts[1] } } if (accessToken) { def restClient = new RESTClient('') restClient.auth.oauth2(accessToken) def response = restClient.get(path: '/resource', contentType: 'application/json') println "Response: ${response.status} - ${response.data}" } else { println "Failed to retrieve access token" } Best regards, aa1 Automation script in ReadyAPI for Authentication Hi, I am new to Ready API. I am trying to authenticate the user credentials and set it up as the script inside Auth Manager so that we can run the ready API test suites from the pipeline automatically. Manual set up for authentication is working fine and we are able to call the APIs and get results. We use Oauth2.0 authentication. The automation script that I have is not working. I am not sure what I am missing. This is what I tried referring to this document: https://support.smartbear.com/readyapi/docs/requests/auth/types/oauth2/automate/index.html var loginForm = document.querySelectorAll(".ab.cd"); var username = document.getElementById("username").value; var password = document.getElementById("password").value; var loginBtnForm = document.querySelector(".c2"); var loginBtn = document.querySelectorAll(".c3.c4.c5.c6.c7"); document.getElementById("username").value = "testusername"; document.getElementById("password").value = "testpassword"; loginBtn.click(); LoadComplete trial Hello, I am looking to acquire a trial version of loadcomplete tool. I tried downloading it but somehow I get redirected to load ninja instead. Load ninja would have worked for me but it only supports 15 virtual users which is not enough for me. Loadcomplete would have given me 50 users even for the trial version. If anyone could point me in the right direction, I would be grateful. I had created a support case last week but I haven't received any response yet. Thank you in advance, Re: Event handler for textbox Aliases.browser.page.form.textboxCreditCardNumber.Keys(""); Aliases.browser.page.form.textboxCreditCardNumber.Keys("4110044510001234[Enter]"); Aliases.browser.page.panel.panel.textboxCreditCardExpirationDate.Keys(""); Aliases.browser.page.panel.panel.textboxCreditCardExpirationDate.Keys("12[Enter]"); Aliases.browser.page.panel.panel.textboxExpirydateyear.Keys(""); Aliases.browser.page.panel.panel.textboxExpirydateyear.Keys("2022"); Aliases.browser.page.form.textboxCvvNumber.Keys(""); Aliases.browser.page.form.textboxCvvNumber.Keys("123"); Aliases.browser.page.form.textboxCvvNumber.Keys("[Enter]"); Aliases.browser.page.panel.panel.textboxExpirydateyear.Keys("[Tab]"); Aliases.browser.page.panel.panel.textboxExpirydateyear.Keys("2022"); Aliases.browser.page.panel.panel.textboxExpirydateyear.Keys("[Enter]"); aqUtils.Delay(ProjectSuite.Variables.ExistsTimeout); Runner.Pause(); var btnPayNow = Aliases.browser.page.panel.panel2.buttonPayNow; while (! btnPayNow.Exists) { aqUtils.Delay(ProjectSuite.Variables.ExistsTimeout); btnPayNow = page.NativeWebObject.Find("class", "Pay now", "btn btn-primary"); } btnPayNow.Click(); The above code is what I tried. I tried SetText as well. When it comes to the last line, it fails saying the button is disabled. Re: Event handler for textbox Thank you for the reply. Yes I tried that but it made no difference at all. Event handler for textbox Hi, I have a situation where I have an amount text box and then Pay now button beneath it. When I enter the amount, the pay now button should be enabled and then the next step is to click on it. This is an automated script in Jscript. When I do manually, as soon as I enter the text, the pay button does get enabled. But when my automated script runs, it does settext in the textbox but then the button is still disabled. So the next event of clicking on it fails with the exception that the button is disabled. I tried to enable it but seems like I need to have an event handler for this. Do I write the event handler when the textbox has been filled in. Or may be in tab out from that textbox. Please help me to find the right approach. thanks SolvedRe: Regex Hi again, Furthermore, looks like testcomplete has its own non native regex methods. So I was trying those but that did not take me anywhere either. For example: var testString = "agent_1d74901d5"; var testRegex = /\agent\_\a/; var re = new RegExp(testRegex); var rr = re.test(testString); I dont understand why rr is false. Is that not how you would specify the regex? thanks aa Re: Regex Hi Wamboo, Thank you for the reply.I need it for automation script. I am using test complete to compare two html files - actual vs. expected. But there are some of the lines that I would like to ignore. So I want to use regex to find those lines and replace with a whitespace or some characteres so that the testcomplete passes the test. Right now I drilled down to very simple expression: Example: If i try regex tester such as http://regexstorm.net/tester,, it shows 1 match but test complete says 0 match for the following so I am assuming regex dont work the same way asit normally does in test complete. var test1 = "agent_1a2b3c_LangPref_0"; var regEx = "(?<=agent_).*?(?=_)"; var ppp = aqString.StrMatches(regEx,test1); Test complete gives ppp = false which means it did not find any match. I dont seem to understand why. You have any ideas? Regards, aa Regex Hi, I was trying to implement something similar to the following https://support.smartbear.com/testcomplete/docs/scripting/regular-expressions.html var regEx3 = /;(\r\n)+function/g; var ReplacementLines = ";\r\n\r\n//A helper routine\r\nfunction"; var test1 = "function Foo(Param1)"; var test2 = test1.replace(regEx3,ReplacementLines); but it does not give me the result as expected. var test = "class=organizationAgentGridInfoRightColumn_Text12345"; var regEx = /<=organizationAgentGridInfoRightColumn_Text>.*/gi; test = aqString.Replace(test,regEx,"abc"); Not sure what I am doing wrong. Is my regex wrong? SolvedRe: Run a bat file from network does not work Thanks tristaanogre. I will create a separate thread for this issue in that case. I tried running as an admin but that did not make any difference. Will also take note of the hardcoded delay improvement. Thank you!