Exforsys

Online 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

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-11-2007, 01: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
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 02:42 AM.


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.