Assign a variable from a ComboBox in a UserForm
Hi... I am working with a UserForm in a Keyword test. The Keyword test first opens my userform, which has two dropdown boxes.
- Dropdown 1 is XferType, which has 3 different selections.
- Dropdown 2 is Department which has about 25 or so different selections.
Based on what the user selects in the dropdown boxes, I am trying to assign those values to variables in my Keyword test using the Set Variable statement. The variables are TransferType and Dept.
Then I have a simple message appear showing the value of the TransferType variable to verify that the value assigned correctly. I keep getting an Error - Type mismatch.
I have attached a screenshot showing what I have going on. Does anybody see what I am missing here?
Thanks for your time.
Dave.
Hey DainiusA!
Good news here is that aqDateTime also has a AddDays function that will allow you to add or remove a specific amount of days that will adhere to the calendar.
For instance, in the code below we create variables that hold Todays date, then we subtract one from it. The AddDays function will roll the time back to the previous month if Todays date is the first of the month.
// script start
function yesterDay()
var today, yesterdayRaw, yesterdayFormatted;
today = aqDateTime.Today();
yesterdayRaw = aqDateTime.AddDays(today, -1);
yesterdayFormatted = aqConvert.DateTimeToFormatStr(yesterdayRaw, "%Y%m%d");Log["Message"]("yesterdayFormatted " + (yesterdayFormatted));
// script end
Here are some docs that cover these functions. I hope this helps!
https://support.smartbear.com/testcomplete/docs/scripting/working-with/dates/javascript.html
https://support.smartbear.com/testcomplete/docs/reference/program-objects/aqdatetime/adddays.html