Selenium WebDriver works but SLOW (Java)

后端 未结 6 722
一生所求
一生所求 2020-12-09 11:48

I am using Selenium WebDriver to take a screenshot of webpages. It runs great. However, from the time I hit run in eclipse to the time the screenshot shows up in my local dr

6条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-09 12:52

    I had the same issue in Windows and the cause was related to resolving localhost. In this case there are two ways to fix it:

    • replace localhost with 127.0.0.1 (so go to urls like http://127.0.0.1). However this messes with network.automatic-ntlm-auth.trusted-uris setting when testing against web application using NTLM authentication, as it requires a hostname, not an IP address

    • change hosts (e.g. C:\Windows\System32\drivers\etc) to directly solve localhost to 127.0.0.1:

      # localhost name resolution is handled within DNS itself.
      127.0.0.1       localhost
      #   ::1             localhost
      

提交回复
热议问题