0

i am automating a process on firefox using selenium with c# .NET4.0:

    static void Main(string[] args)
    {
        selenium = new DefaultSelenium("localhost", 4444, "*firefox", "https://www.microsoft.com/");

        selenium.Start();
        selenium.SetSpeed("900");

        selenium.WindowMaximize();
        selenium.WindowFocus();

        Login();
     }

public static void LogIn()
        {
            verificationErrors = new StringBuilder();

        selenium.SetSpeed("900");
        selenium.Open("/Login.aspx");

        selenium.Type("id=ctl00_cphBody_objLogin_UserName", "user");

        selenium.Type("id=ctl00_cphBody_objLogin_Password", "P@assword");

        selenium.Click("id=ctl00_cphBody_objLogin_LoginImageButton");

        selenium.WaitForPageToLoad("30000");    

            try
            {
                selenium.IsTextPresent("Orders - Drug Testing");

            }
            catch (Exception)
            {
                Console.WriteLine("Could't find text: Orders - Drug Testing.");

            }


    }

firefox opens, and then NOTHING happens at all. it does not navigate to the requested page.

here's what it looks like. what am i doing wrong? everything works fine with IE

enter image description here

Alex Gordon
  • 57,446
  • 287
  • 670
  • 1,062

1 Answers1

2

To navigate to the requested page, need to use the following piece of code.

Selenium doesn't navigate to the page or base url automatically until & unless you call

selenium.open(" < your url goes here > ");

Ex : selenium.open("https://mail.google.com");

Harshavardhan Konakanchi
  • 4,238
  • 6
  • 36
  • 54