Micro Focus QTP (UFT) Forums
Enter the login details - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Enter the login details (/Thread-Enter-the-login-details)

Pages: 1 2 3


Enter the login details - Unleash Rajesh - 06-24-2011

Hi..

How to enter login details using descriptive programming?

Login page contains E-mail and Password with Login button...

I used 2kinds of code..Both throws an error

One,
Code:
Dim webobj
set webobj = Description.Create()
webobj("Name").Value = "E-Mail"
webobj("Index").Value = "3"
Browser("SAMPLE").Page("Login").WebEdit(webobj).Set "a@a.a"
and another

Code:
Browser("Title:= SAMPLE").Page("Title:= Login").WebEdit("Name:= E-Mail", "Index:=3").Set "a@a.a"

Plz help me out....


RE: Enter the login details - deepaksporty - 06-25-2011

What kind of error you're getting...are you getting object not found ? well if that's the case then you should put in more values in your description for QTP to uniquely identify the object


RE: Enter the login details - souvikghosh_diatm - 06-27-2011

Your question is not clear...say smthing abt d error wat u r getting.


RE: Enter the login details - Unleash Rajesh - 06-29-2011

Hi..

Have to keep my cursor in login tetxbox and hv to enter the details using descriptive programming..
The code mentioned in the previous post doesn't works...Is throws an error of "Object not found in Object Repository"


Hi,

Have to click the login field and enter the text using descriptive programming..

Used the codes mentioned in the previous post..It throws the error stating
"Cannot find the "[ WebEdit ]" object's parent "[ Page ]" (class Page). Verify that parent properties match an object currently displayed in your application."



RE: Enter the login details - souvikghosh_diatm - 06-30-2011

Well i did not understand why u r trying to keep object properties in Object Repositories where u r proceeding with Descriptive Programming...And your mentioned error generally found when the mentioned property is not identified by QTP in that page or that property is not sufficient to identify that object uniqulely..

In this case first find out the unique properties of ur textbox by spying on it...it may be 2 or 3 or more properties needed to identify that textbox uniquly...

Next thing--Clear out your Object repository coz it is not needed at all in Descriptive Programming....

Then Write--

Code:
Browser("property and value").Page("property and value").WebEdit("property and value").Set "value"


Make sure all the value and property should be unique to identify Browser, page and that particular WebEdit....Find out these properties by Spying on those objects....



Hope i am clear to u...let me know if any other information needed...Just drop me a mail on--- souvikghosh.diatm@gmail.com.....


RE: Enter the login details - Unleash Rajesh - 07-01-2011

Thank You..Now its working fine ...

How can i make a click on the button using descriptive programming..?

This code throws an error

Code:
Browser("Title:= G").Page("Title:= G").WebButton("name:= btnLogin")

Get me out from this...


RE: Enter the login details - souvikghosh_diatm - 07-02-2011

well i can give u a shortcut way....i do not know what type of application u r automating...means that application made of which language...sometimes it happent QTP need addint to identify all objects of some particular languages..example as GWT or smart GWT....so r your application made by a stable language which is purely identyfy by QTP????make it sure first...



watever..the shortcut is as follows....

1. open a new test in QTP
2. make sure Object Repository is absolutely clear..
3. manually enter User Id and Password..
4. turn the record on in QTP..
5. now just record the Login Button press..and Stop Record.
6.Go to object repository and find what exact properties and values has been identify by QTP to recognize that button...
7. It may be 1/2/3 watever the properties are...Just use them in your DP..and try...It will work fine....



Try It.........


RE: Enter the login details - rajpes - 07-04-2011

Code:
Why shouldn't it? u have just specified object with no operation
Browser("Title:= G").Page("Title:= G").WebButton("name:= btnLogin").Click

by the way make sure your browser and page's title are exactly "G", if it is first letter of some string title, use G.*


RE: Enter the login details - nistalaramesh - 07-06-2011

You can try this as it is common

Code:
Browser("Title:= .*").Page("Title:= .*").WebEdit("Name:= E-Mail", "Index:=3").Set "a@a.a"



RE: Enter the login details - Unleash Rajesh - 07-09-2011


Hi,

Thanks..But the code is not working..suggest me some more ideas...