Jump to content

Run the Website using Microsoft edge browser


Recommended Posts

i removed the 2nd one, but when i am running the script , background in Command shell so many scripts are running until i am not manually closing the Command shell..not sure why it is running behind the browser..any idea.

Link to post
Share on other sites

This is my script now, any changes in order or anything need to add.

 

#include "wd_core.au3"
#include "wd_helper.au3"


Local $sDesiredCapabilities, $sSession, $sElement

SetupEdge()
_WD_Startup()
$sSession = _WD_CreateSession($sDesiredCapabilities)
_WD_Navigate($sSession, "https://www.google.com")

Func SetupEdge()
_WD_Option('Driver', 'msedgedriver.exe')
_WD_Option('Port', 9515)
_WD_Option('DriverParams', '--verbose')

$sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"ms:edgeOptions": {"binary": "' & StringReplace (@ProgramFilesDir, "\", "/") & '/Microsoft/Edge/Application/msedge.exe", "excludeSwitches": [ "enable-automation"], "useAutomationExtension": false}}}}'
EndFunc

Link to post
Share on other sites

@MRAJ I'm not sure that I understand your concern. Does the script run successfully for you? Why are you so focused on the webdriver console? I explained above how you can hide it if it bothers you so much.

When exiting your script, you should be cleaning up with something like this --

_WD_DeleteSession($sSession)
_WD_Shutdown()

That will close the browser session and remove the webdriver console.

Link to post
Share on other sites

Thanks script is running and opening the browser

Sorry i didnt see your old post.. now i configured the script as below to hide the Webdriver console using _WD_ConsoleVisible(), but still console is running behind and closing after the browser shut down.

Is there any way to hide the console. 

 

 

#include "wd_core.au3"
#include "wd_helper.au3"


Local $sDesiredCapabilities, $sSession, $sElement
_WD_ConsoleVisible()
SetupEdge()
_WD_Startup()
$sSession = _WD_CreateSession($sDesiredCapabilities)
_WD_Navigate($sSession, "https://www.google.com")

Func SetupEdge()
_WD_Option('Driver', 'msedgedriver.exe')
_WD_Option('Port', 9515)
_WD_Option('DriverParams', '--verbose')

$sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"ms:edgeOptions": {"binary": "' & StringReplace (@ProgramFilesDir, "\", "/") & '/Microsoft/Edge/Application/msedge.exe", "excludeSwitches": [ "enable-automation"], "useAutomationExtension": false}}}}'

EndFunc

_WD_DeleteSession($sSession)
_WD_Shutdown()

Link to post
Share on other sites

You need to put _WD_ConsoleVisible() after _WD_Startup()

On the side note, please use this tool, when you post code.

Do not mix func code with main code, put all you main code BEFORE the functions.

Link to post
Share on other sites
#include "wd_core.au3"
#include "wd_helper.au3"


Local $sDesiredCapabilities, $sSession, $sElement

SetupEdge()
_WD_Startup()
Sleep(2000)
_WD_ConsoleVisible()
$sSession = _WD_CreateSession($sDesiredCapabilities)
_WD_Navigate($sSession, "https://www.google.com")

Func SetupEdge()

_WD_Option('Driver', 'msedgedriver.exe')
_WD_Option('Port', 9515)
_WD_Option('DriverParams', '--verbose')

$sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"ms:edgeOptions": {"binary": "' & StringReplace (@ProgramFilesDir, "\", "/") & '/Microsoft/Edge/Application/msedge.exe", "excludeSwitches": [ "enable-automation"], "useAutomationExtension": false}}}}'

EndFunc

_WD_DeleteSession($sSession)
_WD_Shutdown()

I tried the above script and changed Sleep(2000), still first Console is opening and wait for 2 seconds then browser is opening.

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...