Unable to retreive xpath from object repository during script

Updating this, found another thread on the forum. Link below. The answer appears to be that I need to use expression language which I don’t have a lot of experience with but it seems to be working now.

Updated code -

WebDriver driver = DriverFactory.getWebDriver();

Actions actions = new Actions(DriverFactory.getWebDriver());

TestObject eLoadSupplierMasterData = findTestObject(‘Object Repository/Engine Execution Log/Engine Execution Request - Processes To Execute/Processes to Execute - Load Supplier Master Data’);

actions.keyDown(Keys.LEFT_CONTROL)
.click(driver.findElement(By.xpath(“${eLoadSupplierMasterData.findPropertyValue(‘xpath’)}”)))
.keyUp(Keys.LEFT_CONTROL)
.build()
.perform();

1 Like