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

Whar are the challenges do we face while testing web based applications using the automation tool QTP or any??

1726


I am sathish , i want to test the Application of JIL.org ,Mobile Emulator ,by using QTP10.0. I am trying to do testing on that Application , but Child Objects are not identified by the QTP. Please can any one help me

1524


Print the Prime numbers in below format only up to 20(Need commas also) 1,2,3,5,7,9,11,13,17,19

1298


Hi could some one explan what is the use of the function Defination generator, And how to use the function defination generator.. Explan with the example..

1437


Hi, I am using OutputCheckPoint for 2 webelements Bed:4 and Bath:2 Full,1 partial in my result page and I am storing the value in the data table. I dont need the string Bed:4,I would like to get only the no 4. How can I get it? Even though I highlight only 4,It is seleting the full value "bed 4". Same thing happend for second webelement Bath:2 Full,1 partial I need only the No 2. I used the following to split MyArray = Split(UIBathResult, " ", -1, 1) But it is giving the value My Array(0)=Bath:2full,1Partial I need the only the nos for further comparision.Any help? Thanks Uma

3411






Brief the process of testing with UFT?

722


Hi All, I need code for how to execute qtp scripts from excell sheet

1544


If I change the property value at runtime is it effect is object repository?

710


hi Friends ,willany body tell me what is the Scope for the automation Testing inht Future is their Or not And what is the Top Most Level in the testing section according the Pay scale

1625


how to test Web application using QTP software

1419


Why is Client side image is preferred over server side image?

1543


how to download mercury qtp9.2 ny internet ?

3056


Explain how qtp identifies objects?

662


can any body plz help by sending the qtp docs and qtp ppt's? this is my mail id:murali.padeti@gmail.com

1860


Difference between test object and run time object?

671