2

I have an input element that opens a new popup window when clicked (where the user can select a value for the field).

Markup:

<html>
<input type="text" id="myPopup" readonly="readonly" name="myPopup">
</html>

c#:

    var driver = new PhantomJSDriver(@"C:\PhantomJS");
    driver.Navigate().GoToUrl(@"http://username:password@localhost/myUrl.aspx");
    var popupField = driver.FindElementById("myPopup");
    popupField.Click();

(I'm passing credentials in the URL for Windows Authentication)

I get a WebDriverException:

"The HTTP request to the remote WebDriver server for URL ...element/:wdc:1389663237442/click timed out after 60 seconds."

All other interactions I tried work except this particular element. Also tried with IE/Chrome drivers and it worked.

Any ideas?

PhantomJS 1.9.2, C# / GhostDriver, Selenium Webdriver 2.39, Windows 7 x64. Let me know if there's any other info I can provide.

user3167162
  • 445
  • 1
  • 6
  • 23
  • I added the markup. It works with IE/Chrome drivers. – user3167162 Jan 14 '14 at 02:56
  • I tried wait.Until(ExpectedConditions.ElementIsVisible(By.Id("myPopup")) and also Thread.Sleep(TimeSpan.FromMinutes(2)) but it I still get the timeout error. – user3167162 Jan 14 '14 at 03:14
  • Neither Actions or JavaScript Click() worked - encountered the same timeout. Also I experimented with Actions ClickAndHold() > screenshot > Release() - I could see the element was being clicked in the screenshot but on Release I got the timeout. – user3167162 Jan 14 '14 at 04:04

1 Answers1

1

I had a similar issue. Tests worked on FF but timed out on PhantomJs, as you describe. The pages I was testing used a lot of social media plugins which I think were using XHR. Removing most of the security restrictions on PhantomJs fixed it for me (see below).

service.IgnoreSslErrors = true;
service.WebSecurity = false; 
service.LocalToRemoteUrlAccess = true; 
service.DiskCache = true; // Dunno what this does but I thought it might help.
PhantomJSDriver driver = new PhantomJSDriver(service);
Joe
  • 91
  • 7