10-06-2009, 03:10 AM
Thanks Saket. I took your suggestion and tried to get the error message. It spit out Error #-2147467259, but the Err.Description was blank. Searching Google for -2147467259 didn't return anything.
We're using QTP 9.2 with IE 7. The code is pretty straight-forward. This is what it's actually doing...
We're using QTP 9.2 with IE 7. The code is pretty straight-forward. This is what it's actually doing...
Code:
' Identify the new User ID and Password.
Browser(strBrowserName).Page(strPageName).Link("Temporary UID").Click
Browser(strBrowserName).Page(strPageName).Sync
If InStr(Browser(strBrowserName).Page(strPageName).WebElement("UID Message").GetROProperty("innerhtml"), "Dear") > 0 Then
strTotalUIDMessage = Cstr(Browser(strBrowserName).Page(strPageName).WebElement("UID Message").GetROProperty("innerhtml"))
End If
intStartChar = InStr(1, strTotalUIDMessage, "User ID:", 1)
intEndChar = 50
strUIDReceived = Cstr(Mid(strTotalUIDMessage, intStartChar, intEndChar))
intStartChar = 1
intEndChar = InStr(1, strUIDReceived, "<BR>", 1) - 2
strUIDPassword = Left(strUIDReceived, intEndChar)
intStartChar = InStr(1, strUIDReceived, "- Password", 1) + 2
intEndChar = Len(strUIDReceived) - intStartChar - 4
strUIDReceived = strUIDPassword & " " & Cstr(Mid(strUIDReceived, intStartChar, intEndChar))
' Load the results into the Global DataSheet.
DataTable.Value("EMailTempUID", dtGlobalSheet) = strUIDReceived
On Error Resume Next
Browser(strBrowserName).Back
MsgBox Err.Number
If Err.Number <> 0 Then
MsgBox Err.Description
End If