Forum Discussion
I suggest you refer and understand how aqDateTime Object works, and look at the examples provided & the methods. If you want to format the date, then refer to Marsha_R response.
It's worth understanding what Epoch is.
Thank you both for your responses. I did the research into the aqDateTime object and its formatting options. I created this sample of python unit script code but I must be missing something because the interpreter will not let me execute. What could I be missing? Yes, I checked the examples.
def ConcatLastNameWithTime():
Str1 = "Aliases.browser.pageApplyNow6.formWouldYouLikeToIncludeA.textboxLastName"
Str2 = "aqConvert.DateTimeToFormatStr(aqDateTime.Now(), "%Y%m%d%H%M%S"))
Log.Message(aqString.Concat(Str1, "Str2"))
# Log.Message(Aliases.browser.pageApplyNow6.formWouldYouLikeToIncludeA.textboxLastName + aqConvert.DateTimeToFormatStr(aqDateTime.Now(), "%Y%m%d%H%M%S"))
then yes I need it in a variable project wide. How would I get the above to run in the interpreter correctly and then how do I make it into a variable? Could I make my variable point to Unit1?
- todd22 years agoContributor
Or MarshaR would this be simpler somehow to deploy?
Sincerely,
Todd
- todd22 years agoContributor
So I went ahead and built three steps into my keyword test script
The Unit2 script runs by itself just fine but when it executes within the entire keyword script it gives me an exception. Why? My thought was I have the time format working well. I can place the lastname in a variable project wide now and I initialized it with a starter value just fine by setting the default value. All I want to do is run the code snippet Project.Variables.LastName + Unit2 Can't that be done?
Sincerely,
Todd2
- todd22 years agoContributor
Works great! Now I just need to add that last name that is in the Variable for the project at the moment the script runs to the front of this output as one big string and we are good to go. What could I be missing?
Thanks,
Todd2
Related Content
- 13 years ago
Recent Discussions
- 2 hours ago
- 6 hours ago