Navigation Methods in Selenium WebDriver | To, Refresh, Back and Forward |

H Y R Tutorials β€’ April 11, 2020
Video Thumbnail
H Y R Tutorials Logo

H Y R Tutorials

@hyrtutorials

About

Welcome to my channel H Y R Tutorials. If you are looking for learning something useful (related to automation testing) with some good explanation, then you are in the right place. In this channel I'm going to share the knowledge on various programming languages, technologies and tools, so please stay tuned to this. πŸ”— YouTube - https://www.youtube.com/hyrtutorials πŸ”— Website - https://www.hyrtutorials.com πŸ”— Facebook - https://www.facebook.com/hyrtutorials πŸ”— Twitter - https://twitter.com/hyrtutorials πŸ”— Instagram - https://www.instagram.com/hyrtutorials πŸ”— Telegram - https://t.me/hyrtutorials πŸ”— LinkedIn - https://www.linkedin.com/company/hyrtutorials Kindly share this channel and website with your friends and help them as well. πŸ™ Please SubscribeπŸ”” to start learning for FREE now, Also help your friends in learning the best by suggesting this channel.

Video Description

In this video, I have explained about Navigation Methods in Selenium WebDriver. Selenium WebDriver is an open-source tool for automated testing of web apps across many browsers. Selenium Webdriver Navigation is a very important part of Webdriver API and in this video, I have explained the navigation methods in detail. Selenium WebDriver has provided 4 navigation methods, Those are as follows: βœ” To βœ” Refresh βœ” Back βœ” Forward These 4 navigation methods are available under navigation class and this navigation class instance is available under WebDriver. 1) To Load a new web page in the current browser window. This is done using an HTTP GET operation, and the method will block until the load is complete. This will follow redirects issued either by the server or as a meta-redirect from within the returned HTML. Should a meta-redirect "rest" for any duration of time, it is best to wait until this timeout is over, since should the underlying page change whilst your test is executing the results of future calls against this interface will be against the freshly loaded page. Eg: driver.navigate().to("https://facebook.com"); 2) Refresh Refresh the current page Eg: driver.navigate().refresh(); 3) Back Move back a single "item" in the browser's history. Eg: driver.navigate().back(); 4) Forward Move a single "item" forward in the browser's history. It does nothing if we are on the latest page viewed. Eg: driver.navigate().forward(); --- Webdriver Navigation Methods Example: ---- import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import io.github.bonigarcia.wdm.WebDriverManager; public class NavigationalMethods { public static void main(String[] args) throws Exception { WebDriverManager.chromedriver().setup(); WebDriver driver = new ChromeDriver(); driver.get("https://www.google.com/"); driver.findElement(By.name("q")).sendKeys("hyr tutorials"); driver.findElement(By.name("btnK")).submit(); driver.navigate().to("https://facebook.com"); driver.findElement(By.name("firstname")).sendKeys("Yadagiri"); driver.navigate().refresh(); Thread.sleep(2000); driver.navigate().back(); Thread.sleep(2000); driver.navigate().forward(); } } ============================================== ************** Checkout my other playlists ************** ============================================== Java Programming videos playlist:πŸ‘‡ πŸ”— https://bit.ly/3keRJGa Selenium WebDriver with Java videos playlist:πŸ‘‡ πŸ”— https://bit.ly/2FyKvxj Selenium interview questions videos playlist:πŸ‘‡ πŸ”— https://bit.ly/3matUB3 Windows automation with FlaUI videos playlist:πŸ‘‡ πŸ”— https://bit.ly/33CG4dB CSS Selectors videos playlist:πŸ‘‡ πŸ”— https://bit.ly/2Rn0IbD XPath videos playlist:πŸ‘‡ πŸ”— https://bit.ly/2RlLdkw Javascript Executor videos playlist:πŸ‘‡ πŸ”— https://bit.ly/2FhNXwS Apache POI videos playlist:πŸ‘‡ πŸ”— https://bit.ly/2RrngrH Maven videos playlist:πŸ‘‡ πŸ”— https://bit.ly/2DYfYZE How to fix Eclipse errors:πŸ‘‡ πŸ”— https://bit.ly/3ipvNYf ============================================== ============================================== Connect us @ πŸ”— Website - www.hyrtutorials.com πŸ”— Facebook - www.facebook.com/HYRTutorials πŸ”— LinkedIn - www.linkedin.com/company/hyrtutorials πŸ”— Twitter - www.twitter.com/Hyrtutorials ============================================== ============================================== πŸ™ Please SubscribeπŸ”” to start learning for FREE now, Also help your friends in learning the best by suggesting this channel. #selenium #navigation #to #refresh #forward #back #hyrtutorials #webAutomation

You May Also Like

No Recommendations Found

No products were found for the selected channel.