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

.qfl extension for which file? where vl use it

3 Answers   iFlex,


if full in Object Repostoiory then how to load other Object Repository

2 Answers  


How many types of recording modes in qtp? Describe each type with an example where we use them?

0 Answers  


We have an action attached with the library file in QTP. When I will click on run button,which file is going to be executed first a)Action b)Library

1 Answers  


In QTP how can we recognize objects Without using Object Repository?

3 Answers   IBM, Wipro,






What is iteration? How it is related to Test Results in QTP?

2 Answers  


I have a tool for automation testing (eg:qtp).I have two functionality(A & B) to test.A is tested once in a year. B is tested everyday. At present i have the money and resource availability to automate only one functionality.Which one will u suggest and why?

3 Answers   Wipro,


write script for "dropdown button having how many words? for ex.SELECT CITY is dropdown name.. find out how many cities in that?

1 Answers  


What are the different scripting languages you could use when working with QTP ?

6 Answers  


In where you are keeping or maintaining shared object repository (file)in your appliction?

2 Answers   Inlogic,


Hi I am working with QTP.If I want to write a certification exams,Which one is the best one suggest me friends!!

2 Answers  


How many regression test suits in your appliction?

2 Answers   CTS,


Categories