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


Please Help Members By Posting Answers For Below Questions

Is it possible to use two instances of UFT on the same machine? If not why?

602


Can we record using all the modes in a single script? Explanation with example is appreciated

1390


Can we write winrunner language i.e TSL in QTP tool?

1474


I have some real time based question.. 1.what are the challenges you have faced in your current project. 2.what are the bugs you found in your current project. 3.what are the strategies you follow to convert manual test cases into automation test cases. 4.how QTP identify two different browsers. 5. When you create a function library and share object repository what are the problems you have faced 6. How to solve the tool tip problem 7.what are the interesting bug you have found in your current project. 8.what is your daily work as a automation test engg. 9. how to create a weekly status report. 10. how many test cases you write,review and execute per day. 11.what are the uses of SQL in automation. 12.How to retrieve the data in html through vb script. 13.If application is very slow how to test the application in qtp.

3571


How QTP support all types of applications (platforms)?

4081






what is Property......End Property loop? how to write sript for it in QTP

1894


What is the script for database check point, bitmapchek point, regular expression ?

1555


Could any one tell me "How can i recognize my cursor position using QTP 9.2" Give me a scripts for this

2063


how to evalute defects in QTP script?

1488


What is a reusable action?

576


How many tabs are available to view your test in a test pane and what are they?

562


What is the short cut keys for the following?

646


How to import a test case present in ".xls" file to TD under a Test set?

749


How do client side image and server side image work?

1390


How to start recording using quicktest professional (qtp)?

597