From c2f02e4c6265305b81abb056106f114cec00515f Mon Sep 17 00:00:00 2001 From: Nisha Bagdwal Date: Thu, 18 Jul 2024 10:38:01 -0400 Subject: [PATCH] HPCC-31857 - Change the way of accessing web element --- esp/src/test-ui/tests/framework/pages/BaseTableTest.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/esp/src/test-ui/tests/framework/pages/BaseTableTest.java b/esp/src/test-ui/tests/framework/pages/BaseTableTest.java index f1aa6baf168..158e616a2a9 100644 --- a/esp/src/test-ui/tests/framework/pages/BaseTableTest.java +++ b/esp/src/test-ui/tests/framework/pages/BaseTableTest.java @@ -345,7 +345,12 @@ private String getCurrentSortingOrder(String columnKey) { try { - WebElement columnHeader = Common.driver.findElement(By.xpath("//*[@*[.='" + columnKey + "']]")); + //WebElement columnHeader = Common.driver.findElement(By.xpath("//*[@*[.='" + columnKey + "']]")); + + WebElement columnHeader = Common.driver.findElement(By.xpath("//*[@role='columnheader' and @*[.='" + columnKey + "']]")); + + // Scroll into view + //((JavascriptExecutor) Common.driver).executeScript("arguments[0].scrollIntoView(true);", columnHeader); String oldSortOrder = columnHeader.getAttribute("aria-sort");