Connecting selenium driver to CEF desktop application
up vote
0
down vote
favorite
I want to use Selenium WebDriver to run automated tests in a CEF window that is embedded in an application. When i run application with debug console enabled, and then i start my test i'm getting following error:
SessionNotCreatedException: Message: session not created from unknown error: unhandled inspector error: ("code":-32601, "message":"'Target.setAutoAtach' wasn't found")
How can I fix this error? Or there is another way to connect to CEF desktop application?
My C# code:
Cef.Initialize(new CefSettings
{
RemoteDebuggingPort = 55555,
Locale = ResourcesController.GetResource("Locale"),
LogSeverity = LogSeverity.Disable
});
ChromeBrowser = new ChromiumWebBrowser(mainHtml)
{
Dock = DockStyle.Fill,
BrowserSettings = new BrowserSettings
{
FileAccessFromFileUrls = CefState.Enabled,
UniversalAccessFromFileUrls = CefState.Enabled,
},
MenuHandler = new CustomContextMenuHandler()
};
And automation test in python:
import unittest
from selenium import webdriver
from selenium.webdriver.support import expected_conditions as ec
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
import os
CEF_PORT = "55555"
DEBUGGER_ADDRESS = "localhost:{}".format(CEF_PORT)
CHROMEDRIVER_PATH = "C:chromedriverchromedriver.exe"
os.environ["PATH"] += os.pathsep + r'C:chromedriver'
class LoginTest(unittest.TestCase):
window_handle_main = None
def setUp(cls):
options = webdriver.ChromeOptions()
options.debugger_address = DEBUGGER_ADDRESS
def test_button_login_click(self):
WebDriverWait(self.instance, 5).until(ec.presence_of_element_located((By.ID, "btnLogin")))
self.instance.find_element_by_id("btnLogin").click()
def tearDown(self):
self.instance.close()
if __name__ == "__main__":
unittest.main()
I'm using latest version of chromedriver (2.43).
python selenium chromium-embedded
add a comment |
up vote
0
down vote
favorite
I want to use Selenium WebDriver to run automated tests in a CEF window that is embedded in an application. When i run application with debug console enabled, and then i start my test i'm getting following error:
SessionNotCreatedException: Message: session not created from unknown error: unhandled inspector error: ("code":-32601, "message":"'Target.setAutoAtach' wasn't found")
How can I fix this error? Or there is another way to connect to CEF desktop application?
My C# code:
Cef.Initialize(new CefSettings
{
RemoteDebuggingPort = 55555,
Locale = ResourcesController.GetResource("Locale"),
LogSeverity = LogSeverity.Disable
});
ChromeBrowser = new ChromiumWebBrowser(mainHtml)
{
Dock = DockStyle.Fill,
BrowserSettings = new BrowserSettings
{
FileAccessFromFileUrls = CefState.Enabled,
UniversalAccessFromFileUrls = CefState.Enabled,
},
MenuHandler = new CustomContextMenuHandler()
};
And automation test in python:
import unittest
from selenium import webdriver
from selenium.webdriver.support import expected_conditions as ec
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
import os
CEF_PORT = "55555"
DEBUGGER_ADDRESS = "localhost:{}".format(CEF_PORT)
CHROMEDRIVER_PATH = "C:chromedriverchromedriver.exe"
os.environ["PATH"] += os.pathsep + r'C:chromedriver'
class LoginTest(unittest.TestCase):
window_handle_main = None
def setUp(cls):
options = webdriver.ChromeOptions()
options.debugger_address = DEBUGGER_ADDRESS
def test_button_login_click(self):
WebDriverWait(self.instance, 5).until(ec.presence_of_element_located((By.ID, "btnLogin")))
self.instance.find_element_by_id("btnLogin").click()
def tearDown(self):
self.instance.close()
if __name__ == "__main__":
unittest.main()
I'm using latest version of chromedriver (2.43).
python selenium chromium-embedded
The officialCEF
guide is bitbucket.org/chromiumembedded/cef/wiki/UsingChromeDriver.md Last I checked you couldn't attachSelenium
to an already running instance, has this changed?
– amaitland
Nov 9 at 5:42
No and i'm out of ideas. Now i'm trying to start application from selenium test code like in youtube.com/watch?v=xfyDIz7Mk0U. I'll edit main post if i have any updates.
– Krystian721
Nov 9 at 8:31
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I want to use Selenium WebDriver to run automated tests in a CEF window that is embedded in an application. When i run application with debug console enabled, and then i start my test i'm getting following error:
SessionNotCreatedException: Message: session not created from unknown error: unhandled inspector error: ("code":-32601, "message":"'Target.setAutoAtach' wasn't found")
How can I fix this error? Or there is another way to connect to CEF desktop application?
My C# code:
Cef.Initialize(new CefSettings
{
RemoteDebuggingPort = 55555,
Locale = ResourcesController.GetResource("Locale"),
LogSeverity = LogSeverity.Disable
});
ChromeBrowser = new ChromiumWebBrowser(mainHtml)
{
Dock = DockStyle.Fill,
BrowserSettings = new BrowserSettings
{
FileAccessFromFileUrls = CefState.Enabled,
UniversalAccessFromFileUrls = CefState.Enabled,
},
MenuHandler = new CustomContextMenuHandler()
};
And automation test in python:
import unittest
from selenium import webdriver
from selenium.webdriver.support import expected_conditions as ec
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
import os
CEF_PORT = "55555"
DEBUGGER_ADDRESS = "localhost:{}".format(CEF_PORT)
CHROMEDRIVER_PATH = "C:chromedriverchromedriver.exe"
os.environ["PATH"] += os.pathsep + r'C:chromedriver'
class LoginTest(unittest.TestCase):
window_handle_main = None
def setUp(cls):
options = webdriver.ChromeOptions()
options.debugger_address = DEBUGGER_ADDRESS
def test_button_login_click(self):
WebDriverWait(self.instance, 5).until(ec.presence_of_element_located((By.ID, "btnLogin")))
self.instance.find_element_by_id("btnLogin").click()
def tearDown(self):
self.instance.close()
if __name__ == "__main__":
unittest.main()
I'm using latest version of chromedriver (2.43).
python selenium chromium-embedded
I want to use Selenium WebDriver to run automated tests in a CEF window that is embedded in an application. When i run application with debug console enabled, and then i start my test i'm getting following error:
SessionNotCreatedException: Message: session not created from unknown error: unhandled inspector error: ("code":-32601, "message":"'Target.setAutoAtach' wasn't found")
How can I fix this error? Or there is another way to connect to CEF desktop application?
My C# code:
Cef.Initialize(new CefSettings
{
RemoteDebuggingPort = 55555,
Locale = ResourcesController.GetResource("Locale"),
LogSeverity = LogSeverity.Disable
});
ChromeBrowser = new ChromiumWebBrowser(mainHtml)
{
Dock = DockStyle.Fill,
BrowserSettings = new BrowserSettings
{
FileAccessFromFileUrls = CefState.Enabled,
UniversalAccessFromFileUrls = CefState.Enabled,
},
MenuHandler = new CustomContextMenuHandler()
};
And automation test in python:
import unittest
from selenium import webdriver
from selenium.webdriver.support import expected_conditions as ec
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
import os
CEF_PORT = "55555"
DEBUGGER_ADDRESS = "localhost:{}".format(CEF_PORT)
CHROMEDRIVER_PATH = "C:chromedriverchromedriver.exe"
os.environ["PATH"] += os.pathsep + r'C:chromedriver'
class LoginTest(unittest.TestCase):
window_handle_main = None
def setUp(cls):
options = webdriver.ChromeOptions()
options.debugger_address = DEBUGGER_ADDRESS
def test_button_login_click(self):
WebDriverWait(self.instance, 5).until(ec.presence_of_element_located((By.ID, "btnLogin")))
self.instance.find_element_by_id("btnLogin").click()
def tearDown(self):
self.instance.close()
if __name__ == "__main__":
unittest.main()
I'm using latest version of chromedriver (2.43).
python selenium chromium-embedded
python selenium chromium-embedded
asked Nov 8 at 18:41
Krystian721
32
32
The officialCEF
guide is bitbucket.org/chromiumembedded/cef/wiki/UsingChromeDriver.md Last I checked you couldn't attachSelenium
to an already running instance, has this changed?
– amaitland
Nov 9 at 5:42
No and i'm out of ideas. Now i'm trying to start application from selenium test code like in youtube.com/watch?v=xfyDIz7Mk0U. I'll edit main post if i have any updates.
– Krystian721
Nov 9 at 8:31
add a comment |
The officialCEF
guide is bitbucket.org/chromiumembedded/cef/wiki/UsingChromeDriver.md Last I checked you couldn't attachSelenium
to an already running instance, has this changed?
– amaitland
Nov 9 at 5:42
No and i'm out of ideas. Now i'm trying to start application from selenium test code like in youtube.com/watch?v=xfyDIz7Mk0U. I'll edit main post if i have any updates.
– Krystian721
Nov 9 at 8:31
The official
CEF
guide is bitbucket.org/chromiumembedded/cef/wiki/UsingChromeDriver.md Last I checked you couldn't attach Selenium
to an already running instance, has this changed?– amaitland
Nov 9 at 5:42
The official
CEF
guide is bitbucket.org/chromiumembedded/cef/wiki/UsingChromeDriver.md Last I checked you couldn't attach Selenium
to an already running instance, has this changed?– amaitland
Nov 9 at 5:42
No and i'm out of ideas. Now i'm trying to start application from selenium test code like in youtube.com/watch?v=xfyDIz7Mk0U. I'll edit main post if i have any updates.
– Krystian721
Nov 9 at 8:31
No and i'm out of ideas. Now i'm trying to start application from selenium test code like in youtube.com/watch?v=xfyDIz7Mk0U. I'll edit main post if i have any updates.
– Krystian721
Nov 9 at 8:31
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53214188%2fconnecting-selenium-driver-to-cef-desktop-application%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
The official
CEF
guide is bitbucket.org/chromiumembedded/cef/wiki/UsingChromeDriver.md Last I checked you couldn't attachSelenium
to an already running instance, has this changed?– amaitland
Nov 9 at 5:42
No and i'm out of ideas. Now i'm trying to start application from selenium test code like in youtube.com/watch?v=xfyDIz7Mk0U. I'll edit main post if i have any updates.
– Krystian721
Nov 9 at 8:31