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?
Answers were Sorted based on User's Feedback
Answer / geeta
rowcount=b().p().webtable().rowcount()
for i=2 to rowcount
set obj_lnk=b().P().Webtable().childitem(i,j,"Link",0)
obj_lnk.click
Is This Answer Correct ? | 12 Yes | 1 No |
Answer / naaz
Descriptive programming will solve this problem. You have
to write the property name and you can assign the dynamic
value of that property. The problem with descriptive
programming is, if you are using descriptive programming
for the top level object you have to use the descriptive
programing for the child objects also. But if you are using
it for child objects you dont neet to use for parent
objects.
Example of Descriptive Programming:
JavaWindow("title:="&Value12).Activate
here title is the Object Property. And Value12 is its
value. you can use dataTable also for the value
Example:
JavaWindow("title:="&DataTable
("Value",dtLocalSheet)).Activate
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / akshay soni
for a website
bro=""
url=""
set desco=description.create
desco("micclass").value="link"
with browser("title:=give respctive browser title name")
set lis=page("title:=give respctive browser title name").childobjects(desco)
ls=lis.count
for i=0 to lis-1 step 1
x=lis(i).getroproperty("name")
y=lis(i).getroproperty("url")
print(x&" "&y)
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / 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 |
If we know the name of the name of that link then u guyes
can follow the below code....
In the above code how are you getting the value of j(i.e
column no). We are supposed to check each and every row &
column.
so I would like to add few lines in the above code,
rowcount=B.P.Webtable().rowcount
colCount=B.P.Webtable().columncount(rowcount)
For i=1 to rowcount
For j=1 to columncount
If B.P.Webtable().ChildItemCount(i,j,"link")<>0 then
set oLink=B.P.Webtable().ChildItem(i,j."link",o)
''oLink.(your desired operation)
y=oLink.GetRoProperty("Name")
If trim(y)= trim("Name of that link") then
oLink.Click
End If
Exit for
End If
Next
Next
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / veda
I think with discriptive programing but i don't know how
to use that discriptive programing in this situation.
Is This Answer Correct ? | 1 Yes | 2 No |
How can I replace all the text from the QTP script with some other text. Is there any replace all function in QTP Any one can help me
I am trying to install QTP 9.5 but i am getting error message saying that ("Path is \QuickTest Professional\bin\vb_init.exe") vb_init.exe file is not find. can anybody give me the advise what to do ?
How to integrate the qualitycenter with qtp
What does mean by Scope of Automation?n How we defined it?
how we connect oracle or sql data server database to qtp.
Wht are the BY default Add-ins in QTP 9.2 version and what all are differences between 8.2 and 9.2
.how will you load the object during runtime
How will we compare the texts in the two word files using QTP writing the script in Descriptive Programming. Thanks
when to start the automation?
This is a question thats generally asked in every QTP interview. What were the problems that you faced during automation and how did you resolve them?
Explain the benefits of quick test pro(qtp)?
Can we Run the Tests developed in QTP 8.2 in advanced versions like 9.0, 9.1, 9.2...etc.,