Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

0 like 0 dislike
188 views
by
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using OpenQA.Selenium;
using OpenQA.Selenium.Firefox;

namespace Priyanka
{
    [TestClass]
    public class UnitTest1
    {
        [TestMethod]
        public void TestMethod1()
        {
            using (IWebDriver driverFF = new FirefoxDriver())
            {

               
                driverFF.Navigate().GoToUrl(" http://49.248.3.14:8881");
                driverFF.FindElement(By.Id("btnlogin")).Click();
              
              
                driverFF.FindElement((By.Id("txtusername"))).SendKeys("10426229");
                
                driverFF.FindElement((By.Id("txtpassword"))).SendKeys("10426229");

              
            
                driverFF.Url ="http://49.248.3.14:8881/Index.aspx";
              
              
            }
        }
    }
}

1 Answer

0 like 0 dislike
by Master (1.2k points)
well, you do not have code that actually close the browser automatically.

Can you check if some other file in your namespace have code to close the browser?

That might be causing problem for you.


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

...