Contributions
Formatting a date in a Code Snippet
Hello. I have a test script where I need to input the week beginning date in a date field. The format of the date field is mmddyyyy. I am using this code snippet: (Date-WEEKDAY(Date())+1) The issue I am running into is today is May 3, 2022 and week beginning date, May 1, 2022 is entered as 512022 (mdyyyy), not 05012022 (mmddyyyy). What is the syntax to format this as mmddyyyy using VBA? I am not concerned about date separators. Just having the date display as 05012022. Thanks in advance!Solved634Views0likes3CommentsName Mapping defaults to conditional mapping
Hi. I am creating a keyword test, and name mapping appears to be defaulting to Conditional mode. I would like to change this back to the standard mode that works off of the object properties. I cannot seem to change this. There is no checkbox in the Edit mode to switch this mode off. I even deleted my mapping document and tried creating a new one but still have the items mapping in conditional mode. Has anyone else run into this? I am running TC Version 14.73.382.7 x64. Edge browser.Solved821Views0likes1CommentRe: Save first few digits of a string as a variable
Thank you so muchtristaanogre andhkim5. Between the two of you I was able to write a basic script that worked!tristaanogre, you are correct, I do need to learn to write script. I have known this for a long time. Just need to do it. Thank you both again.1.6KViews0likes0CommentsSave first few digits of a string as a variable
Good morning. I have a Keyword test, using VBScript. As part of this test, I have to have the script enter the base pay for a worker being hired. The UI actually lists a Pay Range in a field that is valid for the position. The Range displays as "12.00 - 15.00 /Hour" for example. I can use the string as my variable by pulling the contentText of the object and setting that to my variable to save for use later, but that pulls the whole string. What I really want is just the "12.00" portion of the string, and use that as my variable to be entered as the new hire's hourly wage in a step in my test. Ideally take the text that displays to the left of the "-" character. My screenshot includes what I am currently using to get the whole string. I'm guessing I need to use the Code Expereeion mode of the Set Variable Value, but have no idea how to code this. Again, this is a VBScript Keyword Test. Any help would be very much appreciated.Solved1.6KViews0likes3CommentsRe: Write a variable value to Excel in Keyword Test
Hey Lino... Thank you. This looks promising. I am having trouble getting this to run. I plugged this into a scritp, but am getting the following Syntax error: At "sFunction Write Data to Excel() " Error 110" SYNTAX ERRPR whil leatind character "{". Error Location: Unit: "Workday Testing\Create Postion\Script\Unit1" Line: 2 Column : 1. It doesn't like the "{". What am I missing here? Thank you. Dave.1.6KViews0likes1CommentWrite a variable value to Excel in Keyword Test
Hi. I have a Keyword test I am looking for assistance with. I am testing a process that creates a position that will later be filled by a newly hired employee. In the create postion process, I can identify the position(s) being created by a unique ID number that is generated for each position created. I can capture this Position ID using a Variable (setting a temporary variable = to the contentText of the object), but what I do not know how to do is to write the Position ID to an excel spreadsheet (not the sheet I am using for my create position data, as it is locked by this test). This Position ID will be used in a different test to assign workers to positions. Does anybody have any idea on how to write this captured value to Excel in a Keyword test without a great deal of complicated code? I am not a strong coede writer. Thank you in advance for your attention!Solved1.7KViews0likes3CommentsSet the value of an object property in Name Map to a variable value.
Hi. I have a web based, keyword test that is giving me some trouble. I am testing security roles for different users for an application. Depending on who I am testing as, objects may or may not display in the UI. In addition, one user may see an Info button where another will see an Edit button for example. I have attached an example of what a role might seebelow. The EDIT buttons are giving me the trouble. Specifically, I need to be able to identify that a user can edit Next Performance Review Date or Business Continuity Team but I have no way of identifying these button every time as the button properties all change based on user. So TC has a hard time differentiating the different Edit buttons from the mapped button due to the properties always changing. Here’s what I do have: The Next Performance Review Date and Business Continuity Team sections I can easily identify by their contentText Property. So I have no trouble finding those. Additionally, based on being able to find this, I can very easily determine the ID’s of these sections, which is an integer ranging from 0 – 40 depending on the number of objects displayed. Again, this ID changes depending on what else displays. I know that the ID of the corresponding Edit button is NextPerfomanceReviwDate.ID +1 for it’s corresponding Edit button and BusinessContinuityTeam.ID +1 for it’s corresponding Edit button. So in the screenshots above, the ID for the Next Performance Review Date section is 10. It’s corresponding Edit button ID is 11. Again, these are not the same for each role I need to test, nor are the other properties but the button ID is always one more than the ID of it's corresponding Object. Using the Set Variable Value operation in the Keyword Test operations, I was able to create a temporary variable to be NextPerfomanceReviwDate.ID +1. I was hoping to be able to assign this to the ID property of my Edit button in Name Mapping. Is there a way to assign the ID property of my object mapped for the Edit button to be = to the variable I created for NextPerfomanceReviwDate.ID + 1? Any other suggestions? Thank you for your time! Dave.Solved2KViews0likes4Comments