Coder Social home page Coder Social logo

Comments (17)

whimboo avatar whimboo commented on June 15, 2024 1

As it looks like geckodriver hasn't received the new session command. Could you maybe run a tool like Wireshark to record the network requests as made by curl? It seems like that this might indeed be a network issue.

Btw. does Hotspot shield actually allow exclude local addresses so that you can still connect to eg. your router interface? Maybe try with 127.0.0.1 instead?

from geckodriver.

whimboo avatar whimboo commented on June 15, 2024

Could you please attach a trace-level log from geckodriver? Read more about reporting actionable bugs in our contribution guidelines.

from geckodriver.

whimboo avatar whimboo commented on June 15, 2024

No reply from reporter in 2 weeks. Closing issue as incomplete.

from geckodriver.

nolme avatar nolme commented on June 15, 2024

Sorry to be late. Here is the sample code :
`
namespace ConsoleApp
{
using System;
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Firefox;
using OpenQA.Selenium.Internal.Logging;
using OpenQA.Selenium.Remote;

internal class Program
{
    static void Main(string[] args)
    {
        string url = "https://www.google.fr";
        try
        {
            Log.Handlers.Add(new FileLogHandler(Environment.ExpandEnvironmentVariables(@"%TEMP%\HotspotShield.log")));
            Log.SetLevel(LogEventLevel.Trace);
            Log.SetLevel(typeof(RemoteWebDriver), LogEventLevel.Trace);
            Log.SetLevel(typeof(SeleniumManager), LogEventLevel.Trace);

            var options = new FirefoxOptions();
            options.SetPreference("webdriver.gecko.driver", @"D:\geckodriver.exe");
            options.SetLoggingPreference(LogType.Browser, LogLevel.All);
            options.SetLoggingPreference(LogType.Driver, LogLevel.All);
            options.SetLoggingPreference(LogType.Performance, LogLevel.All);

            Console.WriteLine($"Init Firefox driver.");
            using IWebDriver driver = new FirefoxDriver(options);

            Console.WriteLine($"Go to URL : {url}");
            driver.Navigate().GoToUrl(new Uri(url));
            driver.Navigate().Refresh();
        }
        catch (Exception ex)
        {
            Console.WriteLine($"ERROR : {ex}");
        }

        Console.WriteLine("Press any key to exit.");
        Console.ReadKey();
    }
}

}
`

And here are the log with the VPN opened (non working code) and closed (working code)
HotspotShield_error.log
HotspotShield_ok.log
.

from geckodriver.

whimboo avatar whimboo commented on June 15, 2024

I still don't see on which port geckodriver is running. Also please attach the trace level logs from geckodriver and not some logs from Selenium. Maybe use plain HTTP requests via curl to check the connection to geckodriver.

from geckodriver.

nolme avatar nolme commented on June 15, 2024

:/ I need a bit more help to generate logs.
Is there a way to make a .BAT to run geckodriver (using param -vv for the logs ?) and open firefox to www.google.fr ? This way we are not using C# & Selenium.

Meanwhile I made another try. I ran the program with VPN opened. It was stuck on first line. Firefox not launched.
Then I close the VPN and immediatly I got the other lines.
Gecko

from geckodriver.

whimboo avatar whimboo commented on June 15, 2024

There is always a way to create your own bat file. Just pass the right arguments to the Firefox binary.

For further investigation more logs from geckodriver would be great to have. Otherwise it's hard to figure out what's wrong.

PS: Maybe you could use a tool like Wireshark to also check if some network request is stalled waiting for a reponse that doesn't get send. But again it's hard to say.

from geckodriver.

nolme avatar nolme commented on June 15, 2024

Looks very hard to get logs :/

I tried this batch but it doesn't reproduce the problem :

start /B "" "geckodriver.exe" -vv %* >c:\Temp\gecko.log
timeout /t 5 /nobreak
"C:\Program Files\Mozilla Firefox\firefox.exe" "--marionnette" -no-remote -url "www.google.Fr"
echo Appuyez sur une touche pour fermer Geckodriver et quitter.
pause > nul
taskkill /f /im geckodriver.exe

Nobody seems to use a BAT to do this :(

from geckodriver.

whimboo avatar whimboo commented on June 15, 2024

Maybe use plain HTTP requests via curl to check the connection to geckodriver.

I would then suggest to use the above to check outside of VSCode as well. That should also give proper logs in case the problem is reproducible. Here the steps:

  1. Make sure to have curl installed
  2. Start geckodriver with the -vvv argument in a command line
  3. Run the command curl -H 'Content-Type: application/json' -d '{"capabilities": {"alwaysMatch": {}}}' http://localhost:4444/session

Run step 3 with and without your VPN enabled. The log output I'm interested should be visible in the command line where geckodriver is running.

from geckodriver.

nolme avatar nolme commented on June 15, 2024

I tried your command and get errors :
curl: (6) Could not resolve host: application
curl: (3) unmatched brace in URL position 1:
{alwaysMatch:
^

from geckodriver.

whimboo avatar whimboo commented on June 15, 2024

Looks like you accidentally removed one or more quotes. Make sure that you run exactly what I added above. application is part of a string that is passed as extra HTTP header.

from geckodriver.

nolme avatar nolme commented on June 15, 2024

Here is the code I copy / paste :
gecko3

from geckodriver.

whimboo avatar whimboo commented on June 15, 2024

Maybe your shell doesn't understand single quotes? Please try other variations.

from geckodriver.

whimboo avatar whimboo commented on June 15, 2024

Closing as incomplete because of a missing reply from the reporter, but happy to reopen if more details are provided, which demonstrate that this is an issue with geckodriver or Firefox.

from geckodriver.

nolme avatar nolme commented on June 15, 2024

I was able to run the command. :)

Batch file :

start /B "" "geckodriver.exe" -vvv %* >c:\Temp\gecko.log
timeout /t 1 /nobreak
curl -H "Content-Type: application/json" --data-binary "@request.json" http://localhost:4444/session

JSON file :

{
  "capabilities": {
    "alwaysMatch": {
      "browserName": "firefox",
      "moz:firefoxOptions": {
		"binary": "C:\\Program Files\\Mozilla Firefox\\firefox.exe",
		"log": { "level": "trace" },
		"args": ["https://www.google.fr"],
		"prefs": {
          "browser.startup.homepage": "https://www.google.fr"
        }
      }
    }
  }
}

I check all is working without the VPN :
gecko OK.log

Then I opened the VPN
gecko Error.log

I see 1 line. and in the console I have a message :
"curl: (55) Send failure: Connection was aborted"

from geckodriver.

nolme avatar nolme commented on June 15, 2024

You last suggestion was the good one.
Hotspot shield don't let access to LAN by default. I check the option and all is working now. Thanks for help :)

from geckodriver.

whimboo avatar whimboo commented on June 15, 2024

Fantastic! Good that we got it solved.

from geckodriver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.