All my scripts were working fine when I was using IE8 and QTP11. Recently I have upgraded to IE11 and UFT12.
If I try to run the same scripts, getting the below error. Can you pls help me to resolve this issue.
Error Message:
External object RbQtpExtension.Wrappers.StringWrapper::Format has thrown the following exception:
Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
Function file: E:\OIS_RT\FuctionLibray\OrCore_Lib\core-functions.qfl
Line (280): "Format = m_value.Format(CStr(strFormat), argsArray)".
Piece of code:
class [Static|System.String]
private m_value
private sub Class_Initialize()
set m_value = DotNetFactory.CreateInstance("RbQtpExtension.Wrappers.StringWrapper", UFT.DotNetExtensionDllPath)
end sub
public function Compare(strSource, strValue, blnCaseSensitive)
dim cmp : cmp = IIF(blnCaseSensitive, 0, 1)
Compare = StrComp(CStr(strSource), CStr(strValue), cmp)
end function
public function Contains(strSource, strValue, blnCaseSensitive)
dim cmp : cmp = IIF(blnCaseSensitive, 0, 1)
Contains = (InStr(1, CStr(strSource), CStr(strValue), cmp) > 0)
end function
public function EndsWith(strSource, strValue, blnCaseSensitive)
dim a : a = IIF(blnCaseSensitive, CStr(strSource), ToUpperInvariant(CStr(strSource)))
dim b : b = IIF(blnCaseSensitive, CStr(strValue), ToUpperInvariant(CStr(strValue)))
EndsWith = (Right(a, Len(b)) = b)
end function
public function Equals(strSource, strValue, blnCaseSensitive)
dim cmp : cmp = IIF(blnCaseSensitive, 0, 1)
Equals = (StrComp(CStr(strSource), CStr(strValue), cmp) = 0)
end function
public function EqualsInvariant(strSource, strValue, blnCaseSensitive)
dim ret : ret = m_value.EqualsInvariant(CStr(strSource), CStr(strValue), blnCaseSensitive)
EqualsInvariant = IIF((ret = "True"), true, false)
end function
public function Format(strFormat, argsArray)
Format = m_value.Format(CStr(strFormat), argsArray)
end function