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

write a vb script to find the size of d drive?

3 Answers  


Can any 1 modify the code whr in want to add\rename a excel sheet in qtp?

1 Answers  


what types of bugs will we find out in banking projects for automation testing?

0 Answers   Napier Healthcare, TCS,


Mention what is the technology used by vb script?

0 Answers  


What are the environments supported by vbscript language?

0 Answers  






In what way program "hello world" you can write in vbscript?

0 Answers  


What are the disadvantages of vbscript?

0 Answers  


if there is any string in a given format like as "company name employeecode date" then we have to fetch employeecode form string for ex-string is "capgemini12345june2013" then we have to fetch 12345 by using vb script so guys how can we do that please reply it.

3 Answers   Cap Gemini,


write a vbscrpit to swap values

2 Answers   Adani,


What purpose does ‘on error resume next’ serves?

0 Answers  


am giving to one number u can set into that in date format.u can use any methods

1 Answers   HP,


print the array values in ascending order?

2 Answers   CSS Corp,


Categories