selenium-powershell icon indicating copy to clipboard operation
selenium-powershell copied to clipboard

Incredibly slow in powershell 7

Open GeorgeBroughton opened this issue 3 years ago • 1 comments

Doing something as simple as this results in 4.3510603 seconds wait time:

Measure-Command {Write-Debug "Next"
$Element = Find-SeElement -Driver $Driver -XPath "/html/body/div/div/div/div/div/div/button"
Invoke-SeClick -Element $Element}

Whereas in PowerShell 5, it takes 0.3669819 seconds, so using powershell 7 is significantly impacting performance.

I will add, there is some mention to 7 being slower here, but it's surrounding web sessions using the invoke-restmethod command, and there's a fix for it: https://github.com/PowerShell/PowerShell/issues/12764

GeorgeBroughton avatar Jun 23 '21 07:06 GeorgeBroughton

That's quite a long time.... hmm. Out of curiosity, can you double check the type of $Element there when it comes back ($Element.GetType().FullName)?

vexx32 avatar Jun 23 '21 12:06 vexx32