# Automating a SAP Web application

**URL:** <https://forum.robotframework.org/t/automating-a-sap-web-application/7271>\
**Category:** Robot Framework\
**Created:** [9 May 2024 02:47 UTC](https://forum.robotframework.org/t/automating-a-sap-web-application/7271 "2024-05-09T02:47:19Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![ttz-78](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/ttz-78/32/3840_2.png) [@ttz-78](https://forum.robotframework.org/u/ttz-78)\
**Post date:** [9 May 2024 02:47 UTC](https://forum.robotframework.org/t/automating-a-sap-web-application/7271/1 "2024-05-09T02:47:19Z")

</div>

Hi All,

I am automating a SAP web application. As i log into it there is an iframe which i am successfully able to switch and add credentials and move on. After few actions , I reach another page, while i am able to identify the element in the dom, Robotframe is not able to identify it.  
When i searched through the dom I see that the element is under a Iframe and then followed by multiple Tables and Tds. I try switching to that Iframe but I get an error saying not able to find that locator.

Can someone please advise how i take it forward. Any help or suggestion is highly appreciated.

---

<div class="post-metadata">

**Author:** ![Noordsestern](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/noordsestern/32/4270_2.png) [@Noordsestern](https://forum.robotframework.org/u/Noordsestern)\
**Post date:** [9 May 2024 08:01 UTC](https://forum.robotframework.org/t/automating-a-sap-web-application/7271/2 "2024-05-09T08:01:31Z")

</div>

Hi,

It depends on the library that you use. Which one are you using for accessing the web application? Like Selenium library or Browser library or something SAP specific.

If you use Browser library (which is based on Playwright) you can select iframes (see last paragraph of chapter “Finding elements”): [https://marketsquare.github.io/robotframework-browser/Browser.html#Finding%20elements](https://marketsquare.github.io/robotframework-browser/Browser.html#Finding%20elements)

Best regards,  
Markus

---

<div class="post-metadata">

**Author:** ![damies13](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/damies13/32/623_2.png) [@damies13](https://forum.robotframework.org/u/damies13)\
**Post date:** [9 May 2024 08:40 UTC](https://forum.robotframework.org/t/automating-a-sap-web-application/7271/3 "2024-05-09T08:40:41Z")

</div>

Hi Thushar,

> there is an iframe which i am successfully able to switch  
> Purely based on this I’ll guess you are using SeleniumLibrary?

Possably what you need to do is [Unselect Frame](https://robotframework.org/SeleniumLibrary/SeleniumLibrary.html#Unselect%20Frame) before trying to select the new frame, as I suspect it’s not finding the new frame within the old frame?

If you are not using SeleniumLibrary, you’ll need to find the equivalent keyword fro the library you’re using.

Dave.

---

<div class="post-metadata">

**Author:** ![ttz-78](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/ttz-78/32/3840_2.png) [@ttz-78](https://forum.robotframework.org/u/ttz-78)\
**Post date:** [9 May 2024 09:30 UTC](https://forum.robotframework.org/t/automating-a-sap-web-application/7271/4 "2024-05-09T09:30:34Z")

</div>

I tried unselecting the previous iframe and then selecting this but then i got error overall . Let me retry once more and see if that will help . But thank you so much for the option you shared.

---

<div class="post-metadata">

**Author:** ![damies13](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/damies13/32/623_2.png) [@damies13](https://forum.robotframework.org/u/damies13)\
**Post date:** [9 May 2024 09:50 UTC](https://forum.robotframework.org/t/automating-a-sap-web-application/7271/5 "2024-05-09T09:50:10Z")

</div>

`Unselect Frame` resets you back to the top level so you might have to `Unselect Frame` then select parent frame, then select sub frame and even repeat if it’s a frame soup, which it can be depending which SAP web technology your server is using.

Dave.

---

<div class="post-metadata">

**Author:** ![ttz-78](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/ttz-78/32/3840_2.png) [@ttz-78](https://forum.robotframework.org/u/ttz-78)\
**Post date:** [9 May 2024 10:24 UTC](https://forum.robotframework.org/t/automating-a-sap-web-application/7271/6 "2024-05-09T10:24:04Z")

</div>

I did as you said unselected and then reselected the parent and the following , but wen it comes to the following error again thrown at.

---

<div class="post-metadata">

**Author:** ![falcon030](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/falcon030/32/3420_2.png) [@falcon030](https://forum.robotframework.org/u/falcon030)\
**Post date:** [9 May 2024 11:38 UTC](https://forum.robotframework.org/t/automating-a-sap-web-application/7271/7 "2024-05-09T11:38:42Z")

</div>

Perhaps nested iframes?

---

<div class="post-metadata">

**Author:** ![ttz-78](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/ttz-78/32/3840_2.png) [@ttz-78](https://forum.robotframework.org/u/ttz-78)\
**Post date:** [9 May 2024 13:11 UTC](https://forum.robotframework.org/t/automating-a-sap-web-application/7271/8 "2024-05-09T13:11:25Z")

</div>

yes its nested iframes i think

---

<div class="post-metadata">

**Author:** ![damies13](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/damies13/32/623_2.png) [@damies13](https://forum.robotframework.org/u/damies13)\
**Post date:** [9 May 2024 15:28 UTC](https://forum.robotframework.org/t/automating-a-sap-web-application/7271/9 "2024-05-09T15:28:26Z")

</div>

Yes several o the SAP web technologies are famous for mixing frames and i frames and nesting them hence “frame soup”.

Unfortunately `Unselect Frame` doesn’t have a way to specify how many frame levels you unselect it just goes back to top, so if you went iframe1 \> iframeA \> iframe\_A1 and want to get to get to iframe\_A2 also under iframeA, you need to first `Unselect Frame`, then `Select Frame iframe1`, `Select Frame iframeA`, and finally `Select Frame iframeA2`

The way Browser Library handles frames with it’s \>\>\> syntax and [Set Selector Prefix](https://marketsquare.github.io/robotframework-browser/Browser.html#Set%20Selector%20Prefix) is much nicer, so depending on how deep you are into your script development and your requirements it may or may not be worth considering the switch.

Dave.

---

<div class="post-metadata">

**Author:** ![ttz-78](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/ttz-78/32/3840_2.png) [@ttz-78](https://forum.robotframework.org/u/ttz-78)\
**Post date:** [10 May 2024 02:20 UTC](https://forum.robotframework.org/t/automating-a-sap-web-application/7271/10 "2024-05-10T02:20:15Z")

</div>

First of all i am really overwhelmed with the response i am hearing from the community. I had used Robotframe sometime back, but not so extensively as now, but i really appreciate the response and suggestion from the community which is really helping me.

Dave as you suggested , looks like the element is within a frame and way under multiple tables and tr.  
That said I identified that , when I started off with automation for this SAP web application, I found there was this parent iframe which was detected, then another iframe when i trying to click the side bar.Both worked fine and helped click on elements.  
Third was to generate a report, and then click on an element to export it. It is here that the export button is not being able to be clicked.I can find the element in the dom but unfortunately not able to click.  
When I went up all the way I found one more Iframe, but this is where I have an issue. Its say element not identified.  
As you all mentioned tried unselecting the iframe , by the keyword **unselect frame** , but will it suffice for two iframe one after the another.

Kindly advice.

---

<div class="post-metadata">

**Author:** ![damies13](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/damies13/32/623_2.png) [@damies13](https://forum.robotframework.org/u/damies13)\
**Post date:** [10 May 2024 06:33 UTC](https://forum.robotframework.org/t/automating-a-sap-web-application/7271/11 "2024-05-10T06:33:21Z")

</div>

Let me give a diagram that will hopefully make it clearer

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/robotframework1/original/2X/7/7d2ef57135eb5f66246c26aadbb9aa16c203de4e.png)

- When you first load the page you are in the \_top context (no frame selected yet)

- To click an item on the menu you would select the menu frame (f\_menu), then you `Click Link Link 1`, so far nice and easy

- the menu item Link 1 caused a new form to load in the content frame (f\_content), now you want to fill in fields 1-3

- now you want to fill in filed 1.3 and 1.6

- now you want to fill in filed 7.2 and 7.3

- now you want to fill in filed 8.1 and 8.2

Hopefully that make it clearer,

Dave.

---

<div class="post-metadata">

**Author:** ![ttz-78](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/ttz-78/32/3840_2.png) [@ttz-78](https://forum.robotframework.org/u/ttz-78)\
**Post date:** [10 May 2024 07:12 UTC](https://forum.robotframework.org/t/automating-a-sap-web-application/7271/12 "2024-05-10T07:12:45Z")

</div>

Thank you all for the advice and support. As mentioned by all of you i tried and i could fix the issue.
