Jump to content

Recommended Posts

Posted
50 minutes ago, Danp2 said:

You shouldn't need all of the Sleep calls. If you need to wait for an element to be present, better to use _WD_WaitElement.

Unsure... but there may be a command line parameter that will force Chrome to load maximized. Otherwise, use _WD_Window to maximize it once it has launched.

I also tried to include an argument for starting Chrome such as:

Func SetupChrome()
_WD_Option('Driver', 'chromedriver.exe')
_WD_Option('Port', 9515)
_WD_Option('DriverParams', '--log-path="' & @ScriptDir & '\chrome.log"' & '--start-maximized')

$sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true }}}}'
EndFunc

but that did not have any effect.

Posted

@Manu191357 You call _WD_WaitElement just like _WD_FindElement, ie --

_WD_WaitElement($sSession, $_WD_LOCATOR_ByXPath, "//a[@id='a-search-page']")

It offers additional parameters for delay, timout, and visibility. I'm pretty sure you can find some other examples if you search the forum.

Same for _WD_Window. I know @water shows how to do this in the example he recently posted.

Posted

I found a solution for starting Chrome with a maximized window (see this post):

$sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "args":["--start-maximized"] }}}}'

It works for my script.

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...