SAP NetWeaver Portal/iframe_Capture object_isolatedWorkArea' was broken. Propose an alternative one: '//div/iframe'

Hi All,

I’m trying to automate the SAP web gui, it looks like below -

I tried to capture the objects through 2 ways. 1. Record web and 2.Spy web as inspect is not working. however the scripts failing with the below error. Kindly help on how to resolve this. Thanks in advance.

error ; SAP NetWeaver Portal/iframe_Capture object_isolatedWorkArea’ was broken. Propose an alternative one: ‘//div/iframe’.

1 Like

You are likely not going to like this, but since Inspect also does not work on one of our applications, I have to do the following:

To investigate the HTML of your objects, start DevTools to review your HTML; hit the F12 key, click on “Open DevTools”, then use either CTRL + SHIFT + C or click on the first icon within the DevTools area that looks like a rectangle with a pointer moving into it. Then move your mouse pointer to an element. Click on the element to have the HTML display that element’s information. “Rinse and repeat for each element.”

Yeah, I know it’s a bother, but you need to see the HTML and learn to build pathways, either using XPath or CSS. It gets even worse when the <id> of the objects are dynamic. If the <id> are dynamic, look if there is a <name> attribute that can help or use the function, “contains()”, in the pathway.

Edit: although Inspect does not work, using the F12 key does.

1 Like

Hi, Thank you for the solution.

I was able to create test objects as per the steps you mentioned, but however, the scripts are still not recognizing the elements and failing with the error

Caused by: com.kms.katalon.core.webui.exception.WebElementNotFoundException: Web element with id: ‘Object Repository/calendarmonth’ located by ‘/html/body/form/table/tbody/tr/td/table/tbody/tr[2]/td/table/tbody/tr[3]/td[6]/table/tbody/tr/td[1]/input’ not found

Kindly help.

Likely, you now have to put in “wait” statements. You now have to slow your script down to the speed of your browser.
When you move to a new page, you should have:
WebUI.waitForPageLoad(10)

Also, after I move to a new page, then I ensure my objects (at least one of them on the page) are ready with :
WebUI.waitForElementVisible(findTestObject(...), 10)

I also use the above statement when an object appears on the page because of another object, such as clicking on a radio button makes a textbox appear.

In a situation where one object drop-down can make changes within another drop-down, such as selecting country (e.g. Canada or USA) and you get Provinces or States. Here you can use:
WebUI.waitForElementClickable(findTestObject(...), 10)

I believe something has changed internally with the above statement and I have needed to add a 2 second delay after the above.

I use 10 as my timeOut in everything, except waitForElementNotVisible or waitForElementNotPresent. Then I only use 2 as my timeOut. It does not take 10 seconds to run each statement but will error out after 10 seconds. You can set it to 5 if you are not a coffee drinker.

See if that helps.

Edit: Another option you can do is to use verify statements within your script to check on what is happening. As an example, you can use the below before you interact with an object, like click or set text.
WebUI.verifyElementVisible(findTestObject(...))

After you set text in a textbox or textarea, then you can verify the text is placed.

WebUI.verifyElementAttributeValue(findTestObject('...'), "value", "your text here", 10)
1 Like

The pathway you have for this element is “ugly” and can be very easily broken. Are there any closer points to start your pathway and still be an unique pathway? Are there any <id> or <name> references close by? <id> attributes are supposed to be unique, so if you can put it in the pathway, voila. Using various functions within the pathway can allow you to move from one nearby element to another.

Edit: If you need more assistance, you will have to put your HTML here for others to give their input.

1 Like

Thank you so much, will try the steps you mentioned.