How to verify the two texts is not exactly common

I have two texts that I need to match.
Text A : a b c d
Text B : I get text from a table listing like this:
image
Now I need to verify that text A (a, b, c, d) matches with column 3 of text B.
Or the way for me Verify Text A has appeared in Text B (Table)

What condition should we return: that all the tokens are found within the table?

idk where that table comes from (a literal table on an app under test, an Excel file, …), But here is a method that will check that space-delimited string against your list of strings:

public final class StringUtils {
    public static final String Delimiter = ' ';

    public static boolean VerifyStringAgainstList(String tokenDelimitedString, List<String> expectedList) {
        return tokenDelimitedString.split(this.Delimiter)
            .find({ String token -> return !expectedList.contains(token); })
            == null;
    }
}

It is now on you to form the List from that table (please tell us how that table exists)…

The condition return is to verify that text A matches or does not match the text in column 3 of text B.
The list is like this; it has pagination.

I see…

So the table is coming from an app under “test”…Jira!

…and we are checking the “Key” column…

It looks like you intend to check if a target space-deimited String keyTokens matches is on the nth page…

It looks like you intend to check if a target space-deimited String keyTokens matches is on the nth page…

Yes right

Could you share the HTML for a couple of the rows, so that we can come up with an attack plan here?

Please copy a couple of them from your Developer Console, and paste them like so:

<!-- your code here-->

(Use ``` to start and ``` to end the code block)

HTML of one row

<div class="sc-gpEJdM fLuIBe paginated-row paginated-table-row"><div class="sc-cxxZvF jhBYPP table-cell"><div class="sc-cSiAOC exbPXw">1</div></div><div class="sc-cxxZvF jhBYPP table-cell"><div class="truncate profile-list-item-action">VLI Dac Vu</div></div><div class="sc-cxxZvF jhBYPP table-cell"><div class="truncate profile-list-item-action">Van Lang IPA</div></div><div class="sc-cxxZvF jhBYPP table-cell"><span fill="outlined" class="ant-tag sc-jHNicF hdNqPP core-label  user-profile-status-icon" style="background-color: var(--main-success); text-transform: capitalize; color: var(--main-success);"><span class="core-label-content">Active</span></span></div></div>

HTML of the table

<div class="sc-cxNHIi fHUQtx compose-section"><div class="sc-lmgQwP knQPyO compose-section-header no-border"><span class="title"><div><span>Other Profiles</span><button type="button" class="ant-btn ant-btn-link ant-btn-sm sc-laZMeE ljWfRO s8-button"><span role="img" aria-label="info-circle" class="anticon anticon-info-circle"><svg viewBox="64 64 896 896" focusable="false" data-icon="info-circle" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"></path><path d="M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"></path></svg></span></button></div></span></div><div class="sc-cApVyb eHJCkP paginated paginated-table profile-list"><div id="paginated-4fcf2e90-737b-40da-9801-c48d13f1984b" class="sc-hoPuav gXmMhE paginated-body"><div class="sc-gLMgcV cTPEai paginated-table-row paginated-table-header"><div class="sc-bnFVBq cpxcYi table-header-cell"><div class="sc-iKUVsf jHmYOS truncate"><div class="header-content truncate">Index</div></div></div><div class="sc-bnFVBq cpxcYi table-header-cell"><div class="sc-iKUVsf giZJzJ truncate"><div class="header-content truncate">Profile</div></div></div><div class="sc-bnFVBq cpxcYi table-header-cell"><div class="sc-iKUVsf jHmYOS truncate"><div class="header-content truncate">Company name</div></div></div><div class="sc-bnFVBq Ka-dXi table-header-cell"><div class="sc-iKUVsf ilJSfy truncate"><div class="header-content truncate">Profile Status</div></div></div></div><div class="sc-hlXxXZ fUZwnO"><div class="sc-leehGg gIgMeA paginated-non-data-container"><div class="sc-jrsJWt dJdFwe non-data-container"><div class="ant-empty ant-empty-normal sc-kOokqr jCiuZr"><div class="ant-empty-image"><svg class="ant-empty-img-simple" width="64" height="41" viewBox="0 0 64 41" xmlns="http://www.w3.org/2000/svg"><g transform="translate(0 1)" fill="none" fill-rule="evenodd"><ellipse class="ant-empty-img-simple-ellipse" cx="32" cy="33" rx="32" ry="7"></ellipse><g class="ant-empty-img-simple-g" fill-rule="nonzero"><path d="M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"></path><path d="M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z" class="ant-empty-img-simple-path"></path></g></g></svg></div><div class="ant-empty-description">No Data Available</div></div></div></div></div><div class="sc-lgWdIC cRRXke paginated-row-container" style="min-height: 0px;"><div class="sc-gpEJdM fLuIBe paginated-row paginated-table-row"><div class="sc-cxxZvF jhBYPP table-cell"><div class="sc-cSiAOC exbPXw">1</div></div><div class="sc-cxxZvF jhBYPP table-cell"><div class="truncate profile-list-item-action">VLI Dac Vu</div></div><div class="sc-cxxZvF jhBYPP table-cell"><div class="truncate profile-list-item-action">Van Lang IPA</div></div><div class="sc-cxxZvF jhBYPP table-cell"><span fill="outlined" class="ant-tag sc-jHNicF hdNqPP core-label  user-profile-status-icon" style="background-color: var(--main-success); text-transform: capitalize; color: var(--main-success);"><span class="core-label-content">Active</span></span></div></div><div class="sc-gpEJdM fLuIBe paginated-row paginated-table-row"><div class="sc-cxxZvF jhBYPP table-cell"><div class="sc-cSiAOC exbPXw">2</div></div><div class="sc-cxxZvF jhBYPP table-cell"><div class="truncate profile-list-item-action">Kate Jenner</div></div><div class="sc-cxxZvF jhBYPP table-cell"><div class="truncate profile-list-item-action">Mission Medical Supply</div></div><div class="sc-cxxZvF jhBYPP table-cell"><span fill="outlined" class="ant-tag sc-jHNicF hdNqPP core-label  user-profile-status-icon" style="background-color: var(--main-success); text-transform: capitalize; color: var(--main-success);"><span class="core-label-content">Active</span></span></div></div><div class="sc-gpEJdM fLuIBe paginated-row paginated-table-row"><div class="sc-cxxZvF jhBYPP table-cell"><div class="sc-cSiAOC exbPXw">3</div></div><div class="sc-cxxZvF jhBYPP table-cell"><div class="truncate profile-list-item-action">Kate Jenner</div></div><div class="sc-cxxZvF jhBYPP table-cell"><div class="truncate profile-list-item-action">Gulf Coast Prosthetics</div></div><div class="sc-cxxZvF jhBYPP table-cell"><span fill="outlined" class="ant-tag sc-jHNicF ilKPUV core-label  user-profile-status-icon" style="background-color: var(--main-grey); text-transform: capitalize; color: var(--main-grey);"><span class="core-label-content">Inactive</span></span></div></div><div class="sc-gpEJdM fLuIBe paginated-row paginated-table-row"><div class="sc-cxxZvF jhBYPP table-cell"><div class="sc-cSiAOC exbPXw">4</div></div><div class="sc-cxxZvF jhBYPP table-cell"><div class="truncate profile-list-item-action">Jack Sparrow</div></div><div class="sc-cxxZvF jhBYPP table-cell"><div class="truncate profile-list-item-action">COASTAL EYE ASSOCIATES, PLLC</div></div><div class="sc-cxxZvF jhBYPP table-cell"><span fill="outlined" class="ant-tag sc-jHNicF fNiHDM core-label  user-profile-status-icon" style="background-color: var(--sub-caution); text-transform: capitalize; color: var(--sub-caution);"><span class="core-label-content">Company Deactivated</span></span></div></div></div></div><div type="tertiary" class="sc-ezzafa eTrCdp compose-header type-tertiary size-compact header-variant paginated-footer"><div class="sc-bYwzuL bMDHOB header-item header-item-span"><div class="paginator paginator-small "><div class="paginator-page-list paginator-page-list-tight"></div><div class="paginator-size-changer "><div class="ant-select ant-select-sm selector  ant-select-single ant-select-show-arrow"><div class="ant-select-selector"><span class="ant-select-selection-search"><input autocomplete="off" type="search" class="ant-select-selection-search-input" role="combobox" aria-haspopup="listbox" aria-owns="rc_select_19_list" aria-autocomplete="list" aria-controls="rc_select_19_list" aria-activedescendant="rc_select_19_list_0" readonly="" unselectable="on" value="" id="rc_select_19" style="opacity: 0;"></span><span class="ant-select-selection-item">50 items</span></div><span class="ant-select-arrow" unselectable="on" aria-hidden="true" style="user-select: none;"><span role="img" aria-label="down" class="anticon anticon-down ant-select-suffix"><svg viewBox="64 64 896 896" focusable="false" data-icon="down" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"></path></svg></span></span></div></div></div></div></div></div></div>

i try to select an element with CSS selector

This is the code that i try to getText

import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase
import static com.kms.katalon.core.testdata.TestDataFactory.findTestData
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import static com.kms.katalon.core.testobject.ObjectRepository.findWindowsObject
import com.kms.katalon.core.checkpoint.Checkpoint as Checkpoint
import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile
import com.kms.katalon.core.model.FailureHandling as FailureHandling
import com.kms.katalon.core.testcase.TestCase as TestCase
import com.kms.katalon.core.testdata.TestData as TestData
import com.kms.katalon.core.testng.keyword.TestNGBuiltinKeywords as TestNGKW
import com.kms.katalon.core.testobject.TestObject as TestObject
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
import com.kms.katalon.core.windows.keyword.WindowsBuiltinKeywords as Windows
import internal.GlobalVariable as GlobalVariable
import org.openqa.selenium.Keys as Keys


WebUI.verifyElementPresent(findTestObject('Object Repository/lbl.Network and Contracting'), GlobalVariable.timeout)

WebUI.click(findTestObject('btn.Current Profile VLI Dac VuVan Lang IPA'))

alternateProfile = WebUI.getText(findTestObject('Object Repository/Verify dropdown profile/lbl.Alternate Profile'))

System.out.println(alternateProfile)

WebUI.navigateToUrl('https://admin.gotecq.com/tecq/usr')

WebUI.click(findTestObject('Object Repository/Verify dropdown profile/btn.User Module'))

WebUI.verifyTextPresent('PROFILES', true)

WebUI.setText(findTestObject('Object Repository/Verify dropdown profile/txt.Search Box'), 'ANN super admin')

WebUI.sendKeys(findTestObject('Object Repository/Verify dropdown profile/txt.Search Box'), Keys.chord(Keys.ENTER))

WebUI.click(findTestObject('Object Repository/Verify dropdown profile/tbl.User List'))

WebUI.scrollToElement(findTestObject('Object Repository/Verify dropdown profile/tbl.Other Profiles'), GlobalVariable.timeout)

alternateProfileAppUSR = WebUI.getText(findTestObject('Object Repository/Verify dropdown profile/tbl.Other Profiles'))

System.out.println(alternateProfileAppUSR)

Thank you for getting back to me with the code snippets and what you have tried!

However, when I pretty-print and examine it, I see a table with only four columns:

  • Index
  • Profile
  • Company name
  • Profile Status

It does not seem to match your screenshot, or the concern of your question…

We’re to match against the Index column, right?

The screenshot is just the example, I want to verify match 2 text from 2 element
one from this

<div class="dropdown-content"><div class="sc-EhTUr bKsxLj"><div class="sc-gzcbmu dpBxjj"><div class="primary-slot"><span role="img" aria-label="inbox" class="anticon s8-custom-icon icon-building  company-compact-building-icon"><svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12.167 7.167V.5H3.833v3.333H.5V15.5h6.667v-3.333h1.666V15.5H15.5V7.167h-3.333Zm-8.334 6.666H2.167v-1.666h1.666v1.666Zm0-3.333H2.167V8.833h1.666V10.5Zm0-3.333H2.167V5.5h1.666v1.667ZM7.167 10.5H5.5V8.833h1.667V10.5Zm0-3.333H5.5V5.5h1.667v1.667Zm0-3.334H5.5V2.167h1.667v1.666ZM10.5 10.5H8.833V8.833H10.5V10.5Zm0-3.333H8.833V5.5H10.5v1.667Zm0-3.334H8.833V2.167H10.5v1.666Zm3.333 10h-1.666v-1.666h1.666v1.666Zm0-3.333h-1.666V8.833h1.666V10.5Z" fill="currentColor"></path></svg></span></div><div class="secondary-slot truncate"><span class="sc-dkQUaI bOtGDl format-text">COASTAL EYE ASSOCIATES, PLLC<span role="img" aria-label="exclamation-circle" class="anticon anticon-exclamation-circle inactivated-profile-icon"><svg viewBox="64 64 896 896" focusable="false" data-icon="exclamation-circle" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"></path><path d="M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z"></path></svg></span></span></div><div class="tertiary-slot"><span role="img" aria-label="team" class="anticon anticon-team"><svg viewBox="64 64 896 896" focusable="false" data-icon="team" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M824.2 699.9a301.55 301.55 0 00-86.4-60.4C783.1 602.8 812 546.8 812 484c0-110.8-92.4-201.7-203.2-200-109.1 1.7-197 90.6-197 200 0 62.8 29 118.8 74.2 155.5a300.95 300.95 0 00-86.4 60.4C345 754.6 314 826.8 312 903.8a8 8 0 008 8.2h56c4.3 0 7.9-3.4 8-7.7 1.9-58 25.4-112.3 66.7-153.5A226.62 226.62 0 01612 684c60.9 0 118.2 23.7 161.3 66.8C814.5 792 838 846.3 840 904.3c.1 4.3 3.7 7.7 8 7.7h56a8 8 0 008-8.2c-2-77-33-149.2-87.8-203.9zM612 612c-34.2 0-66.4-13.3-90.5-37.5a126.86 126.86 0 01-37.5-91.8c.3-32.8 13.4-64.5 36.3-88 24-24.6 56.1-38.3 90.4-38.7 33.9-.3 66.8 12.9 91 36.6 24.8 24.3 38.4 56.8 38.4 91.4 0 34.2-13.3 66.3-37.5 90.5A127.3 127.3 0 01612 612zM361.5 510.4c-.9-8.7-1.4-17.5-1.4-26.4 0-15.9 1.5-31.4 4.3-46.5.7-3.6-1.2-7.3-4.5-8.8-13.6-6.1-26.1-14.5-36.9-25.1a127.54 127.54 0 01-38.7-95.4c.9-32.1 13.8-62.6 36.3-85.6 24.7-25.3 57.9-39.1 93.2-38.7 31.9.3 62.7 12.6 86 34.4 7.9 7.4 14.7 15.6 20.4 24.4 2 3.1 5.9 4.4 9.3 3.2 17.6-6.1 36.2-10.4 55.3-12.4 5.6-.6 8.8-6.6 6.3-11.6-32.5-64.3-98.9-108.7-175.7-109.9-110.9-1.7-203.3 89.2-203.3 199.9 0 62.8 28.9 118.8 74.2 155.5-31.8 14.7-61.1 35-86.5 60.4-54.8 54.7-85.8 126.9-87.8 204a8 8 0 008 8.2h56.1c4.3 0 7.9-3.4 8-7.7 1.9-58 25.4-112.3 66.7-153.5 29.4-29.4 65.4-49.8 104.7-59.7 3.9-1 6.5-4.7 6-8.7z"></path></svg></span></div></div></div><div class="sc-EhTUr bKsxLj"><div class="sc-gzcbmu dpBxjj"><div class="primary-slot"><span role="img" aria-label="inbox" class="anticon s8-custom-icon icon-building  company-compact-building-icon"><svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12.167 7.167V.5H3.833v3.333H.5V15.5h6.667v-3.333h1.666V15.5H15.5V7.167h-3.333Zm-8.334 6.666H2.167v-1.666h1.666v1.666Zm0-3.333H2.167V8.833h1.666V10.5Zm0-3.333H2.167V5.5h1.666v1.667ZM7.167 10.5H5.5V8.833h1.667V10.5Zm0-3.333H5.5V5.5h1.667v1.667Zm0-3.334H5.5V2.167h1.667v1.666ZM10.5 10.5H8.833V8.833H10.5V10.5Zm0-3.333H8.833V5.5H10.5v1.667Zm0-3.334H8.833V2.167H10.5v1.666Zm3.333 10h-1.666v-1.666h1.666v1.666Zm0-3.333h-1.666V8.833h1.666V10.5Z" fill="currentColor"></path></svg></span></div><div class="secondary-slot truncate"><span class="sc-dkQUaI bOtGDl format-text">Gulf Coast Prosthetics<span role="img" aria-label="exclamation-circle" class="anticon anticon-exclamation-circle inactivated-profile-icon"><svg viewBox="64 64 896 896" focusable="false" data-icon="exclamation-circle" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"></path><path d="M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z"></path></svg></span></span></div><div class="tertiary-slot"><span role="img" aria-label="team" class="anticon anticon-team"><svg viewBox="64 64 896 896" focusable="false" data-icon="team" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M824.2 699.9a301.55 301.55 0 00-86.4-60.4C783.1 602.8 812 546.8 812 484c0-110.8-92.4-201.7-203.2-200-109.1 1.7-197 90.6-197 200 0 62.8 29 118.8 74.2 155.5a300.95 300.95 0 00-86.4 60.4C345 754.6 314 826.8 312 903.8a8 8 0 008 8.2h56c4.3 0 7.9-3.4 8-7.7 1.9-58 25.4-112.3 66.7-153.5A226.62 226.62 0 01612 684c60.9 0 118.2 23.7 161.3 66.8C814.5 792 838 846.3 840 904.3c.1 4.3 3.7 7.7 8 7.7h56a8 8 0 008-8.2c-2-77-33-149.2-87.8-203.9zM612 612c-34.2 0-66.4-13.3-90.5-37.5a126.86 126.86 0 01-37.5-91.8c.3-32.8 13.4-64.5 36.3-88 24-24.6 56.1-38.3 90.4-38.7 33.9-.3 66.8 12.9 91 36.6 24.8 24.3 38.4 56.8 38.4 91.4 0 34.2-13.3 66.3-37.5 90.5A127.3 127.3 0 01612 612zM361.5 510.4c-.9-8.7-1.4-17.5-1.4-26.4 0-15.9 1.5-31.4 4.3-46.5.7-3.6-1.2-7.3-4.5-8.8-13.6-6.1-26.1-14.5-36.9-25.1a127.54 127.54 0 01-38.7-95.4c.9-32.1 13.8-62.6 36.3-85.6 24.7-25.3 57.9-39.1 93.2-38.7 31.9.3 62.7 12.6 86 34.4 7.9 7.4 14.7 15.6 20.4 24.4 2 3.1 5.9 4.4 9.3 3.2 17.6-6.1 36.2-10.4 55.3-12.4 5.6-.6 8.8-6.6 6.3-11.6-32.5-64.3-98.9-108.7-175.7-109.9-110.9-1.7-203.3 89.2-203.3 199.9 0 62.8 28.9 118.8 74.2 155.5-31.8 14.7-61.1 35-86.5 60.4-54.8 54.7-85.8 126.9-87.8 204a8 8 0 008 8.2h56.1c4.3 0 7.9-3.4 8-7.7 1.9-58 25.4-112.3 66.7-153.5 29.4-29.4 65.4-49.8 104.7-59.7 3.9-1 6.5-4.7 6-8.7z"></path></svg></span></div></div></div><div class="sc-EhTUr bKsxLj"><div class="sc-gzcbmu dpBxjj"><div class="primary-slot"><span role="img" aria-label="inbox" class="anticon s8-custom-icon icon-building  company-compact-building-icon"><svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12.167 7.167V.5H3.833v3.333H.5V15.5h6.667v-3.333h1.666V15.5H15.5V7.167h-3.333Zm-8.334 6.666H2.167v-1.666h1.666v1.666Zm0-3.333H2.167V8.833h1.666V10.5Zm0-3.333H2.167V5.5h1.666v1.667ZM7.167 10.5H5.5V8.833h1.667V10.5Zm0-3.333H5.5V5.5h1.667v1.667Zm0-3.334H5.5V2.167h1.667v1.666ZM10.5 10.5H8.833V8.833H10.5V10.5Zm0-3.333H8.833V5.5H10.5v1.667Zm0-3.334H8.833V2.167H10.5v1.666Zm3.333 10h-1.666v-1.666h1.666v1.666Zm0-3.333h-1.666V8.833h1.666V10.5Z" fill="currentColor"></path></svg></span></div><div class="secondary-slot truncate"><span class="sc-dkQUaI bOtGDl format-text">Mission Medical Supply</span></div><div class="tertiary-slot"><span role="img" aria-label="team" class="anticon anticon-team"><svg viewBox="64 64 896 896" focusable="false" data-icon="team" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M824.2 699.9a301.55 301.55 0 00-86.4-60.4C783.1 602.8 812 546.8 812 484c0-110.8-92.4-201.7-203.2-200-109.1 1.7-197 90.6-197 200 0 62.8 29 118.8 74.2 155.5a300.95 300.95 0 00-86.4 60.4C345 754.6 314 826.8 312 903.8a8 8 0 008 8.2h56c4.3 0 7.9-3.4 8-7.7 1.9-58 25.4-112.3 66.7-153.5A226.62 226.62 0 01612 684c60.9 0 118.2 23.7 161.3 66.8C814.5 792 838 846.3 840 904.3c.1 4.3 3.7 7.7 8 7.7h56a8 8 0 008-8.2c-2-77-33-149.2-87.8-203.9zM612 612c-34.2 0-66.4-13.3-90.5-37.5a126.86 126.86 0 01-37.5-91.8c.3-32.8 13.4-64.5 36.3-88 24-24.6 56.1-38.3 90.4-38.7 33.9-.3 66.8 12.9 91 36.6 24.8 24.3 38.4 56.8 38.4 91.4 0 34.2-13.3 66.3-37.5 90.5A127.3 127.3 0 01612 612zM361.5 510.4c-.9-8.7-1.4-17.5-1.4-26.4 0-15.9 1.5-31.4 4.3-46.5.7-3.6-1.2-7.3-4.5-8.8-13.6-6.1-26.1-14.5-36.9-25.1a127.54 127.54 0 01-38.7-95.4c.9-32.1 13.8-62.6 36.3-85.6 24.7-25.3 57.9-39.1 93.2-38.7 31.9.3 62.7 12.6 86 34.4 7.9 7.4 14.7 15.6 20.4 24.4 2 3.1 5.9 4.4 9.3 3.2 17.6-6.1 36.2-10.4 55.3-12.4 5.6-.6 8.8-6.6 6.3-11.6-32.5-64.3-98.9-108.7-175.7-109.9-110.9-1.7-203.3 89.2-203.3 199.9 0 62.8 28.9 118.8 74.2 155.5-31.8 14.7-61.1 35-86.5 60.4-54.8 54.7-85.8 126.9-87.8 204a8 8 0 008 8.2h56.1c4.3 0 7.9-3.4 8-7.7 1.9-58 25.4-112.3 66.7-153.5 29.4-29.4 65.4-49.8 104.7-59.7 3.9-1 6.5-4.7 6-8.7z"></path></svg></span></div></div></div><div class="sc-EhTUr eCeahS"><div class="sc-gzcbmu dpBxjj"><div class="primary-slot"><span role="img" aria-label="inbox" class="anticon s8-custom-icon icon-building  company-compact-building-icon"><svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12.167 7.167V.5H3.833v3.333H.5V15.5h6.667v-3.333h1.666V15.5H15.5V7.167h-3.333Zm-8.334 6.666H2.167v-1.666h1.666v1.666Zm0-3.333H2.167V8.833h1.666V10.5Zm0-3.333H2.167V5.5h1.666v1.667ZM7.167 10.5H5.5V8.833h1.667V10.5Zm0-3.333H5.5V5.5h1.667v1.667Zm0-3.334H5.5V2.167h1.667v1.666ZM10.5 10.5H8.833V8.833H10.5V10.5Zm0-3.333H8.833V5.5H10.5v1.667Zm0-3.334H8.833V2.167H10.5v1.666Zm3.333 10h-1.666v-1.666h1.666v1.666Zm0-3.333h-1.666V8.833h1.666V10.5Z" fill="currentColor"></path></svg></span></div><div class="secondary-slot truncate"><span class="sc-dkQUaI bOtGDl format-text">Van Lang IPA</span></div><div class="tertiary-slot"><span role="img" aria-label="inbox" class="anticon s8-custom-icon icon-user-admin  "><svg width="1em" height="1em" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9.24 14.88c-2.4-1.2-4.02-3.6-4.02-6.48 0-3.96 3.24-7.2 7.2-7.2s7.2 3.24 7.2 7.2c0 3.9-3.06 7.08-6.96 7.2h-.06c-5.94 0-10.8 4.86-10.8 10.8 0 .36-.24.6-.6.6s-.6-.24-.6-.6c0-5.46 3.66-10.08 8.64-11.52zm3.18-.48c3.3 0 6-2.7 6-6s-2.7-6-6-6-6 2.7-6 6 2.7 6 6 6zm16.44 3.96.12.3-1.44 1.74a.9.9 0 0 0 0 1.08l1.44 1.68-.12.3c-.3.84-.72 1.68-1.32 2.34l-.24.24-2.22-.36c-.36-.06-.78.18-.9.54l-.78 2.16-.3.06c-1.14.24-2.28.24-3.42 0l-.36-.06-.72-2.1c-.12-.36-.54-.6-.9-.54l-2.28.36-.24-.24c-.3-.3-.54-.66-.72-1.02-.24-.42-.48-.9-.6-1.38l-.12-.3 1.5-1.68c.24-.3.24-.78 0-1.02l-1.44-1.74.12-.3c.3-.9.78-1.68 1.38-2.4l.24-.24 2.16.36c.36.06.78-.18.96-.54l.78-2.1.3-.06c1.08-.24 2.22-.24 3.36 0l.36.06.72 2.04c.12.36.54.66.96.6l2.22-.3.24.24c.3.36.54.66.72 1.08.18.3.36.78.54 1.2zm-1.68-.72c-.12-.24-.24-.42-.42-.66l-1.56.18c-.96.12-1.92-.48-2.22-1.38l-.48-1.38c-.72-.12-1.44-.12-2.16 0l-.54 1.44c-.3.9-1.32 1.5-2.28 1.32l-1.5-.24c-.36.42-.6.96-.84 1.44l1.02 1.2c.6.72.6 1.86 0 2.58l-1.02 1.2c.12.3.24.54.42.84.12.24.24.42.42.6l1.62-.24c.96-.12 1.92.48 2.22 1.38l.48 1.44c.72.12 1.5.12 2.22 0l.54-1.5c.3-.9 1.32-1.5 2.22-1.32l1.5.24c.3-.42.6-.9.78-1.44l-.96-1.14c-.6-.72-.66-1.86-.06-2.58l1.02-1.2c-.12-.24-.24-.48-.42-.78zm-5.76 6c-1.5 0-2.7-1.2-2.7-2.7s1.2-2.7 2.7-2.7 2.7 1.2 2.7 2.7-1.26 2.7-2.7 2.7zm0-1.2c.84 0 1.5-.66 1.5-1.5s-.66-1.5-1.5-1.5-1.5.66-1.5 1.5.66 1.5 1.5 1.5z" fill="currentColor" stroke="currentColor"></path></svg></span></div></div></div></div>

and one from column Company name of this

<div class="sc-cxNHIi fHUQtx compose-section"><div class="sc-lmgQwP knQPyO compose-section-header no-border"><span class="title"><div><span>Other Profiles</span><button type="button" class="ant-btn ant-btn-link ant-btn-sm sc-laZMeE ljWfRO s8-button"><span role="img" aria-label="info-circle" class="anticon anticon-info-circle"><svg viewBox="64 64 896 896" focusable="false" data-icon="info-circle" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"></path><path d="M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"></path></svg></span></button></div></span></div><div class="sc-cApVyb eHJCkP paginated paginated-table profile-list"><div id="paginated-4fcf2e90-737b-40da-9801-c48d13f1984b" class="sc-hoPuav gXmMhE paginated-body"><div class="sc-gLMgcV cTPEai paginated-table-row paginated-table-header"><div class="sc-bnFVBq cpxcYi table-header-cell"><div class="sc-iKUVsf jHmYOS truncate"><div class="header-content truncate">Index</div></div></div><div class="sc-bnFVBq cpxcYi table-header-cell"><div class="sc-iKUVsf giZJzJ truncate"><div class="header-content truncate">Profile</div></div></div><div class="sc-bnFVBq cpxcYi table-header-cell"><div class="sc-iKUVsf jHmYOS truncate"><div class="header-content truncate">Company name</div></div></div><div class="sc-bnFVBq Ka-dXi table-header-cell"><div class="sc-iKUVsf ilJSfy truncate"><div class="header-content truncate">Profile Status</div></div></div></div><div class="sc-hlXxXZ fUZwnO"><div class="sc-leehGg gIgMeA paginated-non-data-container"><div class="sc-jrsJWt dJdFwe non-data-container"><div class="ant-empty ant-empty-normal sc-kOokqr jCiuZr"><div class="ant-empty-image"><svg class="ant-empty-img-simple" width="64" height="41" viewBox="0 0 64 41" xmlns="http://www.w3.org/2000/svg"><g transform="translate(0 1)" fill="none" fill-rule="evenodd"><ellipse class="ant-empty-img-simple-ellipse" cx="32" cy="33" rx="32" ry="7"></ellipse><g class="ant-empty-img-simple-g" fill-rule="nonzero"><path d="M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"></path><path d="M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z" class="ant-empty-img-simple-path"></path></g></g></svg></div><div class="ant-empty-description">No Data Available</div></div></div></div></div><div class="sc-lgWdIC cRRXke paginated-row-container" style="min-height: 0px;"><div class="sc-gpEJdM fLuIBe paginated-row paginated-table-row"><div class="sc-cxxZvF jhBYPP table-cell"><div class="sc-cSiAOC exbPXw">1</div></div><div class="sc-cxxZvF jhBYPP table-cell"><div class="truncate profile-list-item-action">VLI Dac Vu</div></div><div class="sc-cxxZvF jhBYPP table-cell"><div class="truncate profile-list-item-action">Van Lang IPA</div></div><div class="sc-cxxZvF jhBYPP table-cell"><span fill="outlined" class="ant-tag sc-jHNicF hdNqPP core-label  user-profile-status-icon" style="background-color: var(--main-success); text-transform: capitalize; color: var(--main-success);"><span class="core-label-content">Active</span></span></div></div><div class="sc-gpEJdM fLuIBe paginated-row paginated-table-row"><div class="sc-cxxZvF jhBYPP table-cell"><div class="sc-cSiAOC exbPXw">2</div></div><div class="sc-cxxZvF jhBYPP table-cell"><div class="truncate profile-list-item-action">Kate Jenner</div></div><div class="sc-cxxZvF jhBYPP table-cell"><div class="truncate profile-list-item-action">Mission Medical Supply</div></div><div class="sc-cxxZvF jhBYPP table-cell"><span fill="outlined" class="ant-tag sc-jHNicF hdNqPP core-label  user-profile-status-icon" style="background-color: var(--main-success); text-transform: capitalize; color: var(--main-success);"><span class="core-label-content">Active</span></span></div></div><div class="sc-gpEJdM fLuIBe paginated-row paginated-table-row"><div class="sc-cxxZvF jhBYPP table-cell"><div class="sc-cSiAOC exbPXw">3</div></div><div class="sc-cxxZvF jhBYPP table-cell"><div class="truncate profile-list-item-action">Kate Jenner</div></div><div class="sc-cxxZvF jhBYPP table-cell"><div class="truncate profile-list-item-action">Gulf Coast Prosthetics</div></div><div class="sc-cxxZvF jhBYPP table-cell"><span fill="outlined" class="ant-tag sc-jHNicF ilKPUV core-label  user-profile-status-icon" style="background-color: var(--main-grey); text-transform: capitalize; color: var(--main-grey);"><span class="core-label-content">Inactive</span></span></div></div><div class="sc-gpEJdM fLuIBe paginated-row paginated-table-row"><div class="sc-cxxZvF jhBYPP table-cell"><div class="sc-cSiAOC exbPXw">4</div></div><div class="sc-cxxZvF jhBYPP table-cell"><div class="truncate profile-list-item-action">Jack Sparrow</div></div><div class="sc-cxxZvF jhBYPP table-cell"><div class="truncate profile-list-item-action">COASTAL EYE ASSOCIATES, PLLC</div></div><div class="sc-cxxZvF jhBYPP table-cell"><span fill="outlined" class="ant-tag sc-jHNicF fNiHDM core-label  user-profile-status-icon" style="background-color: var(--sub-caution); text-transform: capitalize; color: var(--sub-caution);"><span class="core-label-content">Company Deactivated</span></span></div></div></div></div><div type="tertiary" class="sc-ezzafa eTrCdp compose-header type-tertiary size-compact header-variant paginated-footer"><div class="sc-bYwzuL bMDHOB header-item header-item-span"><div class="paginator paginator-small "><div class="paginator-page-list paginator-page-list-tight"></div><div class="paginator-size-changer "><div class="ant-select ant-select-sm selector  ant-select-single ant-select-show-arrow"><div class="ant-select-selector"><span class="ant-select-selection-search"><input autocomplete="off" type="search" class="ant-select-selection-search-input" role="combobox" aria-haspopup="listbox" aria-owns="rc_select_19_list" aria-autocomplete="list" aria-controls="rc_select_19_list" aria-activedescendant="rc_select_19_list_0" readonly="" unselectable="on" value="" id="rc_select_19" style="opacity: 0;"></span><span class="ant-select-selection-item">50 items</span></div><span class="ant-select-arrow" unselectable="on" aria-hidden="true" style="user-select: none;"><span role="img" aria-label="down" class="anticon anticon-down ant-select-suffix"><svg viewBox="64 64 896 896" focusable="false" data-icon="down" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"></path></svg></span></span></div></div></div></div></div></div></div>

I noticed that your target element reside inside a node of Scalable Vector Graphics.

SVG elements belong to different XML Namespace, they do not belong to the XML Namespace of HTML.Therefore you need to write your XPath expression in the way XML Namespace aware.

Are you familiar with XML Namespace?

If not, you need to study how to write a XPath which is XML Namespace-aware.

Without that skill, you would never be able to solve your current issue.


Have a look at my previous post:

Unfortunately, I am not

Thanks, I will read it

I see…

In this case, we need to change up our strategy a little bit…

Katalon Studio, out of the box, won’t be enough to help us

Introducing Page Object Model!

This is a test design pattern meant to separate testing/verification concerns from page-interaction ones, as well as abstract away a lot of the gritty details, to make your code easier to reason about and maintain (I’ma drop an article on those at some point, just not here :wink: )

Our code for this task is going to live there…

It will be defined like:

public class JiraPage { 
    public final String dropdownListClassName = "dropdown-content",
        tableRowClassName = "paginated-table-row";

    public final int companyNameIndex = 3;

    public List<String> getCompanyNamesFromTable() { 
        // TODO: wait for your current page to become visible here

        return DriverFactory.getWebDriver()
            .findWebElements(By.css(".${this.tableRowClassName} .table-cell:nth-child(${this.companyNameIndex}) > div"))
            .collect({ WebElement tableCell -> return tableCell.getText() })
    }

    public List<String> getDropdownTextList() {  
        // TODO: wait for your dropdown options to become visible here

        return DriverFactory.getWebDriver()
            .findWebElements(By.css(".${this.dropdownListClassName} div.secondary-slot > span.format-text"))
            .collect({ WebElement dropdownTextContainer -> return dropdownTextContainer.getText()})
    }

}

I would suggest, with this, that you wait on your table data and dropdown list to become visible/present, inside the respective methods…

From here, we change our previous helper method to the following:

Helper method change

Throw out that StringUtils, we’re going to replace it with :

public final class CollectionUtils {
    public static boolean VerifySublist(List<String> actualList, List<String> expectedSuperList) {
        return actualList
            .find({ String element -> return !expectedSuperList.contains(element); })
            == null;
    }
}

Putting it altogether

Armed with this, we now just

JiraPage page = new JiraPage();

assert CollectionUtils.VerifySublist(page.getDropdownTextList(), page.getCompanyNamesFromTable());

lmk if you have any questions on this!

1 Like

Are we defining it in the test case?

We’re defining it in Custom Keywords

I’ll try it, thank you so much

1 Like

I don’t know how to apply your code to execute, do I right when creating a keyword and putting the code in it, it have a problem with =

probably because of where it’s at. I will leave debugging skills up to you.

Also, write those classes to their own keyword files.

Your test case should be creating that page objects and calling those methods. That’s kinda the point of this design.

How goes your progress in implementing this?