Untitled

 avatar
unknown
plain_text
3 years ago
1.3 kB
2
Indexable
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NUnit.Framework;
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Firefox;


namespace seleniumLab
{
    internal class SeleniumTesting
    {
        IWebDriver driver;

        [SetUp]
        public void startBrowser()
        {
            driver = new ChromeDriver();
        }

        [Test]
        public void test()
        {
            driver.Url = "https://www.stopstalk.com/default/user/login";
            IWebElement element = driver.FindElement(By.Name("email"));
            element.SendKeys("rafisadat41@gmail.com");

            IWebElement password = driver.FindElement(By.Name("password"));
            password.SendKeys("2901710808077125011");
            driver.FindElement(By.ClassName("btn")).Click();

            String at = driver.Title;
            String et = "Dashboard";

            if (at == et)
            {
                Console.WriteLine("Test Successfull");
            } else
            {
                Console.WriteLine("Unsuccessful");
            }
        }

        [TearDown]
        public void closeBrowser()
        {
            driver.Close();
        }
    }
}