I connect to database by code and imported data and placed in fields of application and validate some functionalities.... no problem up to here... when QTP tries to import second record from database... it is importing first record again... Can I know my mistake...?
|
Retrieve the Data from Database
|
|
Put your properly formatted code here.
Want to fast track your QTP/UFT Learning? Join our UFT Training Course
Thank You Ankur, Now I am getting... No issues
Code: Option Explicit
Hi bfakruddin ,
I am trying same as you. In this i am getting Login(Agent name) directly from database. But when it comes to Password it says operation can not Performed. See part of code is Code: arr=rs.fields("Login_name")Here Agent Name get inserted from Database. But For Password field it says " Operation can not performed" Can you pls help me.
as part of your code is correct........
check once you get a value from database whether it is retrieved from there or not.... use msgbox pwd it will show whethet value has been retrieved or not... If it is not? I hope no chance because database has been already connected and got a Login_name, check the column name is pwd or something else... "Easy method to connect to any database" --> open new text file and save as "babaDB.udl" one icon will appear at the text file location, double click on that and select your desired database and provide the user name password... navigation would be very simple, you can understand easily... give the info what it asks and close it... Right click on that icon and open with "Note Pad"... copy the available text and keep it in your code at the place of con.open "copied text here" 'use it if you feel difficult to remember all the server,localhost, username, password... etc., ;D
Hi bfakruddin ,
I placed 'msgbox pwd' , and its showing 'mercury'. it means it is getting properly. But i think while inserting it is inserting something else. What i guess is it is inserting ( space ) as extra string.Bcoz Login wondow says, Incorrect password.I also observed the extra element. as for mercury(*******) there should be only 7 asterstiks. But what i observed is (********) i.e eight. Even check that while Agent Name get inserted observe the Position of cursor,it is on the last position of that field. I guess same thing may be happen for Password also. What You say, if it , its real challange! I stll not tried your second method,but first trying the first one. Lets see....will get back you soon if solved.
if that is a case... that is not an issue buddy
use built-in function trim to ignore spaces try this Code: arr=rs.fields("Login_name")
Yes ! now it works. Thanks.
Can you please give me such built in function used in QTP ? Or where i can found so that i can use them whereever necessay.
I have been trying this as for practice and I have found out that DSN=QT_Flight32 (Mercury flight reservation application) does not have any table containing Userid and Password information.
Code: arr=rs.fields("Userid")OR Code: arr=rs.fields("Login_name")(02-16-2009, 12:07 PM)sudhirzpatil Wrote: Yes ! now it works. Thanks. Built In function in QTP can be found under VB Script reference > VB Script > Reference > Functions
Want to fast track your QTP/UFT Learning? Join our UFT Training Course
|
|
« Next Oldest | Next Newest »
|
| Possibly Related Threads… | |||||
| Thread | Author | Replies | Views | Last Post | |
| QTP Automation: How to retrieve Reporter.Reportevent Message | scsenthil | 1 | 5,811 |
11-14-2013, 07:51 PM Last Post: spannerj |
|
| How to retrieve ArrayList saved in Environment Variable | Gautam26 | 8 | 5,793 |
11-07-2013, 08:26 PM Last Post: ssvali |
|
|
|
Retrieve the complete height and width of a browser beyond the visible part as wel | learnQtptips | 0 | 2,368 |
05-22-2013, 09:36 AM Last Post: learnQtptips |
| How to retrieve a value from a table if the application is built in power builder. | deepakmehta82 | 1 | 3,292 |
04-26-2013, 07:58 AM Last Post: shaj |
|
| Issue to use GetVisibleText to retrieve number from a PDF page in QTP11 | jsun01 | 1 | 3,254 |
03-09-2013, 09:39 PM Last Post: jsun01 |
|
Users browsing this thread: 5 Guest(s)

