08-27-2013, 02:25 PM
Hi everybody
I am having troubles when executing the following code from UFT. The code is included in a separate action which has a local data table. When I run the action separately, everything is working perfectly and the test passes. If I call the action from another action, I get the following error: "Fail to run the test due to un unknown error".
Here is the code I am using:
Note: The code includes some functions for String format and Exists function returns a Boolean if the obj exists. These functions are working. The objects in OR are having an added property called "section".
Please let me know if you have an idea about what I am doing wrong...
Thank you!
I am having troubles when executing the following code from UFT. The code is included in a separate action which has a local data table. When I run the action separately, everything is working perfectly and the test passes. If I call the action from another action, I get the following error: "Fail to run the test due to un unknown error".
Here is the code I am using:
Code:
ExistsInSection DataTable("BasicSettings", dtLocalSheet), "BasicSettings"
Code:
Function ExistsInSection(ByVal columnName, ByVal section)
If columnName<>"" Then
CheckCondition Exists(oPage.WebElement(columnName)), "test", "test"
CheckCondition StrComp (oPage.WebElement(columnName).GetTOProperty("section"), section)=0, "test", "test"
CheckCondition Exists(oPage.WebCheckbox(ColumnName)), "test", "test"
CheckCondition StrComp (oPage.WebCheckbox(columnName).GetTOProperty("section"), section)=0, "test", "test"
End If
End Function
Code:
Public Sub CheckCondition(ByVal p_blnCheckCondition, ByVal p_strReportStepName, ByVal p_strReportDetails)
If p_blnCheckCondition Then
ReportSuccess p_strReportStepName, Format1("SUCCESS: {0}", p_strReportDetails)
Else
AbortTest p_strReportStepName, Format1("FAILED: {0}", p_strReportDetails)
End If
End Sub
Note: The code includes some functions for String format and Exists function returns a Boolean if the obj exists. These functions are working. The objects in OR are having an added property called "section".
Please let me know if you have an idea about what I am doing wrong...
Thank you!