Selenium java runtime error

Question!

I have written a test case and don't see any compilation errors but when I run the test case the browser opens and it suddenly gets closed within a second by throwing this error:

**Starting ChromeDriver 2.23.409699 (49b0fa931cda1caad0ae15b7d1b68004acd05129) on port 7788
Only local connections are allowed.
Sep 29, 2016 1:37:50 AM org.openqa.selenium.os.ProcessUtils killWinProcess
WARNING: Process refused to die after 10 seconds, and couldn't taskkill it
java.lang.RuntimeException: exec return code 1: ERROR: The parameter is incorrect.**

I'm using 32-bit OS vista I have tried

System.setProperty("WebDriver.Chrome.driver", "Chrome.driver.exe");`
System.setProperty("WebDriver.Chrome.driver", "Chromedriver.exe");
System.setProperty("WebDriver.Chrome.driver", "C : \\desktop\\Chrome.driver.exe");

but still throwing the same error



Answers

There is a mistake in your third line: the path should be to Chromedriver.exe and not chrome.driver.exe

Also you don't need to include the 1st two lines, just use:

System.setProperty("WebDriver.Chrome.driver", "C : \\desktop\\Chromedriver.exe");

Just check if Chromedriver starts with capital C or not.

Hope it helps, cheers.



You can't have separate function heads for Map vs Struct with a guard, but you can do it with pattern matching.

defmodule Guard do

  def foo(%{:__struct__ => x })  do
    Struct
  end

  def foo(x) when is_map x do
    Map
  end

end


You can check easily keys of current map with Map.keys/1.

For both map and struct is_map/1 will return true, but in your example:

Map.keys(%{}) will return []

and

Map.keys(struct) 

will return collection of keys, eg. [:__struct__, :name, :age].

So you can simply use:

:__struct__ in Map.keys(struct).

If you want to have this is_struct make it macro then.

By : PatNowak


This video can help you solving your question :)
By: admin