pbellino Absent Member.
Absent Member.
865 views

duplicate textContents

Jump to solution

Running 16.5 Silktest using 4test with the open agent.

I have a window open that may have 0-XXX duplicate entries in a table.

For this issue, let's say I have 3 entries as follows:

Entry 1 is identified as //span[@textContents['foo']

Entry 2 is identified as //span[@textContents['foo'][2]

Entry 3 is identified as //span[@textContents['foo'][3]

Now I have a new window on top of the existing window and inside the new window I have //span[@textContents['foo'][4].

I need to get at //span[@textContents['foo'][4]. Of course, it may not be [4], but it will always be one more than what is in the window behind it.

Is there an easy way to do this?

Thanks,

Phil

0 Likes
1 Solution

Accepted Solutions
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: duplicate textContents

Jump to solution

Hi Phil,

You probably need to customize your locator to include a parent locator part. You state that you have a new window with the span element on top of the existing window. Can you add the locator information of the new window to the locator string of the span element?

For example:

//DIV[@id='parentWindow']//SPAN[@textContents='foo']

I would recommend using the Locator Spy to inspect the control hierarchy to determine a unique parent control and test whether the addition of its locator part allows you recognize the span uniquely.

regards

Robert

0 Likes
1 Reply
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: duplicate textContents

Jump to solution

Hi Phil,

You probably need to customize your locator to include a parent locator part. You state that you have a new window with the span element on top of the existing window. Can you add the locator information of the new window to the locator string of the span element?

For example:

//DIV[@id='parentWindow']//SPAN[@textContents='foo']

I would recommend using the Locator Spy to inspect the control hierarchy to determine a unique parent control and test whether the addition of its locator part allows you recognize the span uniquely.

regards

Robert

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.