Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using OpenQA.Selenium;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using NUnit.Framework;
- using OpenQA.Selenium.Chrome;
- using OpenQA.Selenium.PhantomJS;
- namespace WebAuto
- {
- public class OpenBrowser
- {
- private static IWebDriver driver = new ChromeDriver();
- public IWebDriver getDriver()
- {
- return driver;
- }
- }
- }
- using OpenQA.Selenium;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using NUnit.Framework;
- using OpenQA.Selenium.Chrome;
- using OpenQA.Selenium.PhantomJS;
- namespace WebAuto
- {
- public class Login
- {
- public static void Login1()
- {
- //var driver = new ChromeDriver();
- OpenBrowser.IWebDriver. getDriver();
- driver.Navigate().GoToUrl("www.anywebsite.com");
- //driver.Navigate().GoToUrl("www.anywebsite.com");
- //driver.WaitForPageToLoad();
- var inputtext1 = driver.FindElement(By.Id("lgLogin_txtUserId"));
- //inputtext1.Focus();
- inputtext1.SendKeys("User");
- var inputpassword1 = driver.FindElement(By.Id("lgLogin_txtPassword"));
- //inputpassword1.Focus();
- inputpassword1.SendKeys("Password");
- var inputbutton1 = driver.FindElement(By.Id("btnLoginClient"));
- inputbutton1.Click();
- //driver.WaitForPageToLoad();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement