4

I tired a lot to get the xpath of the div which displays as "カーク商品掲載カタログ Online" on screen, but I'm not able to. The application is made using ZK framework hence it has random ID's.

<td z.type="Lic" id="z_mk_qr1" class="activeCatalogVersionTreeItem z-list-cell" z.zcls="z-list-cell" onmouseout="dragHoverClick( $e('z_mk_qr1'), event, true, null, 0);" onmouseover="dragHoverClick( $e('z_mk_qr1'), event, false, 'PerspectiveDND', 500);">
    <div id="z_mk_qr1!cave" class="z-list-cell-cnt z-overflow-hidden">カーク商品掲載カタログ Online
        <span id="z_mk_rr1" class="catalog-mnemonic-label z-label" z.zcls="z-label"> (STO-O)
        </span>
    </div>
</td>

I thought the xpath should be something like //div[contains(text(),'カーク商品掲載カタログ Online')], but it doesn't work.

Thanks!

Sanchit Khera
  • 1,005
  • 1
  • 16
  • 47

2 Answers2

2

Try the below cssSelector to identify the required element.

td.activeCatalogVersionTreeItem div.z-list-cell-cnt
Sudharsan Selvaraj
  • 4,792
  • 3
  • 14
  • 22
0

You may use partial text match in this case as follows:

//div[contains(text(), 'Online')]

Check the link below for more:

https://sqa.stackexchange.com/questions/10342/how-to-find-element-using-contains-in-xpath

Community
  • 1
  • 1
optimistic_creeper
  • 2,739
  • 3
  • 23
  • 37