Headless execution

Hi
When running the test in Headless execution, Katalont doesn’t find the fields and returns the error: “WebElementNotFoundException” But the same test works perfectly in chrome or firefox
Can you help me? please

Ok, So the ejecution mode like next image don’t work? https://prnt.sc/fe7fiq

And I have to wait for version 59 of chrome

Hi there,

Not really, it depends on how headless execution detect an element, and it’s not similar to Chrome or Firefox.

Hi there,

Headless execution is very different from Chrome and Firefox execution. I suppose you can wait until Chrome 59 deliver headless mode and try on that: https://developers.google.com/web/updates/2017/04/headless-chrome

The default window-size of headless is 800x600, so the element might be out of the visible area. So you can change the window size of headless browser to solve the problem

1 Like

Andy Zhang said:

The default window-size of headless is 800x600, so the element might be out of the visible area. So you can change the window size of headless browser to solve the problem

how do I change the size of the window?

Andy Zhang said:

The default window-size of headless is 800x600, so the element might be out of the visible area. So you can change the window size of headless browser to solve the problem

I tried changing the size in the following ways:

  1. adding window-size to headless chrome in project setting

  2. adding a customized browser based on Chrome, with params {“CHROME_DRIVER”: {“args”: ["- headless", “- window-size = 1920,1280”]}}

  3. WebUI.SetViewPortSize

all three ways have the same result: webElementNotFoundException …

I look for the element by xpath like this: // * [@ name = ‘USERNAME’]

obviously using the broser normally, the element is found perfectly. But with headless it is impossible

3 Likes

Same problem here, please help

3 Likes

Any updates on this? Can we have headless execution?

Eric Constantineau said:

Same problem here, please help

Possivelmente a aplicação entra em modo responsivo e seus elementos são alterados.
tente executar o comando: Maximize window - ou gravar os passos em modo responsivo.

1 Like

I had the same problem until I set the window size for headless and now it runs fine. If you want to experiment before you change the size take a screenshot and see if you can see the object.