I have followed the following steps:
Added html file in assets
Created a page in sharepoint online
In the edit mode clicked on “Embed code” webpart.
I have also changed the following security options:
Enabled the add custom script in admin panel as directed in some of the posts.
The html field security to load iframes from any domain
I am getting only one error i.e.
Blocked script execution in 'about:srcdoc' because the document's frame is sandboxed and the 'allow-scripts' permission is not set sharepoint
Thanks in advance.