public IWebDriver StartBrowser(string DirPath = "", int Zoom = 100) { string URL = string.Empty; List <Models.URL> uRLs = new List <Models.URL>(); we = new WebElem(this); if (DirPath == "") { DirPath = Path.GetDirectoryName(typeof(Browser).Assembly.Location) + @"..\..\..\TestConfig\urls.json"; } using (StreamReader r = new StreamReader(DirPath)) { string json = r.ReadToEnd(); uRLs = Newtonsoft.Json.JsonConvert.DeserializeObject <List <Models.URL> >(json); } URL = uRLs.Where(i => i.environment.ToLower() == env.ToLower() && i.application.ToLower() == application.ToLower()).FirstOrDefault().url; we.Log(URL); driv = OpenBrowser(); driv.Navigate().GoToUrl(URL); // ((IJavaScriptExecutor)driv).ExecuteScript("document.body.style.zoom='" + Convert.ToString(Zoom) + "%';"); we = new WebElem(this); return(driv); }
public IWebDriver StartBrowser(string URL) { driv = OpenBrowser(); driv.Navigate().GoToUrl(URL); we = new WebElem(this); return(driv); }
static public void Start(String FullPathToURLJson = "") { T = TestContext.CurrentContext; browser = new TestingUtilities.Browser(T); browser.StartBrowser(FullPathToURLJson, 100); we = new WebElem(browser); }
public Clicker(IWebDriver driv, ClickSetting clickSetting) { countr = 0; _driver = driv; _clickSetting = clickSetting; WasSuccessful = false; aTimer = new System.Timers.Timer(); we = new WebElem(_driver, _clickSetting); }
public IWebDriver StartBrowser(int Zoom = 100) { string URL = string.Empty; if (env.ToLower() == "qa") { URL = "https://scqa01.greyhound.com"; } else if (env.ToLower() == "uat" || env.ToLower() == "stage" || env.ToLower() == "stg") { URL = "https://scstg01.greyhound.com"; } driv = OpenBrowser(); driv.Navigate().GoToUrl(URL); ((IJavaScriptExecutor)driv).ExecuteScript("document.body.style.zoom='" + Convert.ToString(Zoom) + "%';"); we = new WebElem(this); return(driv); }