[TechCorner Challenge #17] Get a full Raw JMS request
Hello Сommunity! Check out this new TechCorener task! Participation rules and the TechCorner Leaderboard can be found here. When sending long JMS messages, they might be shown truncated on the Raw Request and Response tabs in ReadyAPI: Task: Write a script for RequestFilter.filterRequest event handler to get the full Raw JMS Request message. Difficulty: Here is a sample of a JMS body: { "feild1":"IT", "feild2":" accepted", "feild3":"Test_accepted", "feild4":"000-111-222", "feild5":" data3", "feild6": " data4", "feild7": " data5" } Best of luck, friends!😊 A tip: You should be able to get a full response using this piece of code: def request = testRunner.getTestCase().getTestStepByName("JMS_TestSTep_Name").getRequestStep().getTestRequest() def fullJmsMessage = request.getResponse().getMessageReceive().getText()1.2KViews0likes0Comments[TechCorner Challenge #16] Compare an expected JSON value and actual response in Events
Hello ReadyAPI Сommunity! We are bringing more awesome tasks your way🙂Check out the participation rules and the TechCorner Leaderboard here. In this task, we will have a scenario where you will be comparing an expected JSON value from your Data Source and the actual JSON response. This can be done in a separate Groovy Script test step or in the Script assertion but for this task, we are asking you to do so in the RequestFilter.afterRequest event. Task: Compare an expected JSON and actual response in the event Difficulty: In your script, you will be fetching the expected response from your Data Source and your JSON response, and then, parsing the JSON to compare their values. JSON response example Expected JSON value (stored in the DataSource test step) { "id": 1111, "name": "doggie", "photoUrls": [ "string" ], "tags": [ { "id": 99, "name": "string", "Additional info": [ { "ad1": "string", "ad2": "string" } ] } ], "status": "available" } { "id": 1111, "category": { "id": 0, "name": "string" }, "name": "doggie", "photoUrls": [ "string" ], "tags": [ { "id": 99, "name": "string" } ], "status": "available" } Here's hint:https://smartbear-cc.force.com/portal/KbArticleViewer?name=How-Do-I-Compare-Two-Dynamic-JSON-Responses&sp=all1.3KViews0likes1Comment[TechCorner Challenge #13] Get properties of a web page element
Hi TestComplete Community, A new TechCorner task today - we will be working with the DOM Document object. By completing the tasks, you can practice your skills of working with TestComplete features and also get into the TechCorner Leaderboard! Task: You will need to find the “Start a topic” button on this page and get the following info about it: color, font family, and font size and post the script and the log info below. Difficulty: The button you'll be interacting with: For this: 1. Get the element. 2. Obtain the element style as described in the documentation: Getting Computed Styles. 3. Log the values of the following style properties: backgroundColor, fontFamily, and fontSize. Good luck!😊Solved2.4KViews0likes4Comments[TechCorner Challenge #12] Compare images using the Region Checkpoint
Hi TestComplete Community! Dare to take the challenge?🙂 By completing the tasks, you can practice your skills of working with TestComplete features and also get into the TechCorner Leaderboard! Task: Compare the two images below using TC Region Checkpoint ...and reveal a secret message!Post the message and the script to the comments. Difficulty: Steps to do this: 1. Add the images below to the Regions collection. 2. Perform a pixel-by-pixel comparison using the Check method. 3. Click the “View Comparison Result” button in the log to reveal the secret message and post it along with your script to the comments! Images to compare: Have fun and good luck😊Solved2.9KViews0likes5Comments[TechCorner Challenge #11] Converting UTC TimeDate in an Excel file
Hi everyone! Up for a challenge? By completing the tasks, you can practice your skills of working with TestComplete features and also get into the TechCorner Leaderboard! Today, we are going to work with UTC DateTime stored in an Excel file. Task: Read the UTC DateTime in an Excel file (attached), convert the value for the PST (Pacific StandardTime) time zone and log each date in the following format: <month name> <day of month>, <full weekday name>. For example: September 8, Tuesday. Difficulty: Note: Find the Excel file attached. Steps to do this: 1. Read the dates from the Excel file using one of the approaches described in Working with Microsoft Excel Files. 2. Convert the dates using the aqDateTime object methods. 3. Log the date using the aqConvert.DateTimeToFormatStr method. Best of luck to all participants!Solved5.6KViews0likes8Comments[TechCorner Challenge #15] Fetch a value/data from a JSON response using a Groovy Script
Hello ReadyAPI Community! We have another task for you to put your ReadyAPI knowledge to the test. Check out the participation rules and the TechCornerLeaderboardhere. In this task, we will have a scenario in which you need to iterate throughout a JSON response to find a specific item/value from it. You should stop once the value has been found. Task: Find a specific value in a JSON response using a Groovy script Difficulty: Here is what your script should do: 1. Iterate through all the test steps in a test case that have JSON responses. 2. Compare the value given (VeryImportantString) with all the values in the JSON response. 3. Once the value is found, return it. If there is no such value in the response, return “The value wasn’t found“. JSON response example: { "id": 1111, "name": "doggie", "photoUrls": [ "string" ], "tags": [ { "id": 99, "name": "string", "Additional info": [ { "ad1": "VeryImportantString", "ad2": "NoteVeryImportantString" } ] } ], "status": "available" } Helpful Tips: Iteration Sample Code: def TesCaselist=context.testCase.testSuite.getTestCaseList() TesCaselist.each{ def steps=it.getTestStepList(); //'it' is used for referring to current item steps.each{ (CHECK SMTH)? <DO SMTH>:<DO SMTH ELSE> } Good luck!Solved5.3KViews0likes5Comments[TechCorner Challenge #14] Filtering data retrieved from a DataSource
Hi ReadyAPI Community! We’ve prepared an interesting task for you to solve today! Check out the participation rules and the TechCornerLeaderboard here. Imagine that you are working with an app for setting up online conferences, and you need to filter data based on certain criteria. In our case - the location of an online conference participant. Task: Create a script that will filter data retrieved from a DataSource Difficulty: Here’s what your script should do: 1. Take an item in a DataSourse and check if it matches the criteria. 2. If it does, run the test. If it doesn't - skip the item. The Excel file to be used as a DataSource is attached below. Condition: Run the test only when participants of an online user conference are located in Boston. Resources: Here are some examples of working with DataSources in Groovy scripts:https://support.smartbear.com/readyapi/docs/testing/scripts/samples/data.html The full description of the class - here you can find all the properties and methods that the class has: https://support.smartbear.com/readyapi/apidocs/pro/DefaultPackage/WsdlDataSourceTestStep.html Good luck!Solved4.1KViews0likes7Comments[TechCorner Challenge #13] - Call Database Connection Using Groovy Script
Hello ReadyAPI Community! We have returned with a task for you to attempt. See the participation rules and the TechCornerLeaderboard here. Participate in the challenge and earn new unique badges! Check out some of these awesome rewards: In this week’s task, we will be having you use scripting to connect to a database. Task: Create a Groovy script that will connect to a database Difficulty: Steps to follow: 1.Create a database connection using the ReadyAPI interface. 2. From your script, call the database connection, connect to the database, and return a success message on a successful connection to the database. Good Luck!Solved3.6KViews0likes6Comments[TechCorner Challenge #10] Sending HTTP requests and parsing JSON in TestComplete
Hi everyone! Let’s start September with a new challenge in the TestComplete Community! We are going to learn something great today. And, by completing the tasks, you will not only improve your TestComplete skills but also get into the TechCorner Leaderboard. TestComplete allows sending HTTP requests using the aqHttp object. Let's see if you can solve our task based on this functionality! Task: Create a script in TestComplete that will get an image link from this API endpoint (https://dog.ceo/api/breeds/image/random) and save the image on the machine. Post your script and the image you got to the comments! Note: the provided endpoint does not require any authorization. Difficulty: Steps to follow: 1. Send a GET request to https://dog.ceo/api/breeds/image/random. Check the status of the request - if it is successful, the response will return a JSON that contains a link to a random picture of a dog. 2. Parse the returned JSON to extract the link to the image. JavaScript and Python provide support for JSON out of the box; for other languages, you might want to parse JSON as a string or use regular expressions. 3. Send a GET request to the URL obtained from the previous response - this will return an image. 4. Save the response as an image to a JPG file by calling the SaveToFile method like this: response.SaveToFile("C:\\image.jpg") Best of luck!😊Solved3.9KViews0likes2Comments[TechCorner Challenge #9] Generate a random number within a range
Hi Community! Another awesome task is ready🙂 By completing the task, you will not only learn TestComplete features but also get into the TechCorner Leaderboard. Participate in the challenge and earn new unique badges! Check out some of these awesome rewards: Let's imagine that you are testing an application that has gaming elements - a knight is using a legendary sword to slay a dragon! And, the sword will deliver damage in the following range - from 30 to 75. Instead of using the same number every time, you want to generate a random number on each run and enter it in the application. How would you do it in TestComplete? Let's see if we can get an example for each scripting language (JavaScript, JScript, Python, VBScript)! Task: Generate a random number within the following range (30-75) in TestComplete using a scripting language of your choice. Difficulty: Bonus: You will get an additional point for each script written in a different language. Best of luck!Solved11KViews1like10Comments