Selenuim - Fur Tab Cusub oo Fure

Badanaa waxaad ubaahantahay inaad furto tab cusub isla daaqada biraawsarka ee socodsiineysa tijaabooyinkaaga Selenium WebDriver. Halkii aad ka furayn laheyd biraawsar cusub, waxaad si fudud u isticmaali kartaa lambarka hoose si aad u furto tab cusub isla isla biraawsarka:

driver.findElement(By.cssSelector('body')).sendKeys(Keys.CONTROL +'t');

Kadib markaad furto tab cusub, waa inaad u wareejisaa si aad ugu shaqeyn karto tabka cusub ee la furay:

ArrayList tabs = new ArrayList (driver.getWindowHandles()); driver.switchTo().window(tabs.get(0));

Koodhka kor ku xusan wuxuu u shaqeeyaa Firefox Browser.

Akhrin Dheeraad ah: