Oct 6, 2008 5:51 AM
Is it possible to run selenium tests against a custom browser created in c# using Windows Form and webBrowser component?
Hi Andras,
I tried running the command you suggested but still receive the same error message SRC, please see steps below.
1. I created a c# Windows Form with a webBrowser component (which calls the IE ActiveX component) on the form which defaults to http://www.google.com
2. Next I setup my proxy Address to "localhost" and port to "4444" through Internet Explorer Settings and close Internet Explorer.
3. I then start my Selenium server and run the following command in prompt (pointing to the .exe created in step 1):
cmd=getNewBrowserSession&1=*custom C:\Users\...\My Web Browser\bin\Debug\MyWebBrowser.exe&2=http://www.google.com
4. Which opens my application successfully and gives me the following output in Selenium server prompt:
10:34:46.996 INFO - ---> Requesting http://localhost:4444/selenium-server/driver?cmd=getNewBrowserSession&1=*custom C:\Users\...\My Web Browser\bin\Debug\MyWebBrowser.exe&2=http://ww.google.com
10:34:47.013 INFO - Checking Resource aliases
10:34:47.016 INFO - Command request: getNewBrowserSession[*custom C:\Users\...\My Web Browser\bin\Debug\MyWebBrowser.exe, http://www.google.com] on session null
10:34:47.017 INFO - creating new remote session
10:34:47.052 INFO - Allocated session d6a52dc5d7d44ce5b1396aa113af99ea for http://www.google.com, launching...
5. I then run the following command:
cmd=open&1=http://www.google.com&sessionId=d6a52dc5d7d44ce5b1396aa113af99ea
(Note the same for 'cmd=open&1=http://www.google.com/webhp&sessionId=d6a52dc5d7d44ce5b1396aa113af99ea')
6. Which gives me the following message in Selenium server error:
10:35:29.920 INFO - ---> Requesting http://localhost:4444/selenium-server/driver?cmd=open&1=http://www.google.com&sessioId=d6a52dc5d7d44ce5b1396aa113af99ea
10:35:29.926 INFO - Command request: open[http://www.google.com, ] on session d6a52dc5d7d44ce5b1396aa113af99ea
10:35:29.927 ERROR - Exception running command
java.lang.NullPointerException
at java.util.concurrent.ConcurrentHashMap.get(Unknown Source)
at org.openqa.selenium.server.FrameGroupCommandQueueSet.getCommandQueue(FrameGroupCommandQueueSet.java:246)
at org.openqa.selenium.server.FrameGroupCommandQueueSet.getCommandQueue(FrameGroupCommandQueueSet.java:204)
at org.openqa.selenium.server.FrameGroupCommandQueueSet.doCommand(FrameGroupCommandQueueSet.java:421)
at org.openqa.selenium.server.SeleniumDriverResourceHandler.doCommand(SeleniumDriverResourceHandler.java:529)
at org.openqa.selenium.server.SeleniumDriverResourceHandler.handleCommandRequest(SeleniumDriverResourceHandler.j
ava:369)
at org.openqa.selenium.server.SeleniumDriverResourceHandler.handle(SeleniumDriverResourceHandler.java:130)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1530)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1482)
at org.mortbay.http.HttpServer.service(HttpServer.java:909)
at org.mortbay.http.HttpConnection.service(HttpConnection.java:816)
at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:982)
at org.mortbay.http.HttpConnection.handle(HttpConnection.java:833)
at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
10:35:29.929 INFO - Got result: ERROR Server Exception: null on session d6a52dc5d7d44ce5b1396aa113af99ea
Any help will be appreciated, I am not sure if I am missing another manual step in order to get this working.