我正在尝试通过 PowerShell 使用 WebDriver DLL。我每次都收到以下异常:
format-default : The following exception occurred while retrieving members: "Could not load file or
assembly 'WebDriver, Version=2.48.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
The system cannot find the file specified."
+ CategoryInfo : NotSpecified: (:) [format-default], ExtendedTypeSystemException
+ FullyQualifiedErrorId : CatchFromBaseGetMembers,Microsoft.PowerShell.Commands.FormatDefaultCommand
这是我的代码:
[Reflection.Assembly]::LoadFile("X:\WebDriver.dll")
[Reflection.Assembly]::LoadFile("X:\Winium.WebDriver.dll")
[Reflection.Assembly]::LoadFile("X:\Elements.Desktop.dll")
[Reflection.Assembly]::LoadFile("X:\Winium.Cruciatus.dll")
$options = [OpenQA.Selenium.Winium.DesktopOptions]::new()
$options
这是我的输出:
GAC Version Location
--- ------- --------
False v4.0.30319 X:\WebDriver.dll
False v4.0.30319 X:\Winium.WebDriver.dll
False v4.0.30319 X:\Winium.Elements.Desktop.dll
False v4.0.30319 X:\Winium.Cruciatus.dll
format-default : The following exception occurred while retrieving members: "Could not load file or
assembly 'WebDriver, Version=2.48.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
The system cannot find the file specified."
+ CategoryInfo : NotSpecified: (:) [format-default], ExtendedTypeSystemException
+ FullyQualifiedErrorId : CatchFromBaseGetMembers,Microsoft.PowerShell.Commands.FormatDefaultCommand
我不确定这里有什么问题。有人可以帮我吗?