web-arena-x / webarena

Code repo for "WebArena: A Realistic Web Environment for Building Autonomous Agents"
https://webarena.dev
Apache License 2.0
676 stars 103 forks source link

Problem of devicePixelRatio is not 1.0 #19

Closed HU-xiaobai closed 10 months ago

HU-xiaobai commented 1 year ago

Hello, when I run the run.py, I meet the problem of devicePixelRatio is not 1.0 and thus the scores has no value. could you help me how to fixed the problem? I do not find any way to fix the devicePixelRatio. My system is windows 11

1692806086125
HU-xiaobai commented 1 year ago

By the way, it seems the following line with red arrow has problems, which is "env.reset". could you help me to fix the problem?

1692806365525
shuyanzhou commented 1 year ago

Seems like it is a Windows specific issue.

In the code, we have forced the device_scale_factor to be set to 1 here. However, such a setting may not work on Windows.

Can you try to set the scale to 100% to see if the problem persists? issue

animatrionix commented 11 months ago

Hi, I got the same error on Windows and fixed it by commenting out 2 lines of code:

browser_env\envs.py (line 146):

geolocation=geolocation,
# device_scale_factor=1.0,

browser_env\processors.py (line 93):

device_pixel_ratio = page.evaluate("window.devicePixelRatio").
# assert device_pixel_ratio == 1.0, "devicePixelRatio is not 1.0".

Still, a small visual transition error occurs on the website.

It's really very interesting project, thanks to the developers.