Micro Focus QTP (UFT) Forums

Full Version: how to click one '+' out of many '+'
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi ,

I am testing a web application. Once I get to home page, I see a menu with a list of + sign. I need to click a plus sign. Next to each plus(+) sign, there is a label. Example,
+ abc
+ cde
+ efg.

I simply want to click the plus next to efg. How can I do that? If I do the normal recording, it does not work. It clicks different plus sign different time.

Thanks a lot.
using QTP 9.2/JAVA APP.
Safi
Hi..

U can use "Index" Property to Click perticular "+".

you can use Index property through Descriptive programming..

u can Record whole script.. but the statement when u click "+"..
use Descriptive programming for that perticular Statement..

Thankx
Hi,

You have mentioned 3 pluses in the example and want to click the 3rd one(If I got you right).

One question here, is the number of pluses always 3 or it changes everytime?

If it is always 3, then go by index property(Possibly index:=2 will do)

If it is not, then again one question, do you want to click the plus sign beside "efg" every time or you wanna click the last one? If the "efg" one always then again, go by index property.

Else if the last one and the number of buttons changes everytime, try the code below,

Code:
Set wButton = Description.Create
wButton("micclass").Value = "WebButton"
wButton("name").Value = "+" //Please check name is "+" or anything else
Set allWButtons = Browser("BrowserName").Page("PageName").ChildObjects(wButton)
getButtonCount = allWButtons.Count //It will get you the total number of "+" buttons in you app
allWButtons(getButtonCount - 1).Click //It will click on the last "+" button

Hope this will solve your purpose.
Thanks.
Its not working.

on the web application, it shows as followsSadFI=FOLDER ICON)
- FI Topics
+ FI business areas
+ FI FACTS
+ FI INVENTORY
....

I have 7 + signs total. I need to click different + signs different time depending on what I need. Current script need to click on + next to FACTS.

I used object spy and found out that all + and the - sign and the FI, all have the class type -Image.

I used the below code and i get error :
Code:
Browser("micclasss:=Browser").Page("micclass:=Page").Image("micclass:=Image", "Index:=2").Click

It does not click any + signs.

Thanks.
Can you try using Virtual object and see?
Using object spy are you able to see a webtable? If yes, let me know we have implemented a similar solution for Hyperion application some time back.