Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    JasonTurnbull25
    @JasonTurnbull25
    I see the waits in there now :)
    Oleg Zudov
    @ToCSharp
    Must be added to IWebDriver
    JasonTurnbull25
    @JasonTurnbull25
    I understand. I find what you've done so far to be super useful. It's the only way I've found that I can access the chrome devtools api in realtime while driving chrome. Can't do it with selenium because of the connection limit on the devtools api.
    Oleg Zudov
    @ToCSharp
    Yes, Chrome accept only one connection. Firefox have no such a problem. I have some research of using Firefox devtools, but left it for a while.
    Do you think it will be useful to add Firefox devtools?
    JasonTurnbull25
    @JasonTurnbull25
    Yeah, I'd love to be able to use firefox but I'm playing with google's speech API so I'm stuck using chrome. At least your webdriver and chromedriver allow me to receive console messages in real-time from chrome.
    How do you accomplish that by the way? I can get console messages in realtime while using your version of webdriver and chromedriver but I can't in seleniums version of webdriver and chromedriver....why does yours work?
    Oleg Zudov
    @ToCSharp
    I use one connection for webdriver and devtools
    I do not use chromedriver
    But using my asyncChromeDriver you cannot open Chrome devtools because of one connection limit
    JasonTurnbull25
    @JasonTurnbull25
    Yeah, that's what I figured. I was going to use a proxy system so I could listen in to the devtools communications. You say I can't use the async version I can't use devtools? Maybe I'm missing something but isn't that what I'm using? I showed you the way I'm creating my headless version of chrome, and I'm using AsyncChromeDriver. I'm able to use devtools and receive console messages.
    Oleg Zudov
    @ToCSharp
    So, when I need find locator of element while debugging I use Firefox
    I mean you cannot open Chrome developer tools in opened Chrome while using AsyncChromeDriver
    JasonTurnbull25
    @JasonTurnbull25
    I see. Yes, opening a devtools session in the browser is not going to work. Luckily I'm only interested in getting the information I need in the codebehind, not the browser itself.
    Oleg Zudov
    @ToCSharp
    In Chrome all interacts through DevTools connection. Selenium connects to chromedriver.exe, which connects to Chrome DevTools
    JasonTurnbull25
    @JasonTurnbull25
    And selenium/webdriver/chromedriver have no way to access devtools sessions the way yours does, as far as I can tell.
    Oleg Zudov
    @ToCSharp
    Maybe it possible through scripts, I cannot say now
    IJavaScriptExecutor
    JasonTurnbull25
    @JasonTurnbull25
    I'm an amateur. I have no idea how I'd go about using IJavaScriptExecutor in selenium to access devtools. But I'm sure it's possible. Is there any way to pass command line arguments to the headless chromebrowser? A ChromeOptions or some other method?
    Oleg Zudov
    @ToCSharp
    Sorry, it's late in my country. Tomorrow
    JasonTurnbull25
    @JasonTurnbull25
    Sorry, Goodnight Oleg. Thanks for the help.
    JasonTurnbull25
    @JasonTurnbull25
    I know you're busy, but if you get a chance, I have two features I would like to be able to use. I'd like to be able to choose the executable that your software uses. Basically pick my own chrome.exe and path. The other is the ability to pass standard command line arguments to the chrome executable. If you happen to get these options in at some point, please let me know :)
    Oleg Zudov
    @ToCSharp
    Path to chrome.exe in static property ChromeProfilesWorker.ChromeBinaryFileName https://github.com/ToCSharp/AsyncChromeDriver/blob/862d692960532895670074d8b915529474b4f37b/AsyncChromeDriver/ChromeProfilesWorker.cs#L21 . You may change it
    Oleg Zudov
    @ToCSharp
    Please try new ChromeDriverConfig().SetCommandLineArgumets("...")
    It adds args to other port, userdir, headless and so on
    JasonTurnbull25
    @JasonTurnbull25
    Thanks Oleg, I'll try soon and let you know how they work :)
    JasonTurnbull25
    @JasonTurnbull25
    Everything works. One little thing though. When I use --user-data-dir to specify a profile it get's overridden by one that seems to be hardcoded. Looks like it may be getting set wherever you're setting --remote-debugging-port=11752 and it looks like this:--user-data-dir="C:\Users\Work\AppData\Local\Temp\henqnzur.1jw" --bwsi
    JasonTurnbull25
    @JasonTurnbull25
    Sorry, I think I may have found that under profileworker, lol. My mistake.
    JasonTurnbull25
    @JasonTurnbull25
    Actually, I'm still having trouble setting it. If you have an example of using the profileWorker to change binary path and user-data directory that would be great.
    new ChromeDriverConfig { UserDir ="..", Headless = true, IsTempProfile = false, WindowSize = new WebSize(800, 600) }
    set IsTempProfile = false, if true it delete dir when closing Chrome
    Set ChromeProfilesWorker.ChromeBinaryFileName before opening Chrome. Must work
    I'll check ChromeProfilesWorker.ChromeBinaryFileName later
    JasonTurnbull25
    @JasonTurnbull25
    Thank you again Oleg. I appreciate the help.
    Oleg Zudov
    @ToCSharp
    Big architecture change committed today.
    IAsyncWebBrowserClient moved to its own repository https://github.com/ToCSharp/IAsyncWebBrowserClient.
    It is center point of my webbrowser projects.
    Please, take a look. I value your opinion.
    Update the nuget packages.
    Write here any problems
    Oleg Zudov
    @ToCSharp
    Hello. I have made SeleniumAdapter.
    Now we can run Unit Tests from Selenuim through SeleniumAdapter -> SyncWebDriver -> AsyncWebDriver -> AsyncChromeDriver
    Oleg Zudov
    @ToCSharp
    You may see what is not implemented. For me it's enough now. I will implement features if you ask. Write here
    Oleg Zudov
    @ToCSharp
    Firefox 56 supports headless mode:
     asyncFirefoxDriver = new AsyncFirefoxDriver(new FirefoxDriverConfig().SetHeadless().SetWindowSize(1200, 900));
     webDriver = new WebDriver(asyncFirefoxDriver);
     await webDriver.GoToUrl("https://www.bing.com/");
     var screenshot = await webDriver.GetScreenshot();
     using (MemoryStream imageStream = new MemoryStream(screenshot.AsByteArray))
     {
         System.Drawing.Image screenshotImage = System.Drawing.Image.FromStream(imageStream);
         screenshotImage.Save(@"C:\temp\screenshot.png", System.Drawing.Imaging.ImageFormat.Png);
     }
    Oleg Zudov
    @ToCSharp
    Working on asyncFirefoxDriver.OpenBrowserDevTools();
    We can open Firefox developer tools with some limitations:
      var profileName = tbOpenProfileName.Text;
      asyncFirefoxDriver = new AsyncFirefoxDriver(
          new FirefoxDriverConfig()
          .SetProfileName(profileName)
          .SetIsMultiprocessFalse()
          .SetDoSetDebuggerRemoteEnabled());
      webDriver = new WebDriver(asyncFirefoxDriver);
      await webDriver.GoToUrl("https://www.google.com/");
      await asyncFirefoxDriver.OpenBrowserDevTools();
      // asyncFirefoxDriver.BrowserDevTools is AsyncFirefoxDriver
      devToolsWebDriver = new WebDriver(asyncFirefoxDriver.BrowserDevTools);
      //// TODO: not works SwitchTo().Frame("toolbox-iframe");  listener.js 1715
      //await devToolsWebDriver.SwitchTo().Frame("toolbox-iframe");
      //var inspectorTab = await devToolsWebDriver.FindElementById("toolbox-tab-inspector");
      //await inspectorTab.Click();
    DevTools not work in Multiprocess with content
    Then we can debug Firefox developer tools itself:
    await asyncFirefoxDriver.BrowserDevTools.OpenBrowserDevTools(9654);