ContributionsMost RecentMost LikesSolutionsUnable to open an Excel Data Source since file is Protected from Editing (Protected View) We are encountering an issue that is disrupting our ability to automate using an Excel Data Source. When we download the file, it comes in 'Protected View' mode, which means you have to first open it, check the box to 'Enable Editing', and then close it before ReadyAPI will parse it. Has anyone else encountered this and is there a fix? I searched through the community and the only thing I could find a fix for was for password protected files. I asked AI and there may be a way to get around it using Groovy, but we'd prefer to use the out of the box Data Source solution and Data Loops from ReadyAPI. @Grab(group='org.apache.poi', module='poi-ooxml', version='5.2.3') @Grab(group='org.apache.poi', module='poi-ooxml-schemas', version='5.2.3') import org.apache.poi.ss.usermodel.* import org.apache.poi.xssf.usermodel.XSSFWorkbook import java.io.FileInputStream // Path to the Excel file that is protected from editing def filePath = "path/to/protected-file.xlsx" // Open the Excel file FileInputStream fis = new FileInputStream(filePath) XSSFWorkbook workbook = new XSSFWorkbook(fis) // Parse the workbook as usual Sheet sheet = workbook.getSheetAt(0) // Access the first sheet // Iterate through rows and cells sheet.each { Row row -> row.each { Cell cell -> print "${cell.toString()} \t" } println() } workbook.close() fis.close() Re: Cannot invoke "com.eviware.soapui.impl.wsdl.tags.Tag.toString()" because the return value of "java.u jjwrightI encountered this issue and here is how I was able to solve it. It appears some tags that no longer existed in settings.xml made it into several test case xml files during a PR merge. To find the offending suite (it ended up being 3 Test Suites in our project with bad tags) I would right click on each Test Suite and select 'Launch TestRunner' If TestRunner failed to launch and the error displayed in the ReadyAPI Log, I would: export the Test Suite Save the Project Re-import the Test Suite Add the correct Tags to each Test Case Save the Project Right click on the Test Suite and launch Test Runner. The error should no longer display. Repeat as necessary. Hopefully this helps and if so, please mark as the solution. Thanks! Send and Receive Avro messages on AMQ using a JMS connection Does anyone have any experience sending and receiving Avro messages on AMQ in ReadyAPI? I did some reading through the help and it seems you can serialize Avro objects using a schema file for a Kafka API Connection. https://support.smartbear.com/readyapi/docs/testing/kafka/index.html However, there is no mention of how to do this using JMS. We've successfully setup a JMS connection in ReadyAPI and are able to send raw JSON to AMQ. This does not work though because our AMQ is expecting an Avro object, not JSON. I'll try to setup an API Connection using the instructions here https://support.smartbear.com/readyapi/docs/testing/kafka/producer.html#connection-settings to see if I can use JMS this way. If I get this to work, I'll update the post. Any suggestions would be greatly appreciated! Re: "Update Definition" blanks out parameters in associated test cases Hi shyne We encountered this issue as well and raised a case with Smartbear. Smartbear verified that it's a bug and are looking into it. Thank you for reporting this. I hope if they see more users encountering this issue, it will expedite a fix 🙂 In our case, we were using Refactor, not Update. The case we raised is 00539306 Re: Failed to update the interface: [ Invalid QName value: Can't resolve prefix 'xs] Hi richie I encountered a similar error while attempting to update from a .yaml file. Wed Jan 18 15:46:31 EST 2023: ERROR: org.apache.xmlbeans.impl.values.XmlValueOutOfRangeException: Invalid QName value: Can't resolve prefix 'xs' org.apache.xmlbeans.impl.values.XmlValueOutOfRangeException: Invalid QName value: Can't resolve prefix 'xs' I searched the file for any instance of 'xs' and nothing turned up. I'm not sure if anyone else solved this issue. I'll keep digging in the meantime. Re: Refactor Refactoring We are using ReadyAPI v 3.40.2. The refactor feature is almost unusable it is so complex. It's like trying to find a needle in a haystack. We should have the ability to do one at a time instead of all endoints at once. It would be tedious, but less confusing. Re: How to handle when there is a separate Basic Auth endpoint and api endpoint for each environment I ended up using project-level tenant property (e.g. ${#Project#tenant}) to parametrize the endpoints as suggested by KarelHusa Thank you! If anyone is interested, I also created a groovy script to grab and parse the token. Note, I'm a beginner at groovy script, so there may be an easier way to do this, but it worked for me 🙂 /**** @author: Scott Rixon Class to get the bearer token from the oauth/accessToken endpoint ****/ import org.apache.http.HttpHost; import org.apache.http.client.methods.HttpGet; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.auth.AuthScope; import org.apache.http.auth.UsernamePasswordCredentials; import org.apache.http.client.CredentialsProvider; import org.apache.http.impl.client.BasicCredentialsProvider; import org.apache.http.client.AuthCache import org.apache.http.impl.client.BasicAuthCache import org.apache.http.impl.auth.BasicScheme import org.apache.http.client.protocol.HttpClientContext import org.apache.http.client.methods.CloseableHttpResponse import org.apache.http.HttpEntity import org.apache.http.StatusLine import org.apache.http.client.HttpResponseException import org.apache.http.client.ClientProtocolException import org.apache.http.util.EntityUtils import groovy.json.JsonSlurper public class Bearer_Token { String env String username String password String token_type String access_token String url String uriPath String response String fullUrl String host public Bearer_Token(String env){ env = env username = "" password = "" host = "" url = "https://${host}" uriPath = "/oauth/accessToken" fullUrl = "${url}${uriPath}" } public send_request(log){ // Create Client CloseableHttpClient httpclient = HttpClients.createDefault(); // Create Host HttpHost targetHost = new HttpHost(host, 443, "https"); // Create Credential provider CredentialsProvider credentialsPovider = new BasicCredentialsProvider(); // Set Credentials credentialsPovider.setCredentials( new AuthScope(targetHost.getHostName(), targetHost.getPort()), new UsernamePasswordCredentials(username, password)); // Create AuthCache instance AuthCache authCache = new BasicAuthCache(); // Generate BASIC scheme object and add it to the local auth cache BasicScheme basicAuth = new BasicScheme(); authCache.put(targetHost, basicAuth); // Add AuthCache to the execution context HttpClientContext context = HttpClientContext.create(); context.setCredentialsProvider(credentialsPovider); context.setAuthCache(authCache); // Create HTTPGet HttpGet httpget = new HttpGet(fullUrl); // Add headers httpget.addHeader("Accept", "application/json"); httpget.addHeader("Content-Type", "application/json"); httpget.addHeader("Accept-Charset", "utf-8"); // Execute command CloseableHttpResponse response = httpclient.execute( targetHost, httpget, context); // Get Status StatusLine statusLine = response.getStatusLine() // Get Entity HttpEntity entity = response.getEntity(); // Throw exception if response code isn't successful if (statusLine.getStatusCode() >= 300) { throw new HttpResponseException( statusLine.getStatusCode(), statusLine.getReasonPhrase()); } if (entity == null) { throw new ClientProtocolException("Response contains no content"); } String content = EntityUtils.toString(entity); // Parse JSON def jsonSlurper = new JsonSlurper() def object = jsonSlurper.parseText(content) def jsonResonse = "${object['token_type']} ${object['access_token']}" log.info(jsonResonse) response.close(); return jsonResonse } } // Get Environment String node = project.getPropertyValue("node") String tenant = project.getPropertyValue("tenant") if(!node){ log.error("No node is configured in the Project Properties") } if(!tenant){ log.error("No tenant is configured in the Project Properties") } // Create Environment string String env = "${node}${tenant}" log.info("The environment is: ${env}") // Get Bearer token def response def t = new Bearer_Token(env) try{ response = t.send_request(log) } catch(err){ log.error(err) } // Set bearer token project.setPropertyValue("bearer_token", response) Re: How to handle when there is a separate Basic Auth endpoint and api endpoint for each environment richieI apologize for the late response. Thank you so much for the amazing details. We just hired a test architect and I'll have him review your settings to see if using property files is something we want to pursue. Currently I'm using a parameterized endpoint using properties and using Jenkins to pass the property variables to Test Runner. I created a groovy script to grab and parse the token. I'll share that in the main post. Thanks again! Scott Automate updating API definitions Our API definitions are constantly being updated. I would like testing to always be using the latest and most updated definitions. If I'm relying on testers to manually follow the update process outlined here https://support.smartbear.com/readyapi/docs/apis/update/update.html then we risk testing either using outdated definitions or different definitions, depending on when each tester updated them. My thought is having a Jenkins job run daily (or better yet when dev updates the definitions) that would: 1. Run a script in ReadyAPI to update the API Definitions 2. If there are updates, commit the changes to gerrit. 3. Send a status message to Slack It seems fairly straightforward, but I don't know what I don't know. Has anyone tried something like this before? Is it possible to run a groovy script from ReadyAPI remotely using Jenkins? I imagine one way to do this is to create a 'test' with a groovy script that can perform this action and then assign a special tag and the jenkins job could run Test Runner with the tag. I'll keep researching in the meantime, but any thoughts would be greatly appreciated! Re: How to handle when there is a separate Basic Auth endpoint and api endpoint for each environment Hi richie, Thanks for the suggestions. At my previous company we set properties in files, but I was hoping I could do something like what Karel suggested using the -E and -P and set properties at run time. Then I don't have to update or store files. I will consider this option, but will have to test it. I'm interested in your setup suite. How do you have this configured so it always runs first?