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....



Hi Friends, I am facing some issues with If,else condition,i.e. i am working on some web ..

Answer / 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

More VB Script Interview Questions

Out of the different type of operators, which are evaluated first and last in the vbscript language?

0 Answers  


hi what is called GUI in QTP 8.2 and how can we test the apllication using GUI?

0 Answers  


accept a string & display whether a is present or not

1 Answers  


Does VB/Win make standalone .EXE files?

0 Answers  


A folder is there inside no of textfiles are avilable. How do count the textfiles. Normally folder means we are using subfolder methods but textfiles is not working for subfolder methods and how do get file name also.

0 Answers  






generic function for webedit box for web application

1 Answers  


I am working on QTP, got struck in one place.. In my application depending upon configuration WebEdit count is increasing/ decreasing.. how to get these webedits..

0 Answers  


How will you reverse a string in vbscript?

0 Answers  


What are class variables?

0 Answers  


I am running a windows based application.While running the script on QTP ,The Application pop-up an Error Message as "object Disabled" in two different scenarios Scenario 1-->The Application pop-up up a Message for Max Session Reached(as the application is set to hold 2 session and if if crosses the pre-defined limit then the error message pop-up) Scenario 2-->When Network connectivity is disabled the Application screen gets greyed out in colour with no operation possible. Now through Exception handling features in QTP ,we need to do the following For Scenarion 1-->Through Exception handling we need to just accept the Message pop-up in the Application and and resume with the call function as is for Scenario 2--> Through Exception Handling featutes on QTP we need to shut down the client , restart the client and resume the call functions as it is Note: The Application returns an Error Message as "object disabled" in both the cases i.e for pop-up message and when the Apllication getting greyed out due to Network failure how can we enhance the script in such a way that for the same error message retured by the application in two different and how to handle them????

2 Answers   Sasken,


Is vbscript language a case-sensitive language and what does it mean?

0 Answers  


Hi I am having one folder with set of text files now i want to read and write that text files data into QTP. Any help plsss.

1 Answers  


Categories