public void BrowserWindowTest_BackShouldLeadToPreviousUri() { BrowserWindow.NavigateToUrl(_basicTestPageUrl); var currentUri = BrowserWindow.Uri; BrowserWindow.NavigateToUrl(_mouseTestPageUrl); BrowserWindow.Back(); BrowserWindow .Uri .ShouldBeEquivalentTo(currentUri, "because back should return to the previous page."); }
public void BrowserWindowTest_ForwardShouldUndoBack() { BrowserWindow.NavigateToUrl(_basicTestPageUrl); BrowserWindow.NavigateToUrl(_mouseTestPageUrl); BrowserWindow .Uri .ShouldBeEquivalentTo(_mouseTestPageUrl, "because browser should have been redirected to '{0}'.", _mouseTestPageUrl); BrowserWindow.Back(); BrowserWindow .Uri .ShouldBeEquivalentTo(_basicTestPageUrl, "because back should redirect browser to '{0}'.", _basicTestPageUrl); BrowserWindow.Forward(); BrowserWindow .Uri .ShouldBeEquivalentTo(_mouseTestPageUrl, "because forward should undo back."); }
public void BrowseWindow_Hook() //Video no 17 { //hook with already existing Browser with title "Execute Automation" BrowserWindow window = BrowserWindow.Locate("Execute Automation"); //Execute Automation is the title of the browser. //From Process //BrowserWindow fromProcess = BrowserWindow.FromProcess(); BrowserWindow.ClearCookies(); BrowserWindow.ClearCache(); Image image = window.CaptureImage(); image.Save(@"c:\captured.jpeg", ImageFormat.Jpeg); image.Dispose(); //Releasing BrowserWindow.CurrentBrowser = "Firefox"; // or "Chrome" or "IE" window.Refresh(); window.Forward(); window.Back(); window.NavigateToHomepage(); }