TestProject Forum

Old Google login UI on headless Chrome - user-agent override

Hello all,

I am using the recorder to create the tests and I am having a problem with login tests. We log in to our app via Google. When the recorder is used, I am presented with the new UI login page. I can target the elements and tests work perfectly with Chrome, Firefox, and headless Firefox. However, they do not work with headless Chrome, because it is using the old login UI. And tests must run in headless Chrome.

I found xpaths to target the old UI page elements, but then CAPTCHA is activated because it recognizes the automation tool.

The solution I’ve found when code is used is to override the user-agent.

I wanted to download my login test as a file, override the user-agent, and then re-upload it so it can run with the rest of my tests but was not able to (python - cant be uploaded, C# - no instructions for visual studio code, java - not familiar with it)

What are my options?

Thanks

Hi @aleksandar
You can override user agent using selenium capabilities, follow these guides:

Another option is to use a provisioning profile to start the test execution logged in.

Thank you @Amit.Lacher ! The first solution worked. I will experiment with the third one as well.

Would you be so kind to advise where can I find detailed information on how can I edit the downloaded test recording and reupload it back? And is it possible to download a batch of recorded tests because I am able to download only 1 at a time?

Thank you again,
Alex

Hi @aleksandar,
You can export and import tests in TestProject, one test at a time. As a workaround if you wish to export
or import multiple tests follow this guide:

To export:

image

To import:

image