Skip to Content
Technical Articles
Author's profile photo Walter Kretschmer

SOP stops CBTA

If you work in a S/4 HANA implementation project, it is very likely that you come across an architecture where you have a frontend server consisting of the FIORI applications and one or more backend servers.

In such architectures the FIORI Frontend Server (FES) is either deployed on premise as a Hub or within the SAP Cloud. Let us assume you have an architecture like SAP FIORI FES as Hub. You could either face just one backend server, e.g. S/4 HANA or different ones for different applications (S/4 HANA, CRM, CAR, etc.).

Image: SAP FIORI deployment options


Now, you want to automate some test cases with SAP CBTA. As the users will always login to the FIORI FES starting the Launchpad and from there either use a dedicated FIORI application or a transaction rendered in the current FIORI theme you want to start your recording there. In case of a FIORI application you will not encounter any surprises.

This will be different for a transaction rendered in the FIORI theme.

You do the recording with CBTA on any supported browser and it will be successful, and you get a test script generated. Next you will try to execute it to assure that it is doing what it should do. You may have already created a data container and a test configuration. – But to your surprise you will get error messages during execution. You will notice that after leaving the FIORI Launchpad no further UI objects get recognized.

Something must be wrong with the recorded URIs for the objects!

You start the object spy and want to spy the first UI object which was not recognized. To your second surprise the object is not recognized by the spy. It does not reveal any object properties! You will get some error message. The content of the error message will depend on your CBTA version and should be more precise and understandable from version onwards.

Image: Only the top of the Page is recognized, no object (e.g. More) in the Frame below


In order to understand the cause of the symptoms we need to know the following terms or policies.

Same Origin Policy

The same-origin policy (SOP) restricts which network messages one origin can send to another. An origin is defined by the scheme, host, and port of a URL. This is a security policy and prevents client scripts (e.g. JavaScript) to load content from an origin that differs from the visited web site.

Cross Origin Resource Sharing

The term Cross Origin Resource Sharing (CORS) was introduced by W3C as a recommendation to provide a mechanism to bypass the SOP. User agents which allow cross-origin requests typically include an http authentication and cookies. In this recommendation 3 further techniques are specified.

    • An Access-Control-Allow-Origin header can be included in the response with the origin that is allowed to send such a request
    • User agents can use a preflight request to figure out if the server would accept such a request
    • Server-side applications can discover an Origin in the header of the request to decide if they want to respond

Next, we need to understand CBTA in more detail.

The CBTA recorder and the CBTA execution and object spy use different technologies to interact with Frames in a Web Page! The CBTA recorder is built on top of browser extensions whether the CBTA execution and object spy are using JavaScript. – This means a recording can pass but the execution of the generated script can fail!

We did try to implement the Access-Control-Allow-Origin technique on the S/4 HANA backend server, but it was not successful.

Therefore, your only solution depends on the Browser which you are using.

MS Internet Explorer

In case you want to record and execute CBTA scripts with Internet Explorer you can use the compatibility mode of the object spy to activate an older implementation version (SAP Note: 2727630). This version will recognize the objects and with manual adjustments of the generated script you can execute it successful. Unfortunately, the performance of that object spy version is very poor.

Other Browsers

In case you want to or have to use other browsers you will have to use executables directly on the backend server. This way you can still test the functionality, but you will not be able to spot any rendering issues with the test script which the user may face, and you will not be able to identify any communication issues between the frontend and the backend server.

If you are not happy with the above restrictions, you will have to choose a different test automation tool than CBTA. Micro Focus UFT for example has no issues with such architectures! You can create with UFT a test script through standard recording and you will notice that in your script such Frames will be identified!

In case of descriptive programming you have to add the Frame object to your object hierarchy.

Browser("Enter Vendor Invoice:").Page("Enter Vendor Invoice:").Frame("Frame").WebEdit("Company Code").Set "PT09"
Browser("Enter Vendor Invoice:").Page("Enter Vendor Invoice:").Frame("Frame").WebButton("M1:50::btn[0]").Click





Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Ajay Hoskote Somashekar
      Ajay Hoskote Somashekar



      Thanks for the details, I have automated FIORI applications using CBTA and I did not encounter any such issues. also are you creating CBTA scripts in SAP Solution Manager system against the Application system ?

      We have automated close to 50 e2e Fiori business process using CBTA and there was no issue as such.

      Would like to understand at wht circumstance you get this error.



      Author's profile photo Shyamal Kumar
      Shyamal Kumar

      Hi Ajay,

      I am trying to automate using CBTA the FIORI – ME21N or MIGO. getting the below error, Control id is not found when Navigate to ME21N ot MIGO ( Create Purchase Order / Post Goods Movement )

      I tried with all different CBTA component like set focus, check property etc. but no luck, Attaching the Document as well . The document is related to MIGO.




        Operation Failed


      Targeted Control Uri:
      label=Standard PO; frameId=application-PurchaseOrder-create; ls.type=CB; tag=INPUT; ls.sid=wnd[0]/usr/subSUB0:SAPLMEGUI:0013/subSUB0:SAPLMEGUI:0030/subSUB1:SAPLMEGUI:1105/cmbMEPO_TOPLINE-BSART

      Error Message:
      SearchObjectInContext – Unexpected COM Exception – System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.
      at SHDocVw.IWebBrowser2.get_Document()
      at SAP.TestAutomationDriver.MSHTML.InternetExplorerNativeDocument.<_YieldDocumentCollection>d__25.MoveNext()
      at SAP.TestAutomationDriver.Api.Player.Dom.HTMLTagCollection.FrameList.getDocumentFrames(INativeDocument document)
      at SAP.TestAutomationDriver.Api.Player.Dom.HTMLTagCollection.FrameList.Initialize(Document document)
      at SAP.TestAutomationDriver.MSHTML.InternetExplorerDocument.get_Frames()
      at SAP.TestAutomationDriver.Api.Player.Dom.Document.Frame(Constraint findBy)
      at SAP.TestAutomationDriver.Resolver.AbstractFragmentResolver.GetSubResolutionContext(Object parentObject, IResolutionContext parentContext)
      at SAP.TestAutomationDriver.Resolver.AbstractFragmentResolver.GetFrameContext(IResolutionContext currentContext, String frameTag, String frameKey, String keyIs)
      at SAP.TestAutomationDriver.Resolver.AbstractFragmentResolver.GetFrameContext(IResolutionContext currentContext, String frameTag, String frameKey, String keyIs)
      at SAP.TestAutomationDriver.Resolver.AbstractFragmentResolver.ResolveFrameContext(UriFragment uriFragment, IResolutionContext currentContext)
      at SAP.TestAutomationDriver.Wdp.WdpResolver.SearchObject(UriFragment uriFragment, IResolutionContext context, IResolutionContext& currentContext)
      at SAP.TestAutomationDriver.Api.Resolver.UriResolver.SearchObject(UriFragment uriFragment, IResolutionContext context, IResolver& selectedResolver, IResolutionContext& currentContext)
      at SAP.TestAutomationDriver.Api.Resolver.UriResolver.SearchObjectInContext(Uri uri, IResolutionContext context)

      Author's profile photo Shyamal Kumar
      Shyamal Kumar

      Hi Aj,

      When click the Post Goods Movement tile or Create Purchase Order tile. its loading the SAP HTML for GUI and page is loading. the moment page is loading CBTA_WEB_SETVALUE is looking for the value from Test data container or default value. the component is throwing an error.


      Error Message:
      SearchObjectInContext - Unexpected COM Exception - System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.



      I am not sure why this error occurs. though i maintain the stable id



      can you please suggest.  The test script is developed in Solution Manager and executing to the Fiori test system..





      Author's profile photo Ziavudeen Mohamed
      Ziavudeen Mohamed



      That was a nice article.


      Hi Ajay,

      The issue is seen especially when SAP Gui for HTML is loaded inside the Fiori Page or opening a new window. Example: Applications Like Create Sales Order and Sales Quotation.,etc. They have CORS object and they are not recognized by CBTA usually. You can find more information in SAP Note 2813552. In this case, I add any missing objects using Object Spy(--iecompmode). More information in


      Mohamed Ziavudeen