0

I am trying to modify the colors in the window popup. I am attaching the screenshot of the screen. The Html code behind the screen is:

<input id="headerbgcolor" name="headerbgcolor" type="text" class="color critfont" size="10" value="#FFFFFF" autocomplete="off" style="color: rgb(0, 0, 0); background-image: none; background-color: rgb(255, 255, 255);">

I need to change the colors.

The C# code that I am using is:

Driver.Instance.SwitchTo().Window(Driver.Instance.WindowHandles.Last());
var wa = new WebDriverWait(Driver.Instance, TimeSpan.FromSeconds(20));
var Style_Color = wait.Until(ExpectedConditions.ElementIsVisible(By.XPath("//*[@id='headerbgcolor']")));
Style_Color.Click();

It is throwing an exception which says:

A exception with a null response was thrown sending an HTTP request to the remote WebDriver server for URL http://localhost:62981/session/e1fd03c5626d4db32ac4ede14f5dd11c/element. The status of the exception was ReceiveFailure, and the message was: The underlying connection was closed: An unexpected error occurred on a receive.

Can anyone please help me?enter image description here

Erik Philips
  • 53,428
  • 11
  • 128
  • 150
  • Your provided element HTML contains Id `barcolor` but you are locating element by using Id `headerbgcolor`. Why?? – Saurabh Gaur Jul 28 '16 at 18:57
  • Hi Saurabh, there was an error, The id is headerbgcolor, I have updated the question. I am really sorry. –  Jul 28 '16 at 19:03
  • This doesn't seem as selenium error..It may be possible network error..have a look this http://stackoverflow.com/questions/29886223/c-sharp-system-net-webexception-the-underlying-connection-was-closed-an-unexpe..may be it helps..:) – Saurabh Gaur Jul 28 '16 at 19:08

0 Answers0