I have issue with one URL which doesn’t render properly with new page or even headless Open Browser. If I use headless=false in Open Browser the page is rendered correctly and all buttons are visible and automation works fine. For Headless =True or new page, it doesn’t work. In prod all this is running in docker container and hence I don’t have option of use open browser headless = False option.
The url is How much can be borrowed calculator | The Mortgage Works for Intermediaries
Any pointers or suggestions that I can try while setting new_context()?
Thanks in Advance
Hi @SNavgale ,
My initial thought is it might be related to viewport size?
Hope that helps,
this is the screen grab on headless:
As @damies13 has pointed out with rendering that this seems to be a possible the cause, if you was to apply a sleep while headless to confirm this for example it will render all elements as you see when not in headless.
Using a keyword as suggested would be a valid approach, I’m not a fan of sleep but this is a good way to debug/confirm.
Something I used to do, in a different language as it never had supporting keywords as we have with RF was to have an is visible method that you run before interacting with a page when breaking out your site with the page object model, this was to ensure a page has loaded, so the concept here is very much the same, you could get the longest loaded element from dev tools if you wanted to push it one step further, but using a keyword as pointed out should fix your problem.
Thanks @damies13 and @_daryl
No worries @SNavgale - hmmm also this may be because the website detects it’s a headless browser and disables some features. From what I’ve read setting a user agent as an option could fix the problem for you, at least its a place to have a look into/play around.