if there is two login button in your page, how you know that
this login button is correct for login .

Answers were Sorted based on User's Feedback



if there is two login button in your page, how you know that this login button is correct for logi..

Answer / nagesh

If there are two login buttons,then go with index value
using descriptive programming.first we should make sure that
which login button navigate to required page.then give
corresponding index value as property in script as follows.

Broser("BR").page("PG").webbutton("index:=2").click

or

set objbutton=Description.Create()
objbutton("micclass").value="Webbutton"
objbutton("index").value="2"

browser(br).page(pg).webbutton(objbutton).click

Is This Answer Correct ?    2 Yes 1 No

if there is two login button in your page, how you know that this login button is correct for logi..

Answer / rangalnrt

But before going operate the button check whether that button is enabled or disabled


set objbutton=Description.Create
objbutton("micclass").value="Webbutton"
objbutton("name").value="login"

set childs = B().P().childobjects(objbutton)

for i=0 to childs.count-1 step 1

if Broser("BR").page("PG").webbutton("index:="&i).getroproperty("Enabled") then
Broser("BR").page("PG").webbutton("index:="&i).Click
end if

Next

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More QTP Interview Questions

What are associated files in QTP?

2 Answers  


How to use setroproperty?

0 Answers  


To count the no of links present in the yahoo home page i have written the script like this Set fileSysObject=createobject("Scripting.FileSystemObject") Set linksFileName=fileSysObject.opentextfile ("D:\samplelinkfile.txt",2,true) Set linkDescObj=description.Create linkDescObj("micclass").value="Link" Set noOfLinks=browser("yahoo").Page("Yahoo! India").ChildObjects(linkDescObj) For i=0 to noOfLinks.count-1 linkName=noOfLinks(i).getROProperty("name") linksFileName.writeline(linkName) Next linksFileName.close Set fileSysObject=nothing While running the script it showing error that object "yahoo"isnot found in the object repository. Is there any setting before running the script? if yes what is the steps for it.Im using QTP9.0

2 Answers  


How QTP recognizes Objects in AUT?

1 Answers   Crea,


How extensive or customized are the server logging and reporting requirements; are they considered an integral part of the system and do they require testing?

0 Answers  


What is data driver in qtp? Where we use it?

0 Answers  


we have one text box and one list box(list box appear in same page or another page) what ever the text enter in text box that must be displyed in list box as first one. for example if we enter 10 in text box that is the 1st item in list box . after that we enter 11 then 11 is the 1st item and 10 is 2nd item. the maximum limit of list box is 10 items. if we enter 11th item the 10th item is deleted and llth one is add as 1st one and 9th one goes to 10th position part2:maore than the answer for this question i want the the reason why testers go for this kind of risk.what is the use of we testers having these kind of attempts.is that not the problem with the developer .pls answer .real time users of tools.in which way these solutions help to test with r without affecting the developed souce code.

3 Answers  


what difference between runtime object and text object and what property they have. whether they have same properties or different properties.

0 Answers   Intel, Satyam,


What is the use of an object spy tool in qtp?

0 Answers  


In project module it contains 3-ok buttons with same properties who qtp identify its objects while runing ??

5 Answers   HCL,


1>How to get the browser name by writing the VBScript. 2>How did you used the GetROProperty and GetTOproperty .give real time scenario. 2>Give and real time ex for the bug having "High Severity and low priority"on banking doamin web based application.

2 Answers   Nous,


i can done the project with QTP in that time i can say how many members in my team size?

0 Answers  


Categories