Exforsys

Free Training

If then else in QTP

This is a discussion on If then else in QTP within the Testing Tutorials forums, part of the Articles and Tutorials category; I was learning parameterization with QTP and encountered problem when i ran my script. The exact scenario is ..I tried ...

Go Back   Exforsys > Articles and Tutorials > Testing Tutorials

Exforsys.com


Testing Tutorials Testing Tutorials and Articles Discussions

Reply

 

LinkBack Thread Tools Search this Thread
  #1 (permalink)  
Old 06-11-2007, 02:44 AM
Junior Member
 
Join Date: Apr 2007
Posts: 0
vs_naveen9 is on a distinguished road
If then else in QTP

I was learning parameterization with QTP and encountered problem when i ran my script.

The exact scenario is ..I tried to login with different usernames n third one was an incorrect name. I wrote an If condition to run my script smoothly.
the script looks like this

The first few lines were recorder scripts which would enter user name and password.

Then i wrote the condition

if
Dialog("name:= Flight Reservations").Exist Then
Dialog("name:= Flight reservations").Winbutton("name:=OK").click
Dialog("name:=Login").Winbutton("name:=Close").Click
Else
Window("flight Reservation").Close
End If
End With

This was to close window which popped up as a result of the incorrect username with less than 4 char.

Error was thrown while running the script in the third iteration which would check the THEN condition.

Could anyone please sort this out for me to find out where the exact problem is?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB 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 03:09 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0
Copyright 2004 - 2009 Exforsys Inc. All rights reserved.