ict.ken.be

Delivering solid user friendly software solutions since the dawn of time.

Selenium Unable to cast object of type 'System.String' to type 'System.Collections.Generic.Dictionary 

Categories: Testing

When using Selenium remember that if you are connecting to a linux grid the url for the remote driver is case sensitive.

Mostly when you get this error it is because the url to the grid is wrong !

eg. http://192.168.99.100:4444/wd/hub

System.InvalidCastException

Unable to cast object of type 'System.String' to type 
'System.Collections.Generic.Dictionary`2[System.String,System.Object]'.
 at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities)
 at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)
at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(Uri remoteAddress, ICapabilities desiredCapabilities)
at ken.Selenium.Errors.SeleniumTests.ShouldHaveNoJavascriptErrors(String url) in d:\Sources.Sandbox\Ken\ken.Selenium.Errors\...\SeleniumTests.cs:line 79

System.Net.WebException Too many automatic redirections were attempted 

Categories: .Net

Assuming you do not need more then 50 redirects, your webpage probably redirects because of a missing cookie. Which can not be set because you didn't add a cookie container...

var request = (HttpWebRequest)WebRequest.Create(url);
request.Method = WebRequestMethods.Http.Get;
request.CookieContainer = new CookieContainer();
using (var response = (HttpWebResponse)request.GetResponse())
{
using (var stream = new StreamReader(response.GetResponseStream()))
{
string html = stream.ReadToEnd();
...
}
}

In case you do need more redirects or more likely less... you can set this property:

request.MaximumAutomaticRedirections = 5;

Export Mercurial into Git  

Categories: Git Mercurial

How sad that I have to write this post... proves once more that it's all about the marketing and communication, not so much the product.

Anyway, here how you can import your hg history into git using TortoiseHg

  • TortoiseHg > Global Settings > Extensions > Enable hggit
  • create a new git repo : git init --bare .git OR  git clone --bare https://git.ken.be/my-new-repo
  • cd to your hg repository and you might create a bookmark : hg bookmarks hg
  • hg push c:/path/to/your/new/git/repo
  • cd to your git repo
  • if you used init before: git config --bool core.bare false (when you used bare command before)
  • if you used a bookmark merge hg branch into master
  • push changes to remote repository
  • delete local version and get a normal clone.

And you have a new git repo with all your hg history in it. Awesome.

Or not so awesome: https://www.youtube.com/watch?v=CDeG4S-mJts 

Page 5 of 43 << < 1 2 3 4 5 6 7 8 9 10 20 40 > >>