An Error Occurs When Targeting an Inline Frame

When an error occurs while targeting a frame or its contents, specify the XPath value manually.

Issue

An error occurs when you use the low-code tools to target an iframe or an element in an iframe. The error looks like this:

An error appears. The error text is as follows. Oracle Robot Flow Designer. SecurityError: Failed to read a named property 'frameElement' from 'Window': Blocked a frame with origin

Why It Happens

Depending on how a website is set up, the frame action might or might not be able to target the content in a frame. For example, if an inline frame has restrictions on accessing cross-origin resources, the frame action cannot capture an XPath value for the inline frame and its elements.

What to Do

  1. Update the Locator field for the frame action.
    1. Open the frame action for editing.
    2. If a value exists in the Locator field, clear the value.
    3. Type the following value in the Locator field:

      xpath:

    4. Copy the XPath value of the parent iframe, and paste it into the Locator field after the xpath: value.

      If you're not sure how to copy the XPath value from a web browser, see View an Element's XPath.

      For example, the Locator value might look something like this:

      xpath://*[@id="Multiple"]/iframe

    5. Type the following value immediately after the XPath value in the Locator field:

      ,xpath:

      For example:

      xpath://*[@id="Multiple"]/iframe,xpath:

    6. Copy the XPath value of the embedded iframe, and paste it into the Locator field immediately after the ,xpath: value.

      For example, the entire Locator value might look something like this:

      xpath://*[@id="Multiple"]/iframe,xpath:/html/body/section/div/div/iframe

  2. Update the Locator fields for all actions that are in the frame action.

    If an action doesn't contain a Locator field, you don't have to perform these steps for the action.

    1. Open an action that is in the frame action.
    2. If a value exists in the Locator field, clear the value.
    3. Type the following value in the Locator field:

      xpath:

    4. Copy the XPath value of the UI element that the action interacts with, and paste it into the Locator field immediately after the xpath: value.

      If you're not sure how to copy the XPath value from a web browser, see View an Element's XPath.

      For example, the Locator value might look something like this:

      xpath:/html/body/section/div/h5

    5. Repeat the steps for any other actions with a Locator value.