
navigate( ).to( ) is feeding with a page URL and an argument.ĭriver.navigate().to(driver.getCurrentUrl())
To command: This command is again using the same above concept. If you look carefully, it is just feeding get command with a page URL. Get command: This is a tricky one, as it is using another command as an argument to it. Element "s" is a Seach Text box on my websiteĭriver.findElement(By.name( "s")).sendKeys(Keys.F5)
As it is using a send keys method, we must use this on any Text box on a webpage.
SendKeys command: Second most commonly used command for refreshing a webpage. Refresh command: The most commonly used and simple command for refreshing a webpage. Sometimes on certain browsers or on certain pages, normal refresh command deos not work, in those situations we can easily usethese commands to solve out purpose. Let's look at the codes to refresh the Browser in many different ways with Selenium WebDriver.