Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to run scripts #2

Open
lisamariet opened this issue Jan 27, 2015 · 10 comments
Open

Fails to run scripts #2

lisamariet opened this issue Jan 27, 2015 · 10 comments

Comments

@lisamariet
Copy link

I believe the problem might be that we have specified an output path that is not a subfolder of the project. Well it is a guess anyway. This is the error I am getting:

You cannot call a method on a null-valued expression.
At C:\Source\Reward\trunk\Se.Web\packages\Selenium.WebDriver.ChromeDriver.2.10.0.0\tools\init.ps1:53 char:32

  •     $contentFolder.copyhere <<<< ($_.Path)
    
    • CategoryInfo : InvalidOperation: (copyhere:String) [], RuntimeException
    • FullyQualifiedErrorId : InvokeMethodOnNull

You cannot call a method on a null-valued expression.
At C:\Source\Reward\trunk\Se.Web\packages\Selenium.WebDriver.ChromeDriver.2.13.0.0\tools\init.ps1:53 char:32

  •     $contentFolder.copyhere <<<< ($_.Path)
    
    • CategoryInfo : InvalidOperation: (copyhere:String) [], RuntimeException
    • FullyQualifiedErrorId : InvokeMethodOnNull

You cannot call a method on a null-valued expression.
At C:\Source\Reward\trunk\Se.Web\packages\Selenium.WebDriver.IEDriver.2.44.0.0\tools\init.ps1:54 char:32

  •     $contentFolder.copyhere <<<< ($_.Path)
    
    • CategoryInfo : InvalidOperation: (copyhere:String) [], RuntimeException
    • FullyQualifiedErrorId : InvokeMethodOnNull

It is the same for ChromeDriver so I posted that also.

@jsakamoto
Copy link
Owner

Thank you for your report.

I'll inspect for what is wrong.

Please give me some time to resolve this issue.

@lisamariet
Copy link
Author

The issue seems to be fixed with the latest version. But I can still not use Chrome of IEDrivers... the .exe files is not part of the package?Reading the install.ps1 files it seems like the driver is to be downloaded... but when I try to run project using IEdriver i am getting:

SpecsFor.Mvc.DriverNotFoundException : The configured web driver could not be initialized because the driver executable was not found in 'C:\Source[PATH]\Debug\Tests\Web.AcceptanceTest'. Make sure the driver is copied to the output directory of your spec project, or install the driver in a location, and add that location to your PATH environment variable.
----> OpenQA.Selenium.DriverServiceNotFoundException : The IEDriverServer.exe file does not exist in the current directory or in a directory on the PATH environment variable. The driver can be downloaded at http://selenium-release.storage.googleapis.com/index.html.

So, how is this suppose to work? What am I missing?

@jsakamoto
Copy link
Owner

Could you let me show your project files and source codes? (except packages, bin, obj folder)

I'v never used SpecFor, so I guess, this issue is happen only when using SpecFor.

For example, the exception message which you reported is:

driver executable was not found in C:\Source[PATH]\ Debug\Tests\Web.AcceptanceTest

But, this NuGet package Selenium.WebDriver.IEDriver copy IEDriverServer.exe into C:\Source[PATH]\ bin\Debug (exactly, the last path is build configuration name.)

@lisamariet
Copy link
Author

The error has nothing to do with SpecsFor. I am missing the
IEDriverServer.exe file. When is it install.ps1 run?
Is it when I install the nuget package that the IEDriver will be downloaded
and copied to build configuration path?

my build output path value on testproject is:
....\build_artifacts_se_web\Debug\Tests\Web.AcceptanceTest\

When I browse to that folder the IEDriverServer.exe is NOT there. So the
exception is correct. I have searched for the fila and it is nowhere to be
found.
OpenQA.Selenium.DriverServiceNotFoundException : The IEDriverServer.exe
file does not exist in the current directory or in a directory on the PATH
environment variable. The driver can be downloaded at
http://selenium-release.storage.googleapis.com/index.html.


email: [email protected]

On 28 February 2015 at 01:29, jsakamoto [email protected] wrote:

Could you let me show your project files and source codes? (except
packages, bin, obj folder)

I'v never used SpecFor, so I guess, this issue is happen only when using
SpecFor.

For example, the exception message which you reported is:

driver executable was not found in C:\Source[PATH]
Debug\Tests\Web.AcceptanceTest

But, this NuGet package Selenium.WebDriver.IEDriver copy
IEDriverServer.exe into C:\Source[PATH]\ bin\Debug (exactly, the last
path is build configuration name.)


Reply to this email directly or view it on GitHub
#2 (comment)
.

@jsakamoto
Copy link
Owner

Okay, let's shoot trouble step by step together.

If you success installing the NuGet package, you can find IEDriverServer.exe at packages/Selenium.WebDriver.IEDriver.2.44.0/content folder.

If the driver.exe does not exist, it may be a network problem.

You can detect what happens to installing the package using "NuGet package manager console" instead of "NuGet Package Manager" GUI dialog.

If you encounter fail of installing the package by network problem, you can see the error message like below image.

...

The error message does not appear installing via GUI dialog.

The network error often causes by firewall/http proxy in organization LAN.

I recommend reading the article at below link.

https://github.com/jsakamoto/nupkg-selenium-webdriver-iedriver#how-to-configure-http-proxy--%E3%83%97%E3%83%AD%E3%82%AF%E3%82%B7%E3%81%AE%E8%A8%AD%E5%AE%9A

@lisamariet
Copy link
Author

On 3 March 2015 at 14:25, jsakamoto [email protected] wrote:

https://github.com/jsakamoto/nupkg-selenium-webdriver-iedriver#how-to-configure-http-proxy--%E3%83%97%E3%83%AD%E3%82%AF%E3%82%B7%E3%81%AE%E8%A8%AD%E5%AE%9A

Hi there,

I tried to do a reinstall... alot of errors:

PM> Update-Package -reinstall Selenium.WebDriver.IEDriver

Removing 'Selenium.WebDriver.IEDriver 2.44.0.0' from
MvcAcceptanceTestExtensions.

Exception calling "Item" with "1" argument(s): "The parameter is incorrect.
(Exception from HRESULT: 0x80070057 (E_INVALIDARG))"

At
C:\Source\Reward\trunk\Se.Web\packages\Selenium.WebDriver.IEDriver.2.44.0.0\tools\Uninstall.ps1:16
char:28

  • $project.ProjectItems.Item <<<< ($driverFile).Delete()
    
    • CategoryInfo : NotSpecified: (:) [],
      MethodInvocationException
    • FullyQualifiedErrorId : ComMethodTargetInvocation

Successfully removed 'Selenium.WebDriver.IEDriver 2.44.0.0' from
MvcAcceptanceTestExtensions.

Removing 'Selenium.WebDriver.IEDriver 2.44.0.0' from Web.AcceptanceTest.

Exception calling "Item" with "1" argument(s): "The parameter is incorrect.
(Exception from HRESULT: 0x80070057 (E_INVALIDARG))"

At
C:\Source\Reward\trunk\Se.Web\packages\Selenium.WebDriver.IEDriver.2.44.0.0\tools\Uninstall.ps1:16
char:28

  • $project.ProjectItems.Item <<<< ($driverFile).Delete()
    
    • CategoryInfo : NotSpecified: (:) [],
      MethodInvocationException
    • FullyQualifiedErrorId : ComMethodTargetInvocation

Successfully removed 'Selenium.WebDriver.IEDriver 2.44.0.0' from
Web.AcceptanceTest.

Uninstalling 'Selenium.WebDriver.IEDriver 2.44.0.0'.

Successfully uninstalled 'Selenium.WebDriver.IEDriver 2.44.0.0'.

Installing 'Selenium.WebDriver.IEDriver 2.44.0.0'.

Successfully installed 'Selenium.WebDriver.IEDriver 2.44.0.0'.

You cannot call a method on a null-valued expression.

At
C:\Source\Reward\trunk\Se.Web\packages\Selenium.WebDriver.IEDriver.2.44.0.0\tools\Init.ps1:54
char:32

  •     $contentFolder.copyhere <<<< ($_.Path)
    
    • CategoryInfo : InvalidOperation: (copyhere:String) [],
      RuntimeException
    • FullyQualifiedErrorId : InvokeMethodOnNull

Adding 'Selenium.WebDriver.IEDriver 2.44.0.0' to
MvcAcceptanceTestExtensions.

Successfully added 'Selenium.WebDriver.IEDriver 2.44.0.0' to
MvcAcceptanceTestExtensions.

Exception calling "AddFromFile" with "1" argument(s): "Cannot add the link
because the source file
'C:\Source\Reward\trunk\Se.WebBuild..\Se.Web\packages\Selenium.WebDriver.IEDriver.2.44.0.0\content\IEDriverServer.exe'
cann

ot be found."

At
C:\Source\Reward\trunk\Se.Web\packages\Selenium.WebDriver.IEDriver.2.44.0.0\tools\Install.ps1:21
char:35

  • $project.ProjectItems.AddFromFile <<<< ($driverPath)
    
    • CategoryInfo : NotSpecified: (:) [],
      MethodInvocationException
    • FullyQualifiedErrorId : ComMethodTargetInvocation

Exception calling "Item" with "1" argument(s): "The parameter is incorrect.
(Exception from HRESULT: 0x80070057 (E_INVALIDARG))"

At
C:\Source\Reward\trunk\Se.Web\packages\Selenium.WebDriver.IEDriver.2.44.0.0\tools\Install.ps1:22
char:28

  • $project.ProjectItems.Item <<<<
    

    ($driverFile).Properties.Item("CopyToOutputDirectory").Value = 2

    • CategoryInfo : NotSpecified: (:) [],
      MethodInvocationException
    • FullyQualifiedErrorId : ComMethodTargetInvocation

'Selenium.WebDriver.IEDriver 2.44.0.0' already installed.

Adding 'Selenium.WebDriver.IEDriver 2.44.0.0' to Web.AcceptanceTest.

Successfully added 'Selenium.WebDriver.IEDriver 2.44.0.0' to
Web.AcceptanceTest.

Exception calling "AddFromFile" with "1" argument(s): "Cannot add the link
because the source file
'C:\Source\Reward\trunk\Se.WebBuild..\Se.Web\packages\Selenium.WebDriver.IEDriver.2.44.0.0\content\IEDriverServer.exe'
cann

ot be found."

At
C:\Source\Reward\trunk\Se.Web\packages\Selenium.WebDriver.IEDriver.2.44.0.0\tools\Install.ps1:21
char:35

  • $project.ProjectItems.AddFromFile <<<< ($driverPath)
    
    • CategoryInfo : NotSpecified: (:) [],
      MethodInvocationException
    • FullyQualifiedErrorId : ComMethodTargetInvocation

Exception calling "Item" with "1" argument(s): "The parameter is incorrect.
(Exception from HRESULT: 0x80070057 (E_INVALIDARG))"

At
C:\Source\Reward\trunk\Se.Web\packages\Selenium.WebDriver.IEDriver.2.44.0.0\tools\Install.ps1:22
char:28

  • $project.ProjectItems.Item <<<<
    

    ($driverFile).Properties.Item("CopyToOutputDirectory").Value = 2

    • CategoryInfo : NotSpecified: (:) [],
      MethodInvocationException
    • FullyQualifiedErrorId : ComMethodTargetInvocation

The IEDriverServer.exe file is not located in Content folder... so the file
is not downloaded at install time. Cannot see any errors related to
downloading the file. But there is a error in init.ps1 script... perhaps
that is the problem?


email: [email protected]

@jsakamoto
Copy link
Owner

It is possibly failed decompressing the downloaded .zip file (IEDriverServer_Win32_2.44.0.zip).

Crush point is here: https://github.com/jsakamoto/nupkg-selenium-webdriver-iedriver/blob/master/Init.ps1#L54

But I'm not sure about there is no possibility of happening something wrong in downloading process.
(for example, there is a scenario - downloading is not correct, so .zip file is broken, then decompressing is fail...)

I'm considering that including IEDriverServer.exe into my NuGet package.
Reference: #3

if the NuGet package file included IEDriverServer.exe, then you do not encounter thease problems such as downloading and decompressing dureing NuGet package installation.

How do you see it?

@lisamariet
Copy link
Author

I would prefer it be part of the package. Not downloading at build time. Same for Chrome driver.

@jsakamoto
Copy link
Owner

I'm changing the package implementation to including driver .exe file.

I published Beta version. https://www.nuget.org/packages/Selenium.WebDriver.IEDriver/2.45.0.2-beta

Would you try to use v.2.45.0.2 Beta?

NOTICE: It is beta version, so that version is concealed normaly. You should change the filter of "NuGet Pakcage Manager" GUI dialog to "Include Prerelease", or, if you use Package manager console then append "-Pre" switch when executing Install-Package command.

I'll try to apply same changing to chrome driver package.

@lisamariet
Copy link
Author

I have installed beta. There was an error. But the .exe file was included
in package this time.

PM> update-package Selenium.WebDriver.IEDriver -Pre

Updating 'Selenium.WebDriver.IEDriver' from version '2.45.0.1' to
'2.45.0.2-beta' in project 'MvcAcceptanceTestExtensions'.

Removing 'Selenium.WebDriver.IEDriver 2.45.0.1' from
MvcAcceptanceTestExtensions.

Exception calling "Item" with "1" argument(s): "The parameter is incorrect.
(Exception from HRESULT: 0x80070057 (E_INVALIDARG))"

At
C:\Source\Reward\trunk\Se.Web\packages\Selenium.WebDriver.IEDriver.2.45.0.1\tools\Uninstall.ps1:16
char:28

  • $project.ProjectItems.Item <<<< ($driverFile).Delete()
    
    • CategoryInfo : NotSpecified: (:) [],
      MethodInvocationException
    • FullyQualifiedErrorId : ComMethodTargetInvocation

Successfully removed 'Selenium.WebDriver.IEDriver 2.45.0.1' from
MvcAcceptanceTestExtensions.

Adding 'Selenium.WebDriver.IEDriver 2.45.0.2-beta' to
MvcAcceptanceTestExtensions.

Installing 'Selenium.WebDriver.IEDriver 2.45.0.2-beta'.

Successfully installed 'Selenium.WebDriver.IEDriver 2.45.0.2-beta'.

Successfully added 'Selenium.WebDriver.IEDriver 2.45.0.2-beta' to
MvcAcceptanceTestExtensions.

Exception calling "AddFromFile" with "1" argument(s): "Unspecified error
(Exception from HRESULT: 0x80004005 (E_FAIL))"

At
C:\Source\Reward\trunk\Se.Web\packages\Selenium.WebDriver.IEDriver.2.45.0.2-beta\tools\Install.ps1:19
char:35

  • $project.ProjectItems.AddFromFile <<<< ($driverPath)
    
    • CategoryInfo : NotSpecified: (:) [],
      MethodInvocationException
    • FullyQualifiedErrorId : ComMethodTargetInvocation

Updating 'Selenium.WebDriver.IEDriver' from version '2.45.0.1' to
'2.45.0.2-beta' in project 'Web.AcceptanceTest'.

Removing 'Selenium.WebDriver.IEDriver 2.45.0.1' from Web.AcceptanceTest.

Exception calling "Item" with "1" argument(s): "The parameter is incorrect.
(Exception from HRESULT: 0x80070057 (E_INVALIDARG))"

At
C:\Source\Reward\trunk\Se.Web\packages\Selenium.WebDriver.IEDriver.2.45.0.1\tools\Uninstall.ps1:16
char:28

  • $project.ProjectItems.Item <<<< ($driverFile).Delete()
    
    • CategoryInfo : NotSpecified: (:) [],
      MethodInvocationException
    • FullyQualifiedErrorId : ComMethodTargetInvocation

Successfully removed 'Selenium.WebDriver.IEDriver 2.45.0.1' from
Web.AcceptanceTest.

Adding 'Selenium.WebDriver.IEDriver 2.45.0.2-beta' to Web.AcceptanceTest.

Successfully added 'Selenium.WebDriver.IEDriver 2.45.0.2-beta' to
Web.AcceptanceTest.

Exception calling "AddFromFile" with "1" argument(s): "Unspecified error
(Exception from HRESULT: 0x80004005 (E_FAIL))"

At
C:\Source\Reward\trunk\Se.Web\packages\Selenium.WebDriver.IEDriver.2.45.0.2-beta\tools\Install.ps1:19
char:35

  • $project.ProjectItems.AddFromFile <<<< ($driverPath)
    
    • CategoryInfo : NotSpecified: (:) [],
      MethodInvocationException
    • FullyQualifiedErrorId : ComMethodTargetInvocation

Uninstalling 'Selenium.WebDriver.IEDriver 2.45.0.1'.

Successfully uninstalled 'Selenium.WebDriver.IEDriver 2.45.0.1'.


email: [email protected]

On 6 March 2015 at 07:06, jsakamoto [email protected] wrote:

I'm changing the package implementation to including driver .exe file.

I published Beta version.
https://www.nuget.org/packages/Selenium.WebDriver.IEDriver/2.45.0.2-beta

Would you try to use v.2.45.0.2 Beta?

NOTICE: It is beta version, so that version is concealed normaly. You
should change the filter of "NuGet Pakcage Manager" GUI dialog to "Include
Prerelease", or, if you use Package manager console then append "-Pre"
switch when executing Install-Package command.

I'll try to apply same changing to chrome driver package.


Reply to this email directly or view it on GitHub
#2 (comment)
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants