[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 #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[TechCorner Challenge #6] - Compare HTML table with Excel file and correct data in Excel file
Hi TestComplete Community! Welcome to our weekly challenge where anyone can put their tool knowledge to the test! By completing the task, you will practice your TestComplete skills, learn new things about working with the product, and get into the TechCorner Leaderboard! Check out this week’s task: Since working with HTML tables and Excel files is quite common when working with TestComplete, here’s one more task connected to this topic. Task: Create a script to compare an HTML table with an Excel file and correct the data in the Excel file. Difficulty: So, when the script encounters an HTML table cell, the value of which is different from the value of the corresponding Excel table cell, the Excel cell value should be changed to what’s actually shown in the table. Resources: - The HMTL table can be found here - Web Orders table. - The Excel file is attached below. Steps to follow to fulfill this task: 1. Parse the Orders table. 2. Save the table to the variable. 3. Working with Microsoft Excel Files - here you can choose the right way to extract data from the Excel file (TestComplete 14.50 users, check out thenew Excel support- it does not require Excel to be installed on your machine). 4. Using a loop in the script, compare the table variable and Excel content cell-by-cell. 5. If the value in the Excel cell is different from the HTML table cell, it should be replaced with what’s shown in the table. Good luck! P.S. You can find the TechCorner Leaderboard and the rules of how to participate in the TechCorner Challenge by this link.4.4KViews0likes4Comments[TechCorner Challenge #8] Finding Elements on a Web Page
Hi TestComplete Community! Today, I bring you a new TechCorner Challenge task 🙂 By completing the tasks, you will not only learn TestComplete features but also get into the TechCorner Leaderboard. Today we will use the Leaderboard table itself to sharpen your skills! Let’s use TestComplete to find out if a user is on the table and how many points they gained so far! Task: Create a TestComplete script that will go to theLeaderboard page, search for yourself (by your user name) and a user named tristaanogre in the table and, if this user is mentioned on the Leaderboard, post their score to the log. Can you compete with people in the Leaderboard?😊 Difficulty: Tip: You can useFindChildorFindElementin your script. Note: You will need a Web Module to fulfill this task. Good luck!Solved13KViews2likes7Comments[TechCorner Challenge #7] Retrieve Data from a Web Page
Hi Community members! I’ve got a new task for you today. It will help you practice your TestComplete skills and, also, get into the Leaderboard! Many of you knowTanyaYatskovska- she is a SmartBear Community Manager and contributes a lot to the Community. Do you how many of her answers were marked as Solutions? This kind of info can be retrieved using TestComplete! Task: Record a TestComplete script that will go to a user profile page (TanyaYatskovska in our case) and get the number of Solutions for a specific community member. Difficulty: Share your code (a keyword test or script) and the number of Solutions Tanya has in the comments below. Note: You will need the Web Module to fulfill this task. Good luck!Solved2.1KViews0likes5Comments[TechCorner Challenge #5] Comparing content of HTML table with Excel file data
Hi TestComplete Community! Ready for a challenge? Here it is!Learn new things about working with the product, and get into the TechCorner Leaderboard! Task: Create a script that will compare the values of an HTML table and an Excel file cell by cell and log the difference between them. Difficulty: For the task implementation, you can use the Web Orders table and the attached Excel file. Here is an example of TestComplete’s Test Log demonstrating the difference between the sources: Solve the task and post your scripts here. We are looking forward to seeing your scripts! Helpful resources: You can loop through the table as described in this article: Parsing HTML Tables. As for working with Excel, TestComplete offers several ways to extract the data - choose the one you want to use in Working with Microsoft Excel Files. If you are using the latest TestComplete version (14.50), you can utilize thenew Excel support- it does not even require Excel to be installed on the machine! Note: the HTML table size and the Excel table size might be different. So, it’s a good idea to throw an error if the dimensions are not the same. Good luck! P.S. You can find the TechCorner Leaderboard and rules of how to participate in the challengeby this link.Solved2.9KViews0likes3Comments[TechCorner Challenge #3] - Changing the options from outside of TestComplete
Hi TestComplete Community! I bring you another task for our weekly scripting challenge🙂 Learn new things about working with the product, and get into the TechCorner Leaderboard! Imagine that you need to change the TestComplete options on several machines - for example, set the JVM location. You don’t want to do it manually and decide to create a script and run it on each machine. How could this script look? We suggest using JScript or VBScript, but you choose PowerShell, Python, etc. Task: Create a script that changes TestComplete options from outside of TestComplete Difficulty: It is a bit more difficult than the tasks we posted here before, let's see how quickly you can solve his one!🙂 Upd: More hints! Follow these steps to solve this: 1. You need to modify the XML file that contains the TestComplete settings - tcSettings.xml. The file is located in %LOCALAPPDATA%/SmartBear/TestComplete/14.0. You can use the ExpandEnvironmentStrings method of the WScript.Shell object to obtain the %LOCALAPPDATA% environment variable value. 2. Open the XML fileand locate the node that should contain the option value. You can use the selectNodes or selectSingleNode methods of the DOMDocument object to get the needed node. 3. Set the needed value for the node attribute. 4. Save the XML file.Solved3.9KViews1like12Comments