Hi Friends,
I am facing some issues with If,else condition,i.e.
i am working on some web page for ex:gmail page.now if i
want to check if username is incorrect or already exist,i
want to display error message in my test report,for this i
am using a simple code first,i.e.

If Browser("Gmail: Email from Google").Page("Gmail: Email
from Google").WebEdit("Email").Set "Shekhar.g"= true Then
Msgbox ("Username Does not Exist!")
Else
msgbox ("Welcome !")
End If
But still i am getting a syntax error

If Browser("Gmail: Email from Google").Page("Gmail: Email
from Google").WebEdit("Email").Set "shekhar.g"= true Then
Msgbox ("Username Does not Exist!")
Else
msgbox ("Welcome !")
End If

I don't feel any thing wrong in this syntax but i don't
understand why it shows such error,i am confused what went
wrong,please help me out & do the favor,thanks a lot....

Answer Posted / rahul dwivedi

object.set property does not return any value..
you are checking for the set property as true which is not
possible..
instead of that check for the message that is being
notified after creating the gmail account..
if message is that user already exists then show error
otherwise not..

for more info visit http://qtp-beginners.blogspot.com/ and
post comment for this..

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

1) How can we use VB script in testing the application? 2) What all are the things(Software application to be installed in PC) we need to learn VBscript?

3556


why do u choose to go for testing why cant for devoloping

1594


How can you create a file object to work with the files in the vbscript language?

510


Write a test case using Test if the images,a particular test exists,check if the page links match,page response is within a certain range,parameterization of the test,the test should comprise of actions,the test should use a custom function,the test should use global repository

1795


how to comvert 120 into one hunderd twenty rupees only and vice varsa

1805






how to increasing the numbers in a given text box please write a vb script

1705


What is the difference between for loop and while loop?

553


What is the difference between javascript and vbscript?

534


How to write functions and sub in vb script?

625


how does vb script help in web page designing? explain with example.

1586


How to replace junk code recorded by QTP with a mall function.

1646


i have a problem with this error(this error related edit and delete button,when i click this button in datagrid..i will get this error)"Invalid postback or callback argument. Event validation is enabled using in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation." this is my code : <%@ Page Language="VB" Debug="false" %> <%@ import Namespace="Sytem.Data" %> <%@ import Namespace="System.Data.OleDB" %>

(Search Based On Staff I.C No) IC.No (XXXXXX-XX-XXXX)   ' runat="server"> ' runat="server"> ' runat="server"> ' runat="server"> ' runat="server"> ' runat="server"> ' runat="server"> ' runat="server"> ' runat="server"> ' runat="server"> ' runat="server"> ' runat="server"> ' runat="server"> ' runat="server"> ' runat="server"> Total Leave Taken : Days

2348


What are class events?

583


Which object is used to work with the database in the vbscript language and what statement is used to create this object?

510


How will you get the octal value of the given number in vbscript?

499