Post Reply 
 
Thread Rating:
  • 1 Votes - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Getting error as variable undefined
10-19-2011, 07:16 PM
Post: #1
Getting error as variable undefined

Hi all,

I'm a beginner, I was trying to practice qtp with sample application "Mercury Tours" provided by HP. When I try to automate this application, it is giving following error:
Variable is undefined: 'cint(uf)+cint(df)'

Line (55): "If total=[cint(uf)+cint(df)] *cint(nop)+tax Then".

I have attached the script. Please help me.......... where did i go wrong?

Cheers
Kalyani
Find all posts by this user
Quote this message in a reply
10-19-2011, 09:45 PM
Post: #2
RE: Getting error as variable undefined
Hi ,

It seems you missed out the attachment.
Reattach the script once.

Never limit your challenges , Challenge your limits
Visit this user's website Find all posts by this user
Quote this message in a reply
10-20-2011, 06:23 AM
Post: #3
RE: Getting error as variable undefined
Hi,
Do you have 'Option Explicit' in the top. ?
If yes, plz remove and try.

~vIns~
Find all posts by this user
Quote this message in a reply
10-20-2011, 03:00 PM (This post was last modified: 10-20-2011 03:16 PM by kalyani0820@gmail.com.)
Post: #4
RE: Getting error as variable undefined
(10-19-2011 09:45 PM)sreekanth chilam Wrote:  Hi ,

It seems you missed out the attachment.
Reattach the script once.

I have attached the script..........
(10-20-2011 06:23 AM)vIns Wrote:  Hi,
Do you have 'Option Explicit' in the top. ?
If yes, plz remove and try.

I have deleted option explicit statement, executed it, test executed without errors but test failed. I have attached the screenshot.


Attached File(s)
.txt  1.txt (Size: 2.12 KB / Downloads: 7)
.doc  Doc2.doc (Size: 84 KB / Downloads: 6)
Find all posts by this user
Quote this message in a reply
10-21-2011, 06:24 PM
Post: #5
RE: Getting error as variable undefined
(10-20-2011 03:00 PM)kalyani0820@gmail.com Wrote:  
(10-19-2011 09:45 PM)sreekanth chilam Wrote:  Hi ,

It seems you missed out the attachment.
Reattach the script once.

I have attached the script..........
(10-20-2011 06:23 AM)vIns Wrote:  Hi,
Do you have 'Option Explicit' in the top. ?
If yes, plz remove and try.

I have deleted option explicit statement, executed it, test executed without errors but test failed. I have attached the screenshot.

Please any suggestions would be appreciated

Cheers
Kalyani
Find all posts by this user
Quote this message in a reply
10-21-2011, 06:34 PM (This post was last modified: 10-21-2011 06:35 PM by guin.anirban.)
Post: #6
RE: Getting error as variable undefined
1st check whether 'GetCellData' method is returning numeric value.
Also check whether QTP supports third bracket, hopefully not.
Find all posts by this user
Quote this message in a reply
10-31-2011, 06:24 PM
Post: #7
RE: Getting error as variable undefined
Replace this line in your code:
If total=(((cint(uf)+cint(df)) *cint(nop))+tax) Then

Check if you get the error anymore.

(10-20-2011 03:00 PM)kalyani0820@gmail.com Wrote:  
(10-19-2011 09:45 PM)sreekanth chilam Wrote:  Hi ,

It seems you missed out the attachment.
Reattach the script once.

I have attached the script..........
(10-20-2011 06:23 AM)vIns Wrote:  Hi,
Do you have 'Option Explicit' in the top. ?
If yes, plz remove and try.

I have deleted option explicit statement, executed it, test executed without errors but test failed. I have attached the screenshot.
Find all posts by this user
Quote this message in a reply
11-03-2011, 07:25 AM
Post: #8
RE: Getting error as variable undefined
(10-31-2011 06:24 PM)soumen Wrote:  Replace this line in your code:
If total=(((cint(uf)+cint(df)) *cint(nop))+tax) Then

Check if you get the error anymore.

(10-20-2011 03:00 PM)kalyani0820@gmail.com Wrote:  
(10-19-2011 09:45 PM)sreekanth chilam Wrote:  Hi ,

It seems you missed out the attachment.
Reattach the script once.

I have attached the script..........
(10-20-2011 06:23 AM)vIns Wrote:  Hi,
Do you have 'Option Explicit' in the top. ?
If yes, plz remove and try.

I have deleted option explicit statement, executed it, test executed without errors but test failed. I have attached the screenshot.

i had to change that statement, i had to split that statement as shown:

a=cint(uf)+cint(df)

b=a*cint(nop)

If total=cint(b)+tax then


Reporter.ReportEvent micPass,"calculation testing","correct calculation"

else
Reporter.ReportEvent micfail,"calculation testing","wrong total"

End If

Is this the only way in qtp??
Please help?

Thanks
kalyani
Find all posts by this user
Quote this message in a reply
11-04-2011, 12:13 PM
Post: #9
RE: Getting error as variable undefined
[quote='soumen' pid='18579' dateline='1320065654']
Replace this line in your code:
If total=(((cint(uf)+cint(df)) *cint(nop))+tax) Then

Check if you get the error anymore.

Thank u soumen, it worked without any errors. Smile
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)