0

As stated above, I am running out an automated test on a website.

I am use selenium RC to do that but I'm just not sure why I am unable to open the website (actually i did open it), but its content is not showing.

There are just a few empty frame boxes.

This originally had too much code so I'm adding some more.

Anyone know why? Thank you.

Here is my code (unrelated code removed):

private ISelenium selenium;
private StringBuilder verificationErrors;
private Process worKer = new Process();
private string
serverHost = "localhost",
browserString = @"*iexploreproxy",
startUpURL = "";
private int
portNumber = 4444;

private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
    if (comboBox1.SelectedItem.ToString() == "CNY")
    {
        startUpURL = "http://malaysia.yahoo.com/";
    }
}

private void btnStartServer_Click(object sender, EventArgs e)
{
    worKer.StartInfo.FileName = @"C:\LjT\SeleniumServer.bat";
    worKer.Start();
}

private void WakeUpSElenium()
{
    selenium = new DefaultSelenium(serverHost, portNumber, browserString, startUpURL);
    selenium.Start();
    verificationErrors = new StringBuilder();
}

private void ToDoList()
{
    selenium.Open("/");
    //selenium.SelectFrame("iframe_content");
    selenium.Type("id=txtFirstName", "1");
    selenium.Click("id=rbtnGender_0");
}

private void btnTest_Click(object sender, EventArgs e)
{
    try
    {
        WakeUpSElenium();
        ToDoList();
    }
    catch
    {}
}
danday74
  • 52,471
  • 49
  • 232
  • 283
fj123
  • 963
  • 1
  • 8
  • 11

1 Answers1

0

You are not navigating anywhere, i.e this code here, will not navigate to any page at all:

selenium.Open("/");

I assume you meant to make it this:

selenium.Open(startUpURL); // this is the value from the combobox.
Arran
  • 24,648
  • 6
  • 68
  • 78
  • thanks for your reply, i did tried with your solution but the content still not coming out.. it just showing some few frame box with X sign.. just same as some broken imaged – fj123 Oct 11 '12 at 08:41
  • What's the value of startupURL when Selenium starts up? – Arran Oct 11 '12 at 08:42
  • just assume as i put in the Url directly when the selenium start up but not from picking from the combobox. but the website just doesnt show up ~ the startUpUrl = "http://member.staging.rb88.biz/"; – fj123 Oct 11 '12 at 08:46