I was wondering if someone could help me out with how to make a dynamic Xpath. I need to click on a button that has an xpath that changes depending on the “case number” The following is the xpath:
I tried doing that but once I do WebUI.click(new_btn) the test fails.
Also, the ‘Object/With/CaseNumber’ also has an xpath that depends on that case number itself.
I tried manually putting String caseNumber = ‘4499’ and passing it to through the modifyObjectProperty function. While it says that I was successfully able to change the property, the test still fails when I click on the button.
Exception says element not interactable - is it displayed correctly at the time you test it? And I may need more HTML code, to make sure your xpath is correct.
//button[@data-pika-day = 'startDay' and @data-pika-month = 'startMonth']
im trying to put the variable in xpath but its not working
Caused by: com.kms.katalon.core.webui.exception.WebElementNotFoundException: Web element with id: ‘Object Repository/a_Universal/start’ located by ‘By.xpath: //button[@data-pika-day = 'startDay' and @data-pika-month = 'startMonth']’ not found