Highlighted
Frequent Contributor.
Frequent Contributor.
341 views

Can UFT type dates and change automatically each day?

So I have this line:

Window("PhotoMesh  [View Mode]").Dialog("Open").WinEdit("File name:").Set "test"

Which types text. I want instead of text that it'll type the date and will automatically change each day without me actually changing it.

0 Likes
4 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: Can UFT type dates and change automatically each day?

You can use ".Set date", you may need FormatDateTime function if you need it in other formats, check below for more details:

https://www.w3schools.com/asp/func_formatdatetime.asp 

0 Likes
Highlighted
Frequent Contributor.
Frequent Contributor.

Re: Can UFT type dates and change automatically each day?

Thanks for your reply.

The link is broken. How do I change the line so instead of "Test" it'll type the date time?

0 Likes
Highlighted
Micro Focus Frequent Contributor
Micro Focus Frequent Contributor

Re: Can UFT type dates and change automatically each day?

Hello,

 

This is the function that we can do using UFT by VBscript: https://admhelp.microfocus.com/uft/en/all/VBScript/Content/html/ab4fe211-df30-4702-9317-5869c5668c6a.htm

 

Thanks & Regards,

 

0 Likes
Highlighted
Frequent Contributor.
Frequent Contributor.

Re: Can UFT type dates and change automatically each day?

Fixed it.

What I did is:

a=Replace(Now"/""_")
b=Replace(a, ":""_")
tnow=Replace(b, " ""_")           \\  and then changed the text to tnow so its like this

Window("PhotoMesh  [View Mode]").Dialog("Open").WinEdit("File name:").Set tnow     \\ instead of "test"

 

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.