Jump to content

Recommended Posts

Posted (edited)

@rlvitorino Starting  from ChromeDriver version 76, disable-infobars flag was officially deprecated. I solved the problem by changing the capabilities as follows: 

$sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"unhandledPromptBehavior": "ignore", "goog:chromeOptions": {"w3c": true, "excludeSwitches": ["enable-automation"], "useAutomationExtension": false, "args": ["start-maximized"] }}}}'

Reference https://stackoverflow.com/questions/57298901/unable-to-hide-chrome-is-being-controlled-by-automated-software-infobar-within

Edited by CYCho
Posted (edited)
Func _jsEval($jsFile, $jsFun)
    Local $Ret = ""
    Local $jss = FileRead($jsFile)
    Local $mss = ObjCreate("MSScriptControl.ScriptControl")
    With $mss
        .language = "JavaScript"
        .addcode($jss)
        $Ret = .eval($jsFun)
    EndWith
    Return $Ret
EndFunc

As above,

by introducing the javascript script file,

That can execute the function of the script file .

_ WD_ExecuteScript what to do if want to achieve this effect?

For example, there is the following javascript file:

<script>
function switchTo(Page) {
    window.location.href="https://www.autoitscript.com/forum/topic/192730-webdriver-udf-help-support/page/" + Page + "/";
}
</script>

how do I introduce the script function and execute it?

Edited by Letraindusoir
Posted (edited)

Has anyone come up with proper wordings of $sDesiredCapabilities to disable "save password" bubble? I tried "prefs": ["credentials_enable_service": false], but chromedriver would not start with this option included.

Solved - prefs option takes a dictionary type, so curly braces should be used to enclose the parameters: "prefs": {"credentials_enable_service": false}

Edited by CYCho
Posted
16 hours ago, Danp2 said:

I can't imagine that it would be too difficult to write a generic function that accepts an additional parameter to indicate the script that needs to be injected.

If it is not possible, the mixed use of "MSScriptControl.ScriptControl" estimates can also achieve the goal.

 

Posted

Hi,

I'm in desperate need of help for handling Windows Authentication in Chome using chromedriver

(version 76 should have the issues fixed: ChromeDriver 76.0.3809.12

Supports Chrome version 76
  • Finished implementation of Actions API

)

Has anyone got this working already with the new version? Any help will be appreciated.

Posted

Hi @Danp2,

Not sure how I should use this example for the Windows authentication. I can't use 'elements', as this is a pop-up window, not being 'elemented' through HTML.
It's the browsers-own credentials window.

Hope you can still hand me a clue in the right direction.

Thanks.

 

Posted

In the process of using webdriver to manipulate the web page,

two small problems are found:

1, when the page or browser in operation is closed for some reason,

    the code is still executing and does not automatically terminate with the loss of focus or target.

2. When the code execution is terminated for unexpected reasons,

   the error warning pop-up window appears when the browser is opened again (warning closed improperly).

   How do I automatically close this pop-up window?

Guest
This topic is now closed to further replies.
×
×
  • Create New...