Danp2 Posted July 11, 2023 Author Share Posted July 11, 2023 @mLipok It's difficult to say for sure without additional details (ie: which specific webdriver commands were being executed at the time the app hung). Have you looked into running the GUI as a separate process so that it maintains its responsiveness? Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Fred93 Posted July 11, 2023 Share Posted July 11, 2023 hello guys, Thx Danp2 for your answer. I succeeded to connect to an existing Firefox. First, i launched it with WebDriver with this code : _WD_Option('Driver', $geckodriverPath) _WD_Option('Port', 4444) _WD_Option('DriverParams', '--log trace --marionette-port 2828') WD_Startup() $w_Session = _WD_CreateSession($FFCapabilities) _WD_Navigate($w_Session, "www.google.com") //i do some things _WD_Shutdown() then i can launch another webdriver script with _WD_Option('Driver', $geckodriverPath) _WD_Option('Port', 4444) _WD_Option('DriverParams', '--log trace --marionette-port 2828 --connect-existing') WD_Startup() Local $WD_SESSION = _WD_CreateSession(Default) //i do some things again on the same previously launched firefox instance and i'm happy _WD_Shutdown() an i can interact with the previously launched firefox windows. Everything is good. but, then, i need to launch another instance of firefox without closing or "overwrite" the previously launched instance with -- marionnette-port 2828. So i launch another webdriver function with _WD_Option('Driver', $geckodriverPath) _WD_Option('Port', 4444) WD_Startup() $w_Session = _WD_CreateSession($FFCapabilities) _WD_Navigate($w_Session, "www.qwant.com") _WD_Shutdown() but it seems to use the same firefox instance and instead of finally have 2 firefox open, i only have one. usually, when i launch the code above, i have several firefox windows, but when i use --marionnette-port, it is like i'm stuck with an instance... i surely missed something...but not pretty confident with WebDriver to say what... Link to comment Share on other sites More sharing options...
Danp2 Posted July 11, 2023 Author Share Posted July 11, 2023 @Fred93 There are some settings that you need to change in order to launch multiple instances of the webdriver / browser. I suggest that you review this prior thread. Fred93 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
n3wbie Posted July 13, 2023 Share Posted July 13, 2023 Can somebody please guide me to the usage of _WD_CDPExecuteCommand functions _WD_CDPExecuteCommand($sSession, "Network.setBlockedURLs", '{"url":["google.com","facebook.com"]') want to block a particular url. This is possible through cdp . But i m getting error. It would be great if someone can help me out with the same Link to comment Share on other sites More sharing options...
Danp2 Posted July 13, 2023 Author Share Posted July 13, 2023 @n3wbie double check your brackets (looks like you are missing a closing }). If that isn't the issue, then provide more details on the error you received. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
n3wbie Posted July 13, 2023 Share Posted July 13, 2023 (edited) 7 minutes ago, Danp2 said: @n3wbie double check your brackets (looks like you are missing a closing }). If that isn't the issue, then provide more details on the error you received. That isnt the error i changed url so typos actual error _WD_ExecuteCDPCommand: {"value":{"error":"invalid argument","message":"invalid argument: params not passed\n (Session info: chrome=109.0.5414.120)","stacktrace":"Backtrace:\n\t(No symbol) [0x01546643]\n\t(No symbol) [0x014DBE21]\n\t(No symbol) [0x013DDA9D]\n\t(No symbol) [0x01451496]\n\t(No symbol) [0x0142FD7C]\n\t(No symbol) [0x01446B09]\n\t(No symbol) [0x0142FB76]\n\t(No symbol) [0x014049C1]\n\t(No symbol) [0x01405E5D]\n\tGetHandleVerifier [0x017BA142+2497106]\n\tGetHandleVerifier [0x017E85D3+2686691]\n\tGetHandleVerifier [0x017EBB9C+2700460]\n\tGetHandleVerifier [0x015F3B10+635936]\n\t(No symbol) [0x014E4A1F]\n\t(No symbol) [0x014EA418]\n\t(No symbol) [0x014EA505]\n\t(No symbol) [0x014F508B]\n\tBaseThreadInitThunk [0x766133AA+18]\n\tRtlInitializeExceptionChain [0x77C29F72+99]\n\tRtlInitializeExceptionChain [0x77C29F45+54]\n"}} https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-setBlockedURLs this is what i want to achieve Edited July 13, 2023 by n3wbie Link to comment Share on other sites More sharing options...
Danp2 Posted July 13, 2023 Author Share Posted July 13, 2023 @n3wbie The $oParams parameter needs to be an object. You probably need to do something like this -- Local $aURLs = ["google.com", "facebook.com"] Local $oParams = Json_ObjCreate() Json_ObjPut($oParams, 'urls', $aURLs) _WD_CDPExecuteCommand($sSession, "Network.setBlockedURLs", $oParams) n3wbie 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
n3wbie Posted July 14, 2023 Share Posted July 14, 2023 16 hours ago, Danp2 said: @n3wbie The $oParams parameter needs to be an object. You probably need to do something like this -- Local $aURLs = ["google.com", "facebook.com"] Local $oParams = Json_ObjCreate() Json_ObjPut($oParams, 'urls', $aURLs) _WD_CDPExecuteCommand($sSession, "Network.setBlockedURLs", $oParams) Thanks .Its Working. Link to comment Share on other sites More sharing options...
DoVinhTrung Posted July 16, 2023 Share Posted July 16, 2023 this is ok With Element, how to focus on i use _WD_SetElementValue($sSession, $sElement, $sValue, $iStyle = Default) can set but not submit this is not ok Link to comment Share on other sites More sharing options...
Danp2 Posted July 16, 2023 Author Share Posted July 16, 2023 @DoVinhTrung It would probably help if you could post a short reproducer because I'm not sure that I understand the issue. Are you simply wanting to update the value of this element? Have you tried using the $_WD_OPTION_Advanced style? Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
DoVinhTrung Posted July 16, 2023 Share Posted July 16, 2023 31 minutes ago, Danp2 said: @DoVinhTrung It would probably help if you could post a short reproducer because I'm not sure that I understand the issue. Are you simply wanting to update the value of this element? Have you tried using the $_WD_OPTION_Advanced style? i try with _WD_SetElementValue($sSession, _WD_FindElement($sSession, $_WD_LOCATOR_ByCSSSelector, ".font-weight-bold"), '100', $_WD_OPTION_Advanced) but not update, only show value Link to comment Share on other sites More sharing options...
Danp2 Posted July 16, 2023 Author Share Posted July 16, 2023 @DoVinhTrung Clearly there is more to this web control than the input element that you've shown us. We can't help further without more context, such as -- URL for this or another website using this same web control Framework or library (ie: jQuery, Angular, etc) being used Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
DoVinhTrung Posted July 16, 2023 Share Posted July 16, 2023 8 hours ago, Danp2 said: @DoVinhTrung Clearly there is more to this web control than the input element that you've shown us. We can't help further without more context, such as -- URL for this or another website using this same web control Framework or library (ie: jQuery, Angular, etc) being used Here The Internet (the-internet.herokuapp.com) andThe Internet (the-internet.herokuapp.com) Link to comment Share on other sites More sharing options...
Danp2 Posted July 17, 2023 Author Share Posted July 17, 2023 @DoVinhTrung Sorry, but those pages don't contain any elements like in the picture you posted. 🤔 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
DoVinhTrung Posted July 17, 2023 Share Posted July 17, 2023 (edited) 9 hours ago, Danp2 said: @DoVinhTrung Sorry, but those pages don't contain any elements like in the picture you posted. 🤔 https://79king4.com/Lobby/Navigation?url=%2FAccount%2FLoginToSupplier%3FsupplierType%3D14%26gId%3D4856%26cId%3D1 this is web and id,password,pls don't banned Edited July 17, 2023 by DoVinhTrung Link to comment Share on other sites More sharing options...
Fred93 Posted July 17, 2023 Share Posted July 17, 2023 On 7/11/2023 at 4:07 PM, Danp2 said: @Fred93 There are some settings that you need to change in order to launch multiple instances of the webdriver / browser. I suggest that you review this prior thread. thx for your answer Sadly, i didn't manage to make it works. to explain my issue, i made little script in order to simulate what i'm doing on my main. 4 buttons, 2 with a "classic" launch (at least as i understand it...) and 2 with the "existing window" mode. if i keep pressing on the 2 first, everything is ok. If i press on "existing window" one, it seems to "brake" even how the 2 first one works. In my mind (and what i tried to achieve), i completely set up WD before every launch and i kill it after. But i'm clearly wrong. testWD.au3 Link to comment Share on other sites More sharing options...
Danp2 Posted July 17, 2023 Author Share Posted July 17, 2023 @DoVinhTrung FWIW, that site appears to use Angular. I won't be assisting further with this because it likely goes against this forum's rules. Hope you are able to change your password before someone logs in and takes everything from you. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
DoVinhTrung Posted July 17, 2023 Share Posted July 17, 2023 15 minutes ago, Danp2 said: @DoVinhTrung FWIW, that site appears to use Angular. I won't be assisting further with this because it likely goes against this forum's rules. Hope you are able to change your password before someone logs in and takes everything from you. can told me how to search word can run with my wweb run Link to comment Share on other sites More sharing options...
Danp2 Posted July 17, 2023 Author Share Posted July 17, 2023 @DoVinhTrung I don't understand what you are asking, but the answer would be "no" if it has anything to do with that website. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Danp2 Posted July 17, 2023 Author Share Posted July 17, 2023 @Fred93 Add the following line near the top of launch_NormalMode -- _WD_Option('DriverParams', '--log trace --marionette-port 2828') Then modify that same line in launch_ExistingWindow by adding "--connect-existing" -- _WD_Option('DriverParams', '--log trace --marionette-port 2828 --connect-existing') Now retest. 😉 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Recommended Posts