I have a checkbox named "CB05"
I use DP to click on the checkbox
iActionValue = 05
So "CB" &iActionValue
My problem is QTP11 will drop the zero, "CB5" will not work
Any ideas how to keep QTP from dropping the zero
Thanks in advance
iActionValue = "05"
If that is an iterator value rather than hard coded, you'd have to do something fancy like say if num < 10 then iActionValue = "0"&tostring(iActionValue)
FormatNumber function has a leading zero option, but it only works on decimal values.
Last edited by NoUse4aName; 10-04-2013 at 06:51 AM.
You probably want to do a cast from int to string first. Then check the length, if under 2 digits, add a 0 prefil.
or you can do it quick and dirty if you don't have to worry about complex number cases.
if value < 10
iActionValue = "0" & CStr(value)
iActionValue = CStr(value)