-
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.
-
Re: Database checkpoint
why dont u use a RO property..
I guess this property is more dynamic and reliable...
-
2 Attachment(s)
Re: Database checkpoint
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.
-
Re: Database checkpoint
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
-
Re: Database checkpoint
can you tell me how to test database in QTP (hyrachially) im new to testng .
thank you
-
Re: Database checkpoint
Ya i am also new to testing and the database testing some one expalin the framework of the database tesingand the the DB cehckpoint in the QTP
-
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
can you tell me how to test database in QTP im new to testng .
venki
-
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
Please let me know if this is ok?
-
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 [B]"Cell Identification"[/B], Now select option "[B]By row number[/B]" an select "[B]key coloum[/B] " as "[B]user_name[/B]"
3) Check option "[B]use value match criteria...[/B]"
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 "[B]show log always[/B]", this time u get updated value in result window
-
1 Attachment(s)
Re: Database checkpoint
Please find the step by Step process here attched with this
-
Re: Database checkpoint
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=remya_mu;47581]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[/quote]
[b]remya,[/b]
You can use [i][b][color="blue"]adodb connection strings[/color] [/b][/i]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,
[b]Deepak.Bhandarkar[/b]