String oldTab = driver.getWindowHandle();
driver.findElement(By.xpath("//*[@id='socialicon']/a["+i+"]/img")).click();
ArrayList<String> newTab = new ArrayList<String>(driver.getWindowHandles());
newTab.remove(oldTab);
driver.switchTo().window(newTab.get(0));
driver.findElement(By.xpath("//*[@id='pagelet_loggedout_sign_up']/div/a[1]/span")).click();
' 我无法通过上述代码切换对新标签的控制。请帮我纠正同样的错误。'