Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using NUnit.Framework;
- using OpenQA.Selenium;
- using OpenQA.Selenium.Chrome;
- using OpenQA.Selenium.Support.UI;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Magazin_ColOovidiu
- {
- [TestFixture]
- class LoginClass
- {
- string email = "isus.cristos@doamneajuta.ro";
- string pass = "Spark123";
- IWebDriver driver;
- IWebElement LoginButton => new WebDriverWait(driver, TimeSpan.FromSeconds(10)).Until(x => x.FindElement(By.XPath("/html/body/div[1]/header/div[1]/div/div[1]/div/div/div[8]/div/div/div[1]/ul/li/a/span")));
- IWebElement Email => new WebDriverWait(driver, TimeSpan.FromSeconds(10)).Until(x => x.FindElement(By.Id("email")));
- IWebElement Password => driver.FindElement(By.Id("pass"));
- IWebElement LoginButton2 => new WebDriverWait(driver, TimeSpan.FromSeconds(10)).Until(x => x.FindElement(By.Id("send2")));
- IWebElement SiteLogo => driver.FindElement(By.ClassName("logo"));
- [Test]
- public void Login()
- {
- ChromeOptions co = new ChromeOptions();
- co.AddArgument("--start-maximized");
- driver = new ChromeDriver(co);
- driver.Navigate().GoToUrl("https://magazinulcolectionarului.ro/");
- LoginButton.Click();
- Email.Clear();
- Email.SendKeys(email);
- Password.Clear();
- Password.SendKeys(pass);
- LoginButton2.Submit();
- SiteLogo.Click();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement