Automating a SAP Web application

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.

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

Best regards,
Markus

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 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.

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.

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.

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.

Perhaps nested iframes?

yes its nested iframes i think

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 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.

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.

Let me give a diagram that will hopefully make it clearer

  • 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

    • first you use Unselect Frame to leave the f_menu frame
    • next you Select Frame f_context
    • now you can fill in fields 1 to 3
  • now you want to fill in filed 1.3 and 1.6

    • first you Select Frame f_context_1
    • now you can fill in fields 1.3 and 1.6
  • now you want to fill in filed 7.2 and 7.3

    • first you use Unselect Frame to leave the f_context_1 frame
    • now you are back at _top
    • next you Select Frame f_context
    • then you Select Frame f_context_7
    • now you can fill in fields 7.2 and 7.3
  • now you want to fill in filed 8.1 and 8.2

    • first you use Unselect Frame to leave the f_context_7 frame
    • now you are back at _top
    • next you Select Frame f_context
    • now you can click Tab8, which will hide frame f_context_7 and show f_context_8
    • then you Select Frame f_context_8
    • now you can fill in fields 8.1 and 8.2

Hopefully that make it clearer,

Dave.

1 Like

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

1 Like