we have a link in a website or webtable How can we record
link in that table or site? link is not static we don't
know exact location of that link? how ? if u know pls give
reply with script also?

Answer Posted / jyotikrushna mohapatra

I just saw an answer which has mentioned above as:

rowcount=b().p().webtable().rowcount()
for i=2 to rowcount
set obj_lnk=b().P().Webtable().childitem(i,j,"Link",0)
obj_lnk.click

but this isn't 100% appropriate code, the script may fail
why
Ex: here we are trying to click on the link through every
row of the webtable, suppose the 3rd row doesn't contain
any link then "obj_lnk.click
will fail because there is no link present in that row so
the exact and write code will be as :

rowcount=b().p().webtable().rowcount()
for i=2 to rowcount
if b().pa().webtable().childitemcount(i,j,"Link",0)<>0
then
set obj_lnk=b().P().Webtable().childitem(i,j,"Link",0)
obj_lnk.click
end if
end for

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

why text area checkpoints cannot used for web applications

1878


How are cgi programs, applets, javascripts, ActiveX components, etc. to be maintained, tracked, controlled, and tested?

692


what and how to answer for the question "tell me about yourself ?" for 3 years experience. can anyone say inj detail please... its urgent

1330


Can any one tell me about "Mapping Repository Parameter Values" and why we use it....??How to use it???Please, tell the preconditions also...........???? Thanks in Advance

1496


What are the disadvantages of recording test cases in qtp?

591






Hi Friendss..., can any body help me.. 1. Tell me your achievements(Technically)..? 2. Tell me your strengths(Technically) and weakness(Technical)..? 3. Why are you looking for change..?

1413


While spliting an action in QTP 10.0 getting an error : "This Line is a part of Script Block.You cannot split the action on this line." how to re-solve this and split the script into actions?

1415


Explain the features of quick test pro(qtp)?

566


What do you mean by checkpoints in qtp?

554


Can anyone pls tell me in realtime (descriptive programming) how will the properties of the object be given to the test team. R they given in an excel sheet and is the same sheet also given to the development team and by whom is this given? Thanks a lot.

1556


What is environment variable in qtp and why to use it?

541


Diff b/w test scenario's and test Procedures?

1624


What are the advantages of a Hybrid framework?

594


any body plz send health care domain project to me with explanation any two modules on that project. mail_id: ranjith_99reddy@yahoo.co.in

3432


How to associate function library at a run time?

696