Академический Документы
Профессиональный Документы
Культура Документы
ans)
(or)
set odesc = description.create()odesc("micclass").value =
"webcheckbox"odesc("classname").value = "compareme"set ocbs =
browser().page().childobjects(odesc)
first you store the excel file in the 'attachements' tab of you automation folder
in qc (this i believe you already have stored in the qc folder
'[qc]subject\ins\regression testing (rt)' )now in qtp, from main menu, select
'tools->options'. in the options dialog box, go to 'folders' tab and add the above
qc folder where you stored the excel file in the folders tab.when a qtp script,
stored in qc, is executed on a machine, the files stored as attachments in the qc
folder, get downloaded in the local machine. the local path of this copy of the
file can be retrieved using pathfinder.locate statement: so you can use something
like below to get the path of your excel filestrdataexcelfile =
pathfinder.locate("currentpassword.xls")then use this variable
'strmyexcelfilepath' in the getexceldata function for the file name parameter like
below:environment("password") = trim((getexceldata (rowno,colnumber,sheetnumber,
strdataexcelfile )))
yes there is a way to get the nubmer of columns in a table..but before that what
type of application are you using?web or anything else?if it is web then use
thiscolcount=browser("xyz").page("abc").webtable("efg").getroproperty("cols")print
colcount
do one thing .always use wrong values for ur text boxes now after clicking on ok
it is expected that some validation pop-up message will be displayed . so after
the loc that enters the data into your text boxes when you click on submit write
another loc that clicks on ok of that validation message and now reenter the
correct values and proceed futher.b.p.webedit(user name).set
"&^$%^$%^"b.p.webedit(password).set "$%^$^$%^$^"//parametrize these steps with
incorrect combinations always to check t he
errorsb.p.webbutton.clickb.dialog().winbutton.clickb.p.webedit(user name).set
"correct user name"b.p.webedit(password).set "correct password"b.p.webbutton.click