How to specify not unique object in html? there is no iframe in code

Hello,
Please help with the not unique test objects definition.
I need to click a star next to a specified record.
Records are unique.
How to specify the record? there is no iframe.

Thank you in advance for your help!

< div
_ngcontent-kux-c272=“”
fxlayout=“”
fxlayoutalign=“start center”
class=“titleMachineContainer margin-left-36 ng-star-inserted”
style=“flex-direction: row; box-sizing: border-box; display: flex; place-content: center flex-start; align-items: center;”

<div _ngcontent-kux-c272="" fxlayout="" fxlayoutalign="start center" class="titleContainerHoverHighlighting" style="flex-direction: row; box-sizing: border-box; display: flex; place-content: center flex-start; align-items: center;">
    <svg-icon _ngcontent-kux-c272="" viewbox="auto" class="fixed-icon-size">
        <svg
            id="Ebene_1"
            style="enable-background: new 0 0 200 200;"
            version="1.1"                
        >
            <path
                d="M***z"
                _ngcontent-kux-c272=""
            ></path>
        </svg>
    </svg-icon>
    <span _ngcontent-kux-c272="">S-01259A</span>
</div>
<div _ngcontent-kux-c272="" fxlayoutalign="center center" class="clickable ng-star-inserted" style="place-content: center; align-items: center; flex-direction: row; box-sizing: border-box; display: flex;">
    <i _ngcontent-kux-c272="" class="ph-star-bold ng-star-inserted" style="color: rgb(60, 60, 60);"></i>
</div>
<div _ngcontent-kux-c272="" class="ng-star-inserted">
    <hk-idm-status-icon _ngcontent-kux-c272="" _nghost-kux-c271="">
        <div
            _ngcontent-kux-c271=""
            fxlayout="row"
            fxlayoutalign="center center"
            mattooltipposition="right"
            class="mat-tooltip-trigger ng-star-inserted"
            aria-describedby="cdk-describedby-message-kux-1-38"
            cdk-describedby-host="kux-1"
            style="flex-direction: row; box-sizing: border-box; display: flex; place-content: center; align-items: center;"
        >
            <i _ngcontent-kux-c271="" class="ph-check-circle-bold good-color"></i>
                       </div>
    </hk-idm-status-icon>
</div>

Unfortunately, you have lots of the same definition for the table. So, I can give my thoughts but you will have to fine tune it due to the limited amount of HTML you have shown. I don’t know if all the grids are defined with a class of “titleMachineContainer” or only the section that you have highlighted. So is it the first star or 7th star? I put it as the 7th. If it’s the first, then change the 7 to 1 and see…

//div[contains(@class, "titleMachineContainer")][7]/div[2]

@yakovlieva.olena

You wrote in the original post:

How do you specify the record? In your mind, you know the criteria how to specify which one you want to click, don’t you?

Is it “I want 7th row in the page”?
or it “I want to click the star beside a text ‘S-12594’”?

Please tell it to us (people in this forum). Then we would be able to express your criteria as a locator expression in XPath or CSS Selector. Without your criteria in your mind stated explicity, then nobody would be able to find the correct answer for you.

Thank you for your answer!
The conditions are:
“I want to click the star beside a text ‘S-12594’”

Thank you for your answer!
Yes, all the grids are defined with a class of “titleMachineContainer”.
The record can be defined by name. I provided the element S-01259A (one of multiple with a class of “titleMachineContainer”) in the question description.

Thank you for your help!

I have an XPath of the record

/html/body/hk-app-root/div/div/div/hk-addon-fleet-on/hk-sidenav/div/hk-construction-projects-list/div/div/table/tbody/tr[12]/td/div[3]/div[1]/span

What should I add/edit to define the object next to this record?

Thank you for your help!

I have a little bit smaller question now.
How to define for multiple records that contain @class, “titleMachineContainer”

in div[1] unique value

and then specify the div[2] for interacting with the object?

//div[contains(@class, “titleMachineContainer”)]/div[1]…

The locator generated by Katalon tools is useless to solve your problem.

Instead, I would suggest the following XPath expression:

//span[contains(text(),'S-01259A')]/parent::div/following-sibling::div[position()=1]

I am afraid that you, @yakovlieva.olena, would not understand this at all.

You need to study XPath expression. Read through the following article

1 Like

Sorry, this sentence does not make sense to me. Better English please.

Thank you for the ready decision and for the article. It is really helpful and new!

Not new at all.

W3C XPath 1.0 is dated at 1999-11-16, though XPath is not fashionable these days.

Ok.
My fault. New for me.
Thank you very much!