can u write one user defined function for webedit class.

Answers were Sorted based on User's Feedback



can u write one user defined function for webedit class...

Answer / murali raju

Public function edit(name)
Browser("yahoo").Page("yahoo").Webedit("User Id").set name
End function

Call edit("Murali Raju")

Is This Answer Correct ?    12 Yes 6 No

can u write one user defined function for webedit class...

Answer / adlajaipal

'@generic function for Webedit
'@ arguments to pass values
Function WebEdit(sValue,sItem)
set Edit=description.create()
Edit("micclass").value="webedit"
set
basepage=Browser("micclass:=Browser").page("micclass:=Page").childobjects(Edit)
sCount=basepage.count
for i=1 to sCount
Edit=basepage(i).getroproperty("name")
if sValue=Edit then
basepage(i).set sItem
exit for
end if
next
end function
'@ call
WebEdit "Editbox name", "value of edit box"

Is This Answer Correct ?    5 Yes 3 No

can u write one user defined function for webedit class...

Answer / sunitha

Gneric Function for WebEdit
Values strBrow,strPAge come from object repository
Value strEditboxName is the one which we get on spying the
object and getting its property name.
Value strVal is the one which we want to set in Edit box

function fg_SetValueinEditbox
(strBrow,strPage,strEditboxName,strVal)
set oD = Description.create
oD("micclass").value = "WebEdit"
set strEbox = Browser(strBrow).Page(strPage).Chilobjects(oD)
For iCnt=0 to strEbox.count-1
strName = strEbox(iCnt).GetROProperty("name")
If strcomp(strName,strEditboxName,1) = 0 Then
strEbox(iCnt).set strVal
Exit for
End if
Next
End Function

Is This Answer Correct ?    3 Yes 4 No

can u write one user defined function for webedit class...

Answer / 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

can u write one user defined function for webedit class...

Answer / kiran

'Bname -- Browser name
' Pname- Pagename
' EditName---Editboc name
'Edittag--html tag name
'indx-Index of object
'InputVal---inputvalue
Public Sub SetWebEdit
(Bname,Pname,EditName,Edittag,index,InputVal)
If Browser("name:="&Bname).Page("title:="&Pname").WebEdit
("name:="&EditName,"html
tag:="&Edittag,"index:="&indx).exist
Browser("name:="&Bname).Page("title:="&Pname").WebEdit
("name:="&EditName,"html tag:="&Edittag,"index:="&indx).set
InputVal
Reporter.ReportEvent micpass,"The Object is exist and set
value suuccesfully","Pass"
Esle
Reporter.ReportEvent micFail,:the object is not existing
and filled","Fail"
End If
End Sub

Is This Answer Correct ?    0 Yes 3 No

can u write one user defined function for webedit class...

Answer / krishna madiga

i think a lot of time about this question .but i did 'nt
get sorry....

Is This Answer Correct ?    1 Yes 7 No

Post New Answer

More QTP Interview Questions

how can i call function (which has link with excell sheet at a remote location) within another function

0 Answers  


What is the use of "Define new test object" in QTP 9.1 When should we use? Explain?

4 Answers  


How to find RAM size by using QTP?

2 Answers   IBM,


difference between multiple parameterization and data driven wizard in QTP?

1 Answers  


Who is the best faculty for QTP in Hyderabad? Is it Mr. G.C.Reddy, some are referring his name?

21 Answers  






how to add run-time parameter to a datasheet?

1 Answers   Mphasis, Ordain Solutions,


how to create the varibles and how these are connect to qtp? plz tell me

3 Answers  


i am trying to automate yatra.com,in that site, when i go to automate the Leaving from field showing as a WEBEDIT, but when i enter 1 or 2 char, it displaying dropdownlist, i try to use keyboard automation to select the item from that list but it is not possible, can anybody help he. Thans for posting the Answer

0 Answers   TCS,


How to use the Object spy in QTP 8.0 version?

2 Answers  


the presentation layer of my application is built using VB 6.0 and a series of C++ dlls and components. We do not use Java, VB.Net, C## or any other component that can be decompiled. We are automating the application using HP Quick Test Professional. It is not reconginizing the combo boxes, tabs etc.... Could you please suggest, whether QTP supports C++ dlls and components or not...if yes, could you please guide me, how to overcome this situation. Can we install any special add-ins for this C++? .When we are performing the recording/execution, the application becomes very slow. Your quick response will be highly solicited in this regard.

1 Answers   Wipro,


What is difference between WR and QTP?

2 Answers  


Write a script to verify font style and color of a windows object using descriptive programming

0 Answers  


Categories