can u write one user defined function for webedit class.
Answer Posted / zakir qureshi
DataTable.AddSheet("FrameWork")
DataTable.ImportSheet "D:\Excel Automation -
Imp\Frame.xls","FrameWork","FrameWork"
varRowCnt=DataTable.GetSheet("FrameWork").GetRowCount
For i=1 to varRowCnt
DataTable.GetSheet("FrameWork").SetCurrentRow(i)
Set
varBrowser=Browser(datatable.Value("BrowserPropName","FrameWork")&":="&datatable.Value("BrowserValue","FrameWork"))
Set
varPage=varBrowser.Page(datatable.Value("PagePropName","FrameWork")&":="&datatable.Value("PageValue","FrameWork"))
Set
varObject=varPage.WebEdit(datatable.Value("ObjPropName","FrameWork")&":="&datatable.Value("ObjValue","FrameWork"))
varObjValue=DataTable.Value("Expected","FrameWork")
varCnt=Set_EditBoxValue(varBrowser,varPage,varObject,varObjValue)
Next
Public Function
Set_EditBoxValue(varBrowser,varPage,varObject,varObjValue)
'Set
varBrowser=Browser(datatable.Value("BrowserPropName",dtglobalsheet)&":="&datatable.Value("BrowserValue",dtglobalsheet))
varBrowserExist=""
varBrowserExist=varBrowser.Exist(2)
If varBrowserExist="True" Then
Set_LoginDetails=varBrowserExist
'Set
varPage=varBrowser.Page(datatable.Value("PagePropName",dtglobalsheet)&":="&datatable.Value("PageValue",dtglobalsheet))
varPageExist=""
varPageExist=varPage.Exist(2)
If varPageExist="True" Then
Set_LoginDetails=varPageExist
'Set
varObject=varPage.WebEdit(datatable.Value("ObjPropName",dtglobalsheet)&":="&datatable.Value("ObjValue",dtglobalsheet))
varObjectExist=""
varObjectExist=varObject.Exist(2)
If varObjectExist="True" Then
Set_LoginDetails=varObjectExist
varObject.Set varObjValue
varActualValue=varObject.GetROProperty("value")
DataTable.Value("Actual","FrameWork")=varActualValue
If trim(varActualValue)=trim(varObjValue)Then
DataTable.Value("Result","FrameWork")="Pass"
Else
DataTable.Value("Result","FrameWork")="Fail"
End If
Else
Reporter.ReportEvent 1,"Object does not exist","Object
does not exist"
DataTable.Value("Result","FrameWork")="Object does not
exist"
Set_LoginDetails=varObjectExist
End If
Else
Reporter.ReportEvent 1,"Page does not exist","Page does
not exist"
DataTable.Value("Result","FrameWork")="Page does not exist"
Set_LoginDetails=varPageExist
End If
Else
Reporter.ReportEvent 1,"Browser does not exist","Browser
does not exist"
DataTable.Value("Result","FrameWork")="Browser does not exist"
Set_LoginDetails=varBrowserExist
End If
DataTable.ExportSheet "D:\Excel Automation -
Imp\Frame.xls","FrameWork"
End Function
Is This Answer Correct ? | 2 Yes | 5 No |
Post New Answer View All Answers
What is ‘object spy’ and what is the function of object spy in qtp?
What is the use of ordinal identifier in qtp?
How will you handle java tree in qtp?
What are private functions in QTP? How they can be called from the function library?
Can any one send me the QTP Basic Coding Samples?
how can we compare descriptive programing with a regular expression
Can you brief the hurdles you faced during Automation testing?
What is the difference between shared and local object repository?
What VBScript operators, functions, and statements do you use in QuickTest Professional?
In QTP can we feed the out of one browser(internet explorer) as an input to the another browser(mozilla firefox)? If yes explain how to do it with an example.
What r the different filters in defect in quality center
write script for bitmap image?
Hi, How Accessibility checkpoint in QTP can be implemented in the test script?
Explain types of output values?
How to handle dynamic objects in quicktest professional?