Dynamic Selectors

Hi guys,
I have this selector.

<wnd cls='NotesSubprog' idx='4' />
<wnd cls='NotesRichText' />
<wnd cls='IRIS.tedit' idx='5' />

However, the number 4 in idx='4' is dynamic.
How do I change this?

I tried using idx='*' but does not work.

1 Like

Hey @mingerz

In order to uniquely identify a node, we might have to add an idx attribute.

Suppose we have three windows with the following titles: Report , Status and Status . We can reach the third window with: “”.

so if you will remove this the selectors will select the topmost windows with same title or program.

for example if you have 2 notepad windows are open (even with same title) and you will use a selector like this to type into the :

<wnd app='notepad.exe' cls='Notepad' idx='2' /> // this will select the first window opened before the last one.
<wnd cls='Edit' />
<ctrl role='editable text' />

and

<wnd app='notepad.exe' cls='Notepad' idx='1' /> // This will select the last opened notepad window even if you will not
<wnd cls='Edit' />                                                  //  mention the idx attrib it will take the latest one or topmost window in a
<ctrl role='editable text' />                                     // windows stack.

Regards…!!
Aksh

2 Likes

Hi Aksh,
But what if I only have 1 notepad window open. Do I still need idx='1'. I tried removing it but it didnt work eventhough I only have 1 window open.

The main issue is everytime I open my application, Lotus Email, the idx may change. I dont want to do that all the time.

it will take the topmost window like only one which is exists.

On same notepad for me it works Pal :slight_smile:

and regarding lotus email i have not tried it but you can remove idx so it will always take the one opened window.

Regards…!!
Aksh

Hi @mingerz

  1. Is there any way we could have access to that app?
  2. Is there any fixed element (a label) that can be reliable identified near our textbox? …so that we can use anchor or FindRelativeElement.
  3. Is it possible to paste a screenshot?

Hi Badita,
I am using Lotus Notes email from IBM.
No worries. I think i managed to get it working. Its company email so unable to share screenshot. But earlier answers did help me.

Thanks agian.

Could you please share how you managed to make it work?

Screenshot%20(4) I’ve a screen like this , the values on the screen keeps changing. I’ve used get full text for it, but help me on the selectors. The * is not working. Using live element I got this < webctrl parentid=‘dashboard’ idx=‘293’ />. Is it right to use idx?

PS: Ignore the error in the alert box

Don’t use idx in your selector

1 Like

Hi, can you give the reason for the same?

Because idx is for index, not for id.
Sometimes, if an new UI Element appears in the windows, can return other element.

Greetings.