I trying to build a framework. I created function for Web Button, Edit
Field, Link in the Function library and this Function library I have
then connected to a Test. Whenever I try to run the program I get the
following error
The test run cannot continue due to an unrecoverable error.
Wrong number of arguments or invalid property assignment: 'myob'
Function file: C:\Documents and Settings\kchiplunkar\My Documents
\Fun_lib.qfl
Line (1): "Function Brow_open (ebrowser, eURL)".
Please let me know how to resolve this error
My Functions library and Test contains is as follows
Function Library
Function Brow_open(ebrowser, eURL)
systemutil.Run ebrowser, eURL
End Function
Function Brow_Close ()
Browser("title:=.*").Close
End Function
Function Ed_Bo (Edit_name, text_variable)
Set myp= Browser("title:=.*").Page("title:=.*")
Set myob= description.Create()
myob("html tag").value= "INPUT"
myob("name").value= Edit_name
myp.WebEdit(myob).Set text_variable
End Function
Function Wb_But (But_name)
Set myp = Browser ("title:=.*").Page ("title:=.*")
myob = description.Create()
myob("type").value ="submit"
myob("name")= But_name
myp.WebButton(myob).Click
End Function
Function We_li (name_link)
Set myp =Browser ("title:= .*").Page( "title:= .*")
myob = description.Create()
myob("name").value = name_link
myob("html tag").value = "A"
myp.Link(myob).Click
End Function
Test
Dim vbrowser, vurl, vemail, vpass
vbrowser = "iexplore.exe"
vurl = "gmail.com"
vemail = "fieldchoi...@gmail.com"
vpass = "client123"
'Brow_open vbrowser, vurl
'Ed_Bo "Email", vemail
'Ed_Bo "Passwd", vpass
Dim xlpath, row_tc, row_ts, row_td, TCid, kyword
xlpath = "C:\Program Files\HP\QuickTest Professional\Tests
\Test1\Methods\KeyDrivenFramework.xls"
datatable.AddSheet "TC"
datatable.AddSheet "TS"
datatable.AddSheet "TD"
datatable.ImportSheet xlpath, "TestCase", "TC"
datatable.ImportSheet xlpath, "TestSheet", "TS"
datatable.ImportSheet xlpath, "TestData", "TD"
row_tc = datatable.GetSheet ("TC").GetRowCount()
print "TestCase Row Count" & row_tc
row_ts = datatable.GetSheet ("TS").GetRowCount()
print "TestSheetRow Count" & row_ts
row_td = datatable.GetSheet ("TD").GetRowCount()
print "TestData Row Count" & row_td
For i=1 to row_tc
datatable.GetSheet("TC").SetCurrentRow(i)
If datatable.value("Execute", "TC")= "Y"Then
TCid =datatable. value ("TCId", "TC")
print "Test Case ID Is Flagged Y= " & TCid
For j=1 to row_ts
datatable.GetSheet("TS").SetCurrentRow(j)
If datatable.Value( "TCId", "TC")=datatable.Value("TCId","TS")Then
kyword = datatable.Value("Keyword","TS")
print "Keyword is " & kyword
keyword_call kyword
End If
Next
End If
Next
Function keyword_call (fkyword)
Select Case fkyword
Case"Brow_open"
Brow_open vbrowser, vurl
Case "Ed_Bo1"
Ed_bo "Email",vemail
Case "Ed_Bo2"
Ed_Bo "Passwd", vpass
Case "Wb_But"
Wb_But "Sign in"
Case "We_li1"
We_li vemail
Case "We_li2"
We_li "Sign out"
Case Else
msgbox "Keyword Funtion Not available"
End Select
End Function
wait 20
On Nov 21, 9:54 pm, Ketki Chiplunkar <ketki.c...@gmail.com> wrote:
> Hi Malini and Reshma,
>
> I am still not able to resolve this issue. I really am not getting where am
> I mistaking.I have checked the properties, changed the name of the object
> still getting the same error
>
> On Mon, Nov 21, 2011 at 11:48 PM, Reshma Sumanth <reshmasuma...@gmail.com>wrote:
>
>
>
>
>
> > Hi Ketki
>
> > Try out myobj(*html_tag*).value = "INPUT"
>
> > See if the property matches exactly as per the AUT.You have given html
> > tag...maybe it does not recognise that property for myobj.
>
> > Let me know if you have resolved it and how?
>
> > Thanks
> > Reshma
>
> > On Mon, Nov 21, 2011 at 6:03 AM, Malini Binu <malini.b...@gmail.com>wrote:
>
> >> Hello Ketki,
>
> >> I believe the error is when you are calling the function.Since ur
> >> function is not returning any value no need of paranthesis,you need to
> >> mention
>
> >> *Brow_open ebrowser, eURL* in line 1 of ur main script
>
> >> Try this and let me know if you still have a problem.
>
> >> Thanks,
> >> Malini
>
> >>> vemail = "fieldchoice.cli...@gmail.com"
> Ketki- Hide quoted text -
>
> - Show quoted text -
Giving an idea to dig out on which step you got the problem:
Since you are using the same "myob" in all functions that you have
created it might be tough to find where exactly the problem is. Why
don't you replace "myob"
with some unqiue object name such as "myob1","myob2" etc., and check
in which function the problem is occurring?
Vanitha.
On Nov 21, 9:03 am, Malini Binu <malini.b...@gmail.com> wrote:
> Hello Ketki,
>
> I believe the error is when you are calling the function.Since ur function
> is not returning any value no need of paranthesis,you need to mention
>
> *Brow_open ebrowser, eURL* in line 1 of ur main script
>
> Try this and let me know if you still have a problem.
>
> Thanks,
> Malini
>
> > vemail = "fieldchoice.cli...@gmail.com"
> > wait 20- Hide quoted text -
Giving an idea to dig out on which step you got the problem:
Since you are using the same "myob" in all functions that you have
created it might be tough to find where exactly the problem is. Why
don't you replace "myob"
with some unqiue object name such as "myob1","myob2" etc., and check
in which function the problem is occurring?
Vanitha.
> vemail = "fieldchoice.cli...@gmail.com"