I am using ChromeDriver with Selenium in my WPF desktop(.net core) application and I want to open different tabs(Sessions) in 1 Chrome browser For that I am using IInputSimulator(virtual keyboard) with the shortcut Ctrl+Shift+x but it is not opening as per the given TabCount.
Do you have any solution or alternate way to achieve the same?
Here is my code snippet:
for (var i = 0; i < TabCount - 1; i++)
{
try
{
_logger.Info($"Tab changed: i={i}, tab count:{TabCount}");
_driver.SwitchTo().Window(mainHandler);
Thread.Sleep(2500);
_inputSimulator.Keyboard.ModifiedKeyStroke(new[] { VirtualKeyCode.CONTROL, VirtualKeyCode.SHIFT }, new[] { VirtualKeyCode.VK_X });
_driver.SwitchTo().Window(_driver.WindowHandles.Last());
if (_driver.Url != Constant.TabUrls.Google_URL)
{
_driver.Navigate().GoToUrl(Constant.TabUrls.Google_URL);
Thread.Sleep(2500);
}
}
catch (Exception ex)
{
_logger.Error(ex.Message, ex);
}
_logger.Info("Go back to main handler");
}
After some R&D I found a good extension for Chrome which is "SessionBox - Multi login to any website" Session Box
However, it is paid you can check the pricing here: https://sessionbox.io/pricing
Again you can not perform anything on the extension/popup above the bookmark bar and you can operate inside the browser screen only using Selenium... right?
So for that, I have opened the extension URL which is the same UI available on a web page as appears on the extension popup.
The link can be something like this after installing the extension: chrome-extension://megbklhjamjbcafknkgmokldgolkdfig/views.html?view=onBoarding
For that here is my core logic applied on the extension URL page: