Selenium C# Open "New" tab CTRL+T doesn't work with CHROME


crush
static void Main()
{
    IWebDriver driver = new ChromeDriver();
    driver.Navigate().GoToUrl("http://google.com");
    IWebElement body = driver.FindElement(By.TagName("body"));

    body.SendKeys(Keys.Control + "t");

}

This is the code I'm trying to use to open a new tab, it doesn't work without any errors, the driver opens Google and that's it.... People are using the exact same code and it works for them, but not for me, I can't figure it out...

I tried sending Keys.Shift+"t" to the search field and it works, it writes a capital T in the field

I also tried

Actions act = new Actions(driver);
act.KeyDown(Keys.Control).SendKeys("t").Perform();

It still doesn't work, but again, if I change the Keys.Control it writes to Keys.Shift, there doesn't seem to be anything involving Keys.Control!

EDIT: I have tried running the code with the IE driver and the code works there, it opens new tabs but not on Chrome?

crush

Thanks for your answer! I did it with JavaScript.

((IJavaScriptExecutor)driver).ExecuteScript("window.open();");

Related


Selenium C# Open "New" tab CTRL+T doesn't work with CHROME

crush static void Main() { IWebDriver driver = new ChromeDriver(); driver.Navigate().GoToUrl("http://google.com"); IWebElement body = driver.FindElement(By.TagName("body")); body.SendKeys(Keys.Control + "t"); } This is the code I'm trying to

Selenium C# Open "New" tab CTRL+T doesn't work with CHROME

crush static void Main() { IWebDriver driver = new ChromeDriver(); driver.Navigate().GoToUrl("http://google.com"); IWebElement body = driver.FindElement(By.TagName("body")); body.SendKeys(Keys.Control + "t"); } This is the code I'm trying to

Selenium C# Open "New" tab CTRL+T doesn't work with CHROME

crush static void Main() { IWebDriver driver = new ChromeDriver(); driver.Navigate().GoToUrl("http://google.com"); IWebElement body = driver.FindElement(By.TagName("body")); body.SendKeys(Keys.Control + "t"); } This is the code I'm trying to

Selenium C# Open "New" tab CTRL+T doesn't work with CHROME

crush static void Main() { IWebDriver driver = new ChromeDriver(); driver.Navigate().GoToUrl("http://google.com"); IWebElement body = driver.FindElement(By.TagName("body")); body.SendKeys(Keys.Control + "t"); } This is the code I'm trying to

Selenium C# Open "New" tab CTRL+T doesn't work with CHROME

crush static void Main() { IWebDriver driver = new ChromeDriver(); driver.Navigate().GoToUrl("http://google.com"); IWebElement body = driver.FindElement(By.TagName("body")); body.SendKeys(Keys.Control + "t"); } This is the code I'm trying to

Ctrl + t - Can't open new tab in Selenium + Firefox Python

Wren Has Selenium removed any functionality? Goal: Open a new tab like "Ctrl+t" environment: Windows 7 Firefox 68 Python 3.7 The following two scripts are unresponsive: # 1 dr.find_element_by_tag_name('body').send_keys(Keys.CONTROL + 't') # 2 ActionChains(dr

Ctrl + t - Can't open new tab in Selenium + Firefox Python

Wren Has Selenium removed any functionality? Goal: Open a new tab like "Ctrl+t" environment: Windows 7 Firefox 68 Python 3.7 The following two scripts are unresponsive: # 1 dr.find_element_by_tag_name('body').send_keys(Keys.CONTROL + 't') # 2 ActionChains(dr

Selenium doesn't follow click to open new tab

Anonymous 0441 For a long time I had a problem using selenium to find the button I was looking for on the page. After a week, I had a "nice" idea to check the url where selenium was searching for the button. Fake me, this is the wrong url. So the problem is, s

Selenium doesn't open new URLs in new tabs (Python and Chrome)

Sam H123 I want to open a lot of URLs in different tabs using Selenium WebDriver and Python. I'm not sure what's wrong: driver = webdriver.Chrome() driver.get(url1) time.sleep(5) driver.find_element_by_tag_name('body').send_keys(Keys.CONTROL+'t') url2 = 'https

Selenium doesn't open new URLs in new tabs (Python and Chrome)

Sam H123 I want to open a lot of URLs in different tabs using Selenium WebDriver and Python. I'm not sure what's wrong: driver = webdriver.Chrome() driver.get(url1) time.sleep(5) driver.find_element_by_tag_name('body').send_keys(Keys.CONTROL+'t') url2 = 'https

Left click on link doesn't work, but "open in new tab" works

rock degree I'm working on my personal website (built from a template) and when I'm done, my links stop responding to left clicks. They work fine if you right click and select "Open in New Tab". You can see the URL in the status bar at the bottom of the browse

Left click on link doesn't work, but "open in new tab" works

rock degree I'm working on my personal website (built from a template) and when I'm done my links stop responding to left clicks too. They work fine if you right click and select "Open in New Tab". You can see the URL in the status bar at the bottom of the bro

Left click on link doesn't work, but "open in new tab" works

rock degree I'm working on my personal website (built from a template) and when I'm done my links stop responding to left clicks too. They work fine if you right click and select "Open in New Tab". You can see the URL in the status bar at the bottom of the bro

Make Ctrl+t open a new (chrome) tab when outside of chrome

Bastian Quest On Chrome OS, you can always use the Ctrl+ Tkeyboard shortcut to open a new tab (or actually a browser window) . Is it possible to do this in Ubuntu? Just setting a keyboard shortcut won't work, as that will change the behavior in Chrome (eg it w

Make Ctrl+t open a new (chrome) tab when outside of chrome

Bastian Quest On Chrome OS, you can always use the Ctrl+ Tkeyboard shortcut to open a new tab (or actually a browser window) . Is it possible to do this in Ubuntu? Just setting a keyboard shortcut won't work, as that will change the behavior in Chrome (eg it w

Make Ctrl+t open a new (chrome) tab when outside of chrome

Bastian Quest On Chrome OS, you can always use the Ctrl+ Tkeyboard shortcut to open a new tab (or actually a browser window) . Is it possible to do this in Ubuntu? Just setting a keyboard shortcut won't work, as that will change the behavior in Chrome (eg it w

Make Ctrl+t open a new (chrome) tab when outside of chrome

Bastian Quest On Chrome OS, you can always use the Ctrl+ Tkeyboard shortcut to open a new tab (or actually a browser window) . Is it possible to do this in Ubuntu? Just setting a keyboard shortcut won't work, as that will change the behavior in Chrome (eg it w

Opening new tabs in Firefox and Chrome with Selenium doesn't work

Barrio (j.barrio): I read a lot of options related to the way new windows are opened with Selenium. All the questions and answers are from years ago, maybe that's why they didn't work for me. That's why I want to ask this question again. My first approach is t

Opening new tabs in Firefox and Chrome with Selenium doesn't work

Barrio (j.barrio): I read a lot of options related to the way new windows are opened with Selenium. All the questions and answers are from years ago, maybe that's why they didn't work for me. That's why I want to ask this question again. My first approach is t

Opening new tabs in Firefox and Chrome with Selenium doesn't work

Barrio (j.barrio): I read a lot of options related to the way new windows are opened with Selenium. All the questions and answers are from years ago, maybe that's why they didn't work for me. That's why I want to ask this question again. My first approach is t

Opening new tabs in Firefox and Chrome with Selenium doesn't work

Barrio (j.barrio): I read a lot of options related to the way new windows are opened with Selenium. All the questions and answers are from years ago, maybe that's why they didn't work for me. That's why I want to ask this question again. My first approach is t

Opening new tabs in Firefox and Chrome with Selenium doesn't work

Barrio (j.barrio): I read a lot of options related to the way new windows are opened with Selenium. All the questions and answers are from years ago, maybe that's why they didn't work for me. That's why I want to ask this question again. My first approach is t

Ctrl+Del doesn't work in Chrome

phuclv When editing, I use shortcuts like + , + , + , + + ... extensively to handle word-levelCtrlCtrlBackspaceCtrlDelCtrlArrow keysCtrlShiftArrow keys However, Chrome Ctrl+ Backspaceworks fine no matter what, but the Ctrl+ Deldoesn't do anything. This happens

CTRL+click doesn't work on Chrome

Crabaccio Like in the title, the shortcut doesn't work, I can only open a new tab by pressing scroll. Since the CTRLkey works fine in other environments, what's wrong with Chrome? I'm using the latest Chrome on Windows 7 Home Premium on a Samsung NP305V5A-S03I

Ctrl+Del doesn't work in Chrome

phuclv When editing, I use shortcuts like + , + , + , + + ... extensively to handle word-levelCtrlCtrlBackspaceCtrlDelCtrlArrow keysCtrlShiftArrow keys However, Chrome Ctrl+ Backspaceworks fine no matter what, but the Ctrl+ Deldoesn't do anything. This happens

CTRL+click doesn't work on Chrome

Crabaccio Like in the title, the shortcut doesn't work, I can only open a new tab by pressing scroll. Since the CTRLkey works fine in other environments, what's wrong with Chrome? I'm using the latest Chrome on Windows 7 Home Premium on a Samsung NP305V5A-S03I