Hello,
I am using Katalon Studio 7.2.1 to record and test a web application where all the content is within two cascading frames.
I have no problem to record and replay test cases using Object Repository until I need to manipulate the test objects from code (custom keywords).
From code, it always fails to access objets that are inside frames with the following error :
Unable to find the element located by ‘By.xpath: //input[@name=‘textinput1’]’ (…)
You will find attached a few html pages and my Katalon project to reproduce the problem.
katalon-test-app.zip (35.7 KB)
When I test the same form without surrounding frames, the same code works fine.
But I can’t test without frames in the real application.
Should I add some code to ensure that frames are well managed from the following code ?
I would like to be able to use the same recorded objects from the “visual” test cases and code.
@Keyword
def AccessElementFromCode(TestObject to) {
try {
WebElement element = WebUiBuiltInKeywords.findWebElement(to);
KeywordUtil.logInfo("element is of type " + element.getTagName());
} catch (WebElementNotFoundException e) {
KeywordUtil.markFailed("Element not found");
} catch (Exception e) {
KeywordUtil.markFailed("Fail to click on element");
}
}
Thanks !