Selenuim - Vhura Nyowani Bhurawuza Tab

Kazhinji iwe ungangoda kuvhura iyo nyowani tebhu mune imwechete browser hwindo iyo iri kumhanyisa yako Selenium WebDriver bvunzo. Panzvimbo pekuvhura bhurawuza nyowani, unogona kungoshandisa kodhi iri pazasi kuvhura nyowani tebhu mune imwechete browser.

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

Zvino kana iwe ukavhura iyo nyowani tebhu, iwe unofanirwa kuchinjira kwairi kuti ugone kushanda pamwe neichangovhurwa tebhu:

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

Iyi iri pamusoro kodhi inoshanda yeFirefox Browser.

Kuenderera mberi nekuverenga: