[TechCorner Challenge #1] Passing custom command-line arguments as test parameter
Hi Community! This resource we are creating together has gained so much value over the years. Tons of helpful content can be found in the TestComplete Community thanks to all of you! I propose that we take it to the next level by adding even more useful things to the TechCorner tag - a tag where we keep your tech articles, script examples, use cases, etc. Here's your chance to share expertise and contribute. Task: Write a script that will take the value of a custom argument from the TC command line and use this value to run a parameterized test. Difficulty: For example, imagine that you have a web test that takes the name of the browser as a parameter. The script should check the command line TC was launched with, find the /BrowserName parameter, read its value, and pass it to the web test as a parameter. If the command line contains /BrowserName=chrome, the web test should launch Chrome; for /BrowserName=firefox the web test should launch Firefox, etc. Good luck!Solved5.3KViews3likes7Comments[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 the Leaderboard 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 use FindChild or FindElement in your script. Note: You will need a Web Module to fulfill this task. Good luck!Solved13KViews2likes7Comments[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 #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 file and 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