Xceptance / neodymium-library

A test automation library based on common other best practice open source libraries. It adds missing functionalities but does not reinvent the wheel. Just glues stuff together nicely and adds some sprinkles.
MIT License
80 stars 11 forks source link

Allow User-Agent manipulation on (chrome) emulated devices #242

Open wurzelkuchen opened 6 months ago

wurzelkuchen commented 6 months ago

Currently if we use an emulated device profile in the chrome, we can not set a custom user agent. Setting the a user agent via the -user-agent=... browser argument flag is overwritten by the user agent of the profile.

Since we need to set user agents even for emulated devices we need a way work around this.

One way would be to NOT use the emulation profile names, but to define our own mobile device with resolution, pixel ratio and user agent. Another option would be to use the devTools protocol and send Emulation.setDeviceMetricsOverride with the specific values.