Ask a Question

Right click an item in a list

MarcusBengtsson
Frequent Contributor

Right click an item in a list

Hi! So when i record a Test and right click a parameter in the selection list it writes out The name of the parameter. The problem with that is if The parameter gets removed. I simply want it to click on item (5) in the list for example. Using keyword test.

Hope you can understand how i mean else i will send pictures.
9 REPLIES 9
Marsha_R
Community Hero

If you mean you want to click item(5) no matter what it is, then use the object name to click it instead of the text.

 

If that's not quite it, yes, please post pictures.  🙂


Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame

Yeah thats what i mean, how do i get to know The object name? If I select The selection list it only takes The whole window. 🙂

Let's see the name mapping for the selection list.  There's usually a way to drill down and see the individual items.


Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame

Pretty new to this how do you see name mapping for it?

Hi again, this is how i see it when i try to select the list item.

Hi again, this is how i see it when i try to select the list item.

ListView20WndClass ClickItem "M_Conc5_HC", ...

Clicks the 0 subitem of the 'M_Conc5_HC' item of the 'ListView20WndClass' list view.

This is how you look at the Name Mapping

https://support.smartbear.com/testcomplete/docs/testing-with/object-identification/name-mapping/abou...


Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
tristaanogre
Esteemed Contributor

ClickItem as a method can take either a string or an integer.  So, if you ALWAYS want to click on the 5th item in the list, you simply do ClickItem(5).  If you always want to click on the same text in the list, regardless of position, you do ClickItem(<item text>).

 

Since you're using Keyword test, it's simply a matter of editing the operation after the recording and going to the parameter and changing the type from "string" to "integer" and entering in the desired value.

 

 


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
cancel
Showing results for 
Search instead for 
Did you mean: