Tuesday, August 4, 2015

vCloud - VMRC plugin is missing

if you are using vCloud and Windows Updates updated your IE, you might be surprized to see that you no longer can open VMs in Console, because you get this annoying message:


If you click OK, nothing happens...

To fix this, you need to go in Internet Explorer -> Tools -> Compatibility View Settings, and add your vcloud url to start in compatibility view.

Now, when you start a Console, you will get the same pop-up, but this time, if you click ok, you will be able to download and install the plugin.

UFT - Handle Date with 2 digits month and day

If you ever need to verify some date in the GUI is equal to current date, you will probably get something like this:

date in GUI: "08/04/2015"
current date, given by Date funtion: #8/4/2015#
cDate(date in GUI): #4/8/2015# (!month and day are switched, so you cannot compare)

The solution I found is:

 publishedOn = Browser("Browser_Local").Page("Page").WebEdit("Published on").GetROProperty("Value")  
 dateNow = Right(String(2"0") & Month(date), 2) & "/" & Right(String(2"0") & Day(Date), 2) & "/" & Year(Date)


Basically Right(String(2"0") & Month(date), 2) will give you 2 digits.

Reference:
https://jasonadamlee.wordpress.com/2011/07/21/vbscript-easy-two-digit-month-and-day/