Take a look at new project AsyncChromeDriverExamplesAndTests . There are examples and tests of AsyncChromeDriver usage. I invite all to extend it
JasonTurnbull25
@JasonTurnbull25
Thank you very much for fixing that. I'll check it out soon and let you know how well it works. I appreciate the help :)
JasonTurnbull25
@JasonTurnbull25
Clicking works great :) Thanks again. I may bother you again if I bump into anything else. I'm glad you're actively developing this. Having access to the dev protocol while driving chrome with selenium has been something I've wanted for a long time.
Oleg Zudov
@ToCSharp
Headless Chrome feature added and new way of configuring AsyncChromeDriver: var asyncChromeDriver = new AsyncChromeDriver(new ChromeDriverConfig().SetHeadless().SetWindowSize(width, height));
JasonTurnbull25
@JasonTurnbull25
Amazing job. I was actually looking to work with headless.
Oleg Zudov
@ToCSharp
Thank you for kind words. Note, that in Window_Closing any await will close app immediately. New thread not helps. I added asyncChromeDriver.CloseSync() if you want to close Chrome when closing app.
JasonTurnbull25
@JasonTurnbull25
Hello again. Still working with Async Chromedriver and having great success. Just wondering if you've got any plans to implement a page loaded check or wait? Unless you've already built something in and I'm missing it. I'm just looking for a way to know when the page has completely loaded or to wait until a specific element exists maybe?
So it's built into the await portion of the async driver already? That makes sense :) So you've updated the syncdriver portion only? In the asyncdriver how would you suggest I check to make sure a page is fully loaded or that an element exists before proceeding? I was trying to set timeouts using Manage but it isn't implemented. Thanks for the help Oleg. I
Oleg Zudov
@ToCSharp
Timeouts not implemented, but var res = await asyncDriver.GoToUrl("https://www.google.com/"); waits page fully loaded. And WaitForElementWithId waits for element(added today into the await portion of the async driver). Look example
JasonTurnbull25
@JasonTurnbull25
Thank you very much Oleg. I understand now. Sorry for bothering you. I'm not a great programmer, haha.
Oleg Zudov
@ToCSharp
If you click on some link or reload page and wait for id or name you must add await asyncDriver.WaitForElementWithName("q", oldElement.Id); to prevent catch element from old page
Element with the same id or name, but in old page
JasonTurnbull25
@JasonTurnbull25
Ok. Do the new features work with Remote?
Oleg Zudov
@ToCSharp
So, what do you mean by 'Remote'? Maybe I explain how AsyncChromeDriver and AsyncWebDriver works together
Oleg Zudov
@ToCSharp
If you mean namespace Zu.AsyncWebDriver.Remote, it goes from Selenium. "Remote connection to web browser". I think, I remove it in future namespace Zu.AsyncWebDriver
Oleg Zudov
@ToCSharp
If you want connect to browser on remote computer, it can be done, but not tested and I do not think it secure.
Yes, I'm basically trying to interact with web pages while using chrome devtools. So, I'm currently using your version of webdriver and chromedriver to accomplish this. I'm creating my setup using var asyncChromeDriver = new AsyncChromeDriver(new ChromeDriverConfig().SetHeadless().SetWindowSize(800, 600)); IWebDriver webDriver = new Zu.AsyncWebDriver.Remote.WebDriver(asyncChromeDriver); but I'm not seeing the new options you mentioned (waitforelementwithname, for instance) I'm probably just doing something wrong, lol. I'm sure I'll figure it out.
Oleg Zudov
@ToCSharp
Do you updated AsyncWebDriver to 1.1.6?
change IWebDriver to var or WebDriver
Sorry, I did not added it to interface
JasonTurnbull25
@JasonTurnbull25
ahh, I see. Thanks :) I knew I was doing something wrong, lol.
_
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 :)