Prepare for your Next Interview
|
Welcome to the Geeks Talk forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
This is a discussion on Database checkpoint within the QTP forums, part of the Software Testing category; Hi friends, I have a scenario, When user is registered his name and e-mail id is saved in database "tempuser" table, now i have to insert a database checkpoint for ...
|
|||||||
|
|||
|
Database checkpoint
Hi friends,
I have a scenario, When user is registered his name and e-mail id is saved in database "tempuser" table, now i have to insert a database checkpoint for checking this new data.But problem is if i add a database checkpoint when editing my script, it shows only static data (which is already in table) and i don't need it all, then what will be it's dynamic query and steps using which i can verify my new data which first inserted into table and then checked in the same script.
__________________
-- Brijesh Jain |
| The Following 4 Users Say Thank You to jainbrijesh For This Useful Post: | ||
| Sponsored Links |
|
|||
|
Re: Database checkpoint
why dont u use a RO property..
I guess this property is more dynamic and reliable... |
| The Following User Says Thank You to animesh.chatterjee For This Useful Post: | ||
|
|||
|
Hi
Use Environment variables or datatable to retreive values for your query.Screen shots for this are attached. Then your job is simple , you just have to change values for your environmental variables/Datatable cells to change the DB checkpoint properties. |
|
|||
|
Dynamically, I think, a query is to be written. I have experience with Rational Robot and with that experience , I can say:
1) With textcheck point, we can capture login name and emailid.(combination of login name and email id is supposed to be unique.i.e two users with same login name and email id can not register twice) 2) Make the query like: select "loginname" from "temptable" where "loginname"="text captured through textcheckpoint" and "password"="password captured through textcheckpoint". 3) If query returns "loginname"="text captured through textcheckpoint", then inserted text to form have been inserted to required table "temptable' else inserted text not found in required table "temptable" I think, this logic should work. Thanks, Debasish Pradhan, Noida Last edited by deba2002; 01-24-2008 at 04:55 AM. |
|
|||
|
Re: Database checkpoint
I know how to use database checkpoint in qtp. Press the Insert button and click on checkpoint now select database checkpoint. It will open a new window in the new window select the radio button for sql query and right the sql query to open a database table like:
select * from table1 before writing this query select your database. U may also do some change in the database. When u run your test it will show the expected and actual result. |
|
|||
|
Re: Database checkpoint
Yes, this should work like this
my main question (I an other post), that How can I implement this solution is QTP???? Because it is very nice to use a parameter in the SQL, and to get the whole data returned by the query, but I don't know, how can I do these 2 things. With script methods I know, that the SQL can be parametrized, but How can I use a parameter with the help of the built in keyword solution of the DbTable output check? |
|
|||
|
Re: Database checkpoint
I dont know if i got the question correctly...
but what i understood is that QTP dynamically capture some data from application...now we need to chk if the data exist in the table or not... without using a check point we can also do that.. val=Browser("Abc").Page("gfg").webedit("gg").getROProperty("value") 'we can use Text datatable.AddSheet("data") x=datatable.GetRowCount for i =1 to x datatable.setcurrentrow(i) if val=datatable("email","global") then msgbox "Validated" flag="true" end if next |
|
|||
|
Re: Database checkpoint
Hi this is Priyank,
To check dynamically updating values into database follow the process. 1) First create DB checkpoints 2) Now select and one value into DB checkpoint window and go to option "Cell Identification", Now select option "By row number" an select "key coloum " as "user_name" 3) Check option "use value match criteria..." 4) Now select tab " expected data" and parameterize value of " user_name" and "password" 5) Check the only one value in" user_name" column 6) now use same data table value to replace 'user_name' in script 7) Run test with setting "show log always", this time u get updated value in result window |
|
|||
|
Re: Database checkpoint
Please find the step by Step process here attched with this
Last edited by animesh.chatterjee; 01-23-2009 at 12:05 PM. |
| The Following User Says Thank You to animesh.chatterjee For This Useful Post: | ||
|
|||
|
Hi All
Iam new to QTP. I am testing a web application which shows orders created inside a grid.I want to know how to compare values from db with the application. I have tried db checkpoint. This will fail if a new row is added or deleted from the applcation. How to take the runtime property and compare? Please help me out |
|
|||
|
Re: Database checkpoint
Quote:
You can use adodb connection strings to check the values from db to the front end. Below is the query which may help. Please let me know if you have any questions. Sconstr = "provider=sqloledb;data source=ip address ;initial catalog=give the database name;user id = give the user id ;password=password;" set db_connection = createobject("adodb.connection") db_connection.open sconstr 'msgbox db_connection.state set db_rs = createobject("adodb.recordset") squery ="select top 1 * from table_name" db_rs.open squery,db_connection,1 reccount = db_rs.recordcount for each col in db_rs.fields cname= col.name datatable.addsheet ("db").addparameter cname,"" next fcount= db_rs.fields.count for each a in db_rs.fields colname = a.name db_rs.movefirst for j=1 to fcount datatable.setcurrentrow(j) rowval = db_rs.fields.item(colname).value datatable.value(colname,"db")=rowval db_rs.movenext if db_rs.eof =true then exit for end if next next datatable.exportsheet "c:\db.xls",3 Best regards, Deepak.Bhandarkar Last edited by qtpdeepak; 08-31-2009 at 07:49 AM. Reason: Formatting |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Database Checkpoint dynamic query | spore | QTP | 5 | 08-06-2009 01:57 AM |
| Checkpoint failed | Lokesh M | QTP | 4 | 06-13-2008 01:48 PM |
| XML Checkpoint and Accessibility Checkpoint | Lokesh M | QTP | 1 | 02-28-2008 06:34 AM |
| Standard Checkpoint | pravinspatil | QTP | 2 | 11-21-2007 03:49 AM |
| Webpage / Frame Checkpoint | Lokesh M | QTP | 4 | 12-11-2006 02:00 PM |