I have written a very basic script that logs on to google and does a
search.
I have tried the following combinations -
selenium = new DefaultSelenium("localhost", 4444, "*chrome", "http://
www.google.co.uk");
selenium = new DefaultSelenium("localhost", 4444, "*iehta", "http://
www.google.com/");
selenium = new DefaultSelenium("localhost", 4444, "*iexplore", "http://
www.google.co.uk");
selenium = new DefaultSelenium("localhost", 4444, "*chrome C:/Program
Files/Mozilla Firefox/firefox.exe", "http://www.google.com/");
selenium = new DefaultSelenium("localhost", 4444, "*iexplore C:/
Program Files/Internet Explorer/iexplore.exe", "http://
www.google.co.uk/");
I have alse tried -
selenium.Open("http://www.google.com/");
I have set the PATH environment variable in MS Vista to firefox and
iexplorer directories. I have re-booted the laptop several times.
Here is the error from Firefox -
12:45:37.945 INFO - Launching Firefox...
12:45:52.832 INFO - Got result: OK,2926f777a94647ab8d6dde84bebfbab3 on
session 2926f777a94647ab8d6dd
e84bebfbab3
12:45:53.473 INFO - Command request: testComplete[, ] on session
2926f777a94647ab8d6dde84bebfbab3
12:45:53.482 INFO - Killing Firefox...
12:45:53.876 INFO - Got result: OK on session
2926f777a94647ab8d6dde84bebfbab3
12:46:03.944 INFO - Command request: open[http://www.google.com/, ] on
session null
12:46:03.954 ERROR - Exception running 'open 'command on session null
java.lang.NullPointerException: sessionId should not be null; has this
session been started yet?
at
org.openqa.selenium.server.FrameGroupCommandQueueSet.getQueueSet(FrameGroupCommandQueueSe
t.java:214)
at
org.openqa.selenium.server.commands.SeleniumCoreCommand.execute(SeleniumCoreCommand.java:
34)
at
org.openqa.selenium.server.SeleniumDriverResourceHandler.doCommand(SeleniumDriverResource
Handler.java:549)
at
org.openqa.selenium.server.SeleniumDriverResourceHandler.handleCommandRequest(SeleniumDri
verResourceHandler.java:364)
at
org.openqa.selenium.server.SeleniumDriverResourceHandler.handle(SeleniumDriverResourceHan
dler.java:125)
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:
820)
at
org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:986)
at org.mortbay.http.HttpConnection.handle(HttpConnection.java:
837)
at
org.mortbay.http.SocketListener.handleConnection(SocketListener.java:
245)
at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:
357)
at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:
534)
12:46:04.101 INFO - Got result: ERROR Server Exception: sessionId
should not be null; has this sessi
on been started yet? on session null
David Burns
http://www.theautomatedtester.co.uk/
On Feb 4, 1:10 pm, RedRose123 <steven.kil...@rocketmail.com> wrote:
> Please help. I would like to lean Selenium with C# but can not get
> started. I have spend several days investigating the issues and have
> been unsuccessful. I keep getting a Null session Id when I try to use
> selenium C# with firefox. When I use IE, I get a dialog box saying
> string is incorrect and it opens on the home page. I have
> successfully used Firefox with Selenium Perl.
>
> I have written a very basic script that logs on to google and does a
> search.
>
> I have tried the following combinations -
>
> selenium = new DefaultSelenium("localhost", 4444, "*chrome", "http://www.google.co.uk");
> selenium = new DefaultSelenium("localhost", 4444, "*iehta", "http://www.google.com/");
> selenium = new DefaultSelenium("localhost", 4444, "*iexplore", "http://www.google.co.uk");
> selenium = new DefaultSelenium("localhost", 4444, "*chrome C:/Program
> Files/Mozilla Firefox/firefox.exe", "http://www.google.com/");
> selenium = new DefaultSelenium("localhost", 4444, "*iexplore C:/
> Program Files/Internet Explorer/iexplore.exe", "http://www.google.co.uk/");
Yep, its in there. I also added a sleep thread but still can not get
it to work.
System.Threading.Thread.Sleep(10000);
selenium.Start();
The code was copied exactly from Selenium IDE except for two changes.
1) I tried various browsers and paths.
selenium = new DefaultSelenium(. ... "
2) I added this class to execute the code at the end of SeleniumTests
namespace.
------------------------------------------------------------------------------------------------------------
public class seleniumTest
{
// contains Main(), indicates that the program starts
public static void Main()
{
Untitled s = new Untitled();
s.SetupTest();
s.TeardownTest();
s.TheUntitledTest();
}
}
--------------------------------------------------------------------------------------------------------------
On Feb 4, 3:53 pm, David Burns <theautomatedtes...@googlemail.com>
wrote:
> have you got selenium.Start(); in your code? The error you are showing
> tends to appear when you try use the browser without having started
> it.
>
> David Burnshttp://www.theautomatedtester.co.uk/
David Burns
http://www.theautomatedtester.co.uk/
Thanks David, that information is really helpful. --- On Thu, 4/2/10, David Burns <theautoma...@googlemail.com> wrote: |
|
Hi David, I have just successfully run your tutorial and are no longer getting a Null session Id error. Thanks, the tutorial was very helpful. Regards, Steve. |
--- On Thu, 4/2/10, David Burns <theautoma...@googlemail.com> wrote: |
|