Skip to content
This repository was archived by the owner on May 30, 2023. It is now read-only.

PhantomJS proxy issue unveiled when mixed with Selenium and JSCover. #13898

Closed
jwaliszko opened this issue Jan 16, 2016 · 3 comments
Closed

PhantomJS proxy issue unveiled when mixed with Selenium and JSCover. #13898

jwaliszko opened this issue Jan 16, 2016 · 3 comments
Labels

Comments

@jwaliszko
Copy link

I'm working with PhantomJS 2.0.0, JSCover 1.0.23-SNAPSHOT, XUnit 2.1.0, Selenium.WebDriver 2.48.2 and basic ASP.NET MVC 4 application hosted in IISExpress 10 on Win7 machine.

In contrast to Firefox, when using JSCover through proxy on PhantomJS, no code coverage is collected.

To reproduce the issue repeat following steps:

Start JSCover with proxy args:

>java -jar JSCover-all.jar -ws --proxy --port=3128 --report-dir=reports --local-storage

Start PhantomJS:

>phantomjs --proxy=localhost:3128 --proxy-type=http --webdriver=4444

Setup WebDriver in C#:

using OpenQA.Selenium;
using OpenQA.Selenium.PhantomJS;
using OpenQA.Selenium.Remote;

var proxy = new Proxy {HttpProxy = "localhost:3128"};
var capabilities = DesiredCapabilities.PhantomJS();
capabilities.SetCapability(CapabilityType.Proxy, proxy);            
Driver = new RemoteWebDriver(new Uri("http://localhost:4444/wd/hub"), capabilities);

Invoke few tests:

Driver.Navigate().GoToUrl("http://localhost:51622/"); // site hosted on IISExpress
Driver.FindElementByXPath(...).Click(); // etc.

Navigate to the results page:

Driver.Navigate().GoToUrl("http://localhost:51622/jscoverage.html");

Expect 404 to be returned:

f38bac4e-b250-11e5-8e97-7dc36d3505bb

ed951dc8-b252-11e5-95c5-2a2de8d79252

Few more details can be found here: tntim96/JSCover#220.

@jwaliszko
Copy link
Author

ProxyIssue.zip - an archive containing minimalist sample project, for this issue to be quickly reproduced.

To run the sample: open it in Visual Studio 2015, build, and debug through a single unit test defined there (you may need e.g. Chutzpah Test Adapter extension, to be able to see the test in Test Explorer):

image

In case of possible troubles, you may need to adjust a few paths (to Java, IIS) predefined in Setup.cs file.

@jwaliszko
Copy link
Author

Update: with version 2.1.1 this issue is still there.

@stale stale bot added the stale label Dec 27, 2019
@stale
Copy link

stale bot commented Dec 30, 2019

Due to our very limited maintenance capacity, we need to prioritize our development focus on other tasks. Therefore, this issue will be automatically closed (see #15395 for more details). In the future, if we see the need to attend to this issue again, then it will be reopened. Thank you for your contribution!

@stale stale bot closed this as completed Dec 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant