Answer the question
In order to leave comments, you need to log in
Powershell+Selenium. How to open a new tab on click?
Good afternoon.
I click on an element:
$ie.FindElementsByXPath("//button[@class='styledbutton']").Click()
Answer the question
In order to leave comments, you need to log in
For chrome it worked for me like this:
$uri = "http://google.com"
add-type -path C:\test\selenium\net40\WebDriver.dll
$driver = New-Object OpenQA.Selenium.Chrome.ChromeDriver
$driver.url = $uri
$driver.FindElementByLinkText("Gaeilge").SendKeys([OpenQA.Selenium.Keys]::Control + [OpenQA.Selenium.Keys]::Enter)
You can first get a link from the element you want to click on, and then substitute it here:
$ie.executeScript("window.open(' yandex.ru ', '_blank')")
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question