
If it is not, go to the Google Play Store, and reinstall Google by searching for it.
To choose the search engine you prefer after the reset, go to Settings > Search Engine and click the drop-down menu beside the option that says: ‘Search engine used in the address bar’. Change this by adding Google Search Bar directly to the Maybe this will be helpful to someone with the same situation.Ĭheck this complete example to understand how to open multiple tabs and switch between the tabs and at the end close all tabs.Googilite likes this. I am aware that mine solution is not perfect or even good and I would also like to switch with driver's switchTo call, but as I wrote it was not possible as I had only one handle. I used the Ctrl + T combination to open a new tab, Ctrl + W to close it, and to switch back to original tab I used Ctrl + 1 (the first tab). it just did not work without this, like it has lost the focusĭriver.switchTo().window(originalHandle) And switch back to the original handle. String originalHandle = driver.getWindowHandle() Īction.keyDown(Keys.CONTROL).sendKeys("w").perform() Īction.keyDown(Keys.CONTROL).sendKeys("1").perform() Int handlesSize = driver.getWindowHandles().size() I always get handlesSize = 1, regardless how many tabs I have String urlToOpen = " Iterator windowIterator = driver.getWindowHandles() Anyhow, I try to write my own solution: // Open a new tabĭriver.findElement(By.cssSelector("body")).sendKeys(Keys.CONTROL + "t") Somehow this makes sense to me as Firefox is a single process and each tab is not a separate process.
The problem is if I a call driver.getWindowHandles() I always get one single handle. Unfortunately none of the previous solutions worked for me. I am using Selenium 2.52.0 in Java and Firefox 44.0.2. IWebElement body = driver.FindElement(By.TagName("body")) Ruby require 'selenium-webdriver'ĭriver = Selenium::WebDriver.for :firefoxīody = driver.find_element(:tag_name => 'body')įrom import Keysīody = driver.find_element_by_tag_name("body") For example, Mac uses CMD + T, instead of Ctrl + T. Note that the actual keys to send depend on your OS. Just for anyone else who's looking for an answer in Ruby, Python, and C# bindings (Selenium 2.33.0).