Exforsys

Online Training

Error in QTP

This is a discussion on Error in QTP within the Software Testing forums, part of the Testing category; Hi. I am having some problems with the following code. _________________________________________________ Dim Count Dim BankCount BankCount = Int (DataTable.Value("...


Go Back   Exforsys > Testing > Software Testing

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-02-2008, 05:41 PM
Junior Member
 
Join Date: Dec 2007
Posts: 2
abuzzi is on a distinguished road
Talking Error in QTP

Hi.

I am having some problems with the following code.
_________________________________________________
Dim Count
Dim BankCount

BankCount = Int (DataTable.Value("A", dtGlobalSheet))

Count = 0

Do until Count = BankCount

Count = Count +1
msgbox Count
msgbox BankCount

wait 1

Loop
_________________________________________________

The script runs successfully, however when the scripts Count = Bankcount, the execution cycle is looping back to the beginning of the script, and produces the following error.

Error:
Type mismatch: '[string: ""]'

Details:
Line (4): "BankCount = Int (DataTable.Value("A", dtGlobalSheet))".


Could someone please tell me:

1 - Why the script loops back to the beginning once Count = BankCount
2 - Why an error is being returned on the above line of code only on the second pass / why no error is returned on the above line of code on the first pass .. ??

Looking forward to seeing your thoughts / suggestions / script alteration recommendations ...
thanks - and happy new year
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 07-04-2008, 02:16 PM
Junior Member
 
Join Date: Apr 2008
Posts: 8
sukanya_QTP is on a distinguished road
Quote:
Originally Posted by abuzzi View Post
Hi.

I am having some problems with the following code.
_________________________________________________
Dim Count
Dim BankCount

BankCount = Int (DataTable.Value("A", dtGlobalSheet))

Count = 0

Do until Count = BankCount

Count = Count +1
msgbox Count
msgbox BankCount

wait 1

Loop
_________________________________________________

The script runs successfully, however when the scripts Count = Bankcount, the execution cycle is looping back to the beginning of the script, and produces the following error.

Error:
Type mismatch: '[string: ""]'

Details:
Line (4): "BankCount = Int (DataTable.Value("A", dtGlobalSheet))".


Could someone please tell me:

1 - Why the script loops back to the beginning once Count = BankCount
2 - Why an error is being returned on the above line of code only on the second pass / why no error is returned on the above line of code on the first pass .. ??

Looking forward to seeing your thoughts / suggestions / script alteration recommendations ...
thanks - and happy new year
do wat? u have to give some statements or funtion to do before until statement
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 07-07-2008, 07:10 AM
Junior Member
 
Join Date: Jul 2008
Posts: 9
Noorjahan is on a distinguished road
Hi Abuzzi,

You have given the Msgbox right within the loop.. What is the value getting displayed that time??

Is it coming correctly?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 07-24-2008, 03:26 AM
Junior Member
 
Join Date: Aug 2007
Posts: 3
kavita_murala is on a distinguished road
Hi,
U plz try with this code as it can take u for infinite loop

BankCount = DataTable.Value("A", dtGlobalSheet)

regards,
Kavita
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new questions
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 08:39 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2004 - 2007 Exforsys Inc. All rights reserved.