Automated testing tool for CefSharp CEF3 ?

Do not post support requests, bug reports or feature requests. Discuss CEF here. Non-CEF related discussion goes in General Discussion!

Automated testing tool for CefSharp CEF3 ?

Postby xman » Wed Feb 11, 2015 4:17 pm

Hi,

I've been using watir and selenium webdriver for automated testing for browser based applications.
Now I need to do this for some CEF3 based (with CefSharp) apps.
Is there any tool for such purpose? Or does any one know how to use watir/selenium for CEF3 app automated testing?

Thanks in advance.
xman
Newbie
 
Posts: 5
Joined: Wed Feb 11, 2015 4:12 pm
Location: New York

Re: Automated testing tool for CefSharp CEF3 ?

Postby magreenblatt » Wed Feb 11, 2015 4:32 pm

CEF3 can be automated with Selenium/ChromeDriver. See https://code.google.com/p/chromiumembed ... ail?id=549.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Automated testing tool for CefSharp CEF3 ?

Postby xman » Wed Feb 11, 2015 5:19 pm

Thanks! Will take a look.
xman
Newbie
 
Posts: 5
Joined: Wed Feb 11, 2015 4:12 pm
Location: New York

Re: Automated testing tool for CefSharp CEF3 ?

Postby xman » Mon Feb 16, 2015 2:57 pm

Hi magreenblatt,

I checked the link you provided (and the tutorial) and tried to launch my CEF3 app using the following Ruby scripts:

Code: Select all
require "selenium-webdriver"
Selenium::WebDriver::Chrome.path = 'C:\my_path_to_app\cefapp.exe'
browser = Selenium::WebDriver.for :chrome


My CEF3 app was launched, but got stuck there with the following error:

C:/Ruby200/lib/ruby/2.0.0/net/protocol.rb:158:in `rescue in rbuf_fill': Net::ReadTimeout (Net::ReadTimeout)
from C:/Ruby200/lib/ruby/2.0.0/net/protocol.rb:152:in `rbuf_fill'
from C:/Ruby200/lib/ruby/2.0.0/net/protocol.rb:134:in `readuntil'
from C:/Ruby200/lib/ruby/2.0.0/net/protocol.rb:144:in `readline'
from C:/Ruby200/lib/ruby/2.0.0/net/http/response.rb:39:in `read_status_line'
from C:/Ruby200/lib/ruby/2.0.0/net/http/response.rb:28:in `read_new'
from C:/Ruby200/lib/ruby/2.0.0/net/http.rb:1406:in `block in transport_request'
from C:/Ruby200/lib/ruby/2.0.0/net/http.rb:1403:in `catch'
from C:/Ruby200/lib/ruby/2.0.0/net/http.rb:1403:in `transport_request'
from C:/Ruby200/lib/ruby/2.0.0/net/http.rb:1376:in `request'
from C:/Ruby200/lib/ruby/2.0.0/net/http.rb:1369:in `block in request'
from C:/Ruby200/lib/ruby/2.0.0/net/http.rb:852:in `start'
from C:/Ruby200/lib/ruby/2.0.0/net/http.rb:1367:in `request'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/remote/http/default.rb:83:in `response_for'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/remote/http/default.rb:39:in `request'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/remote/http/common.rb:40:in `call'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/remote/bridge.rb:640:in `raw_execute'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/remote/bridge.rb:101:in `create_session'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/remote/bridge.rb:68:in `initialize'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/chrome/bridge.rb:29:in `initialize'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/common/driver.rb:37:in `new'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/common/driver.rb:37:in `for'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver.rb:67:in `for'


Do you have any idea what it is?
I'm using ChromeDriver 2.14 and selenium-webdriver 2.44.0.

Thanks a lot.
xman
Newbie
 
Posts: 5
Joined: Wed Feb 11, 2015 4:12 pm
Location: New York

Re: Automated testing tool for CefSharp CEF3 ?

Postby magreenblatt » Mon Feb 16, 2015 5:43 pm

I haven't tried the Ruby approach. You might want to test with Chrome and cefclient to verify that it actually works. If it doesn't work with Chrome then you should contact selenium/chromedriver forums or mailing lists for support.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Automated testing tool for CefSharp CEF3 ?

Postby xman » Fri Feb 20, 2015 11:29 am

Hi magreenblatt,

I tried your cefclient (cef_binary_3.2171.1979_windows32_client) on Chrome, with Ruby.

The script is like the following:
Code: Select all
require "selenium-webdriver"
Selenium::WebDriver::Chrome.path = 'C:\cef_binary_3.2171.1979_windows32_client\Release\cefclient.exe'
browser = Selenium::WebDriver.for :chrome
browser.navigate.to url_internal_website
browser.find_element(:xpath, "//input[@name='username']").send_keys my_username
browser.find_element(:xpath, "//input[@name='password']").send_keys my_password
browser.find_element(:xpath, "//button[@type='submit']").click


It didn't give the timeout error on my command console, and the script was finished fine.
But I found that while the client was open, there were 3 processes of cefclient.exe shown in task manager.
After the client closed (File > Exit), there were still 2 processes running in background.
I repeated the above test, every time I ran the script then closed the client, there were 2 extra processes left in background.

The following error was found in log:
Message: %cUnhandled rejection SsoError: Unable to locate SSO Token
at Object.module.exports.run (https://dv5.intcx.net/tribe/00af4867f66 ... js:208:231)
at t.module.exports.t._runTask (https://dv5.intcx.net/tribe/00af4867f66 ... s:204:1131)
at https://dv5.intcx.net/tribe/00af4867f66 ... .js:204:94
at n (https://dv5.intcx.net/tribe/00af4867f66 ... :613:31358)
at s._promiseFulfilled (https://dv5.intcx.net/tribe/00af4867f66 ... :613:20926)
at s.c [as _init$] (https://dv5.intcx.net/tribe/00af4867f66 ... :613:10851)
at new s (https://dv5.intcx.net/tribe/00af4867f66 ... :613:19929)
at a (https://dv5.intcx.net/tribe/00af4867f66 ... :613:20065)
at Function.e.reduce (https://dv5.intcx.net/tribe/00af4867f66 ... :613:21389)
at t.module.exports.t.run (https://dv5.intcx.net/tribe/00af4867f66 ... js:204:940)
at a.module.exports.t._runTaskSequence (https://dv5.intcx.net/tribe/00af4867f66 ... .js:33:493)
at a.module.exports.t.initialize (https://dv5.intcx.net/tribe/00af4867f66 ... .js:33:342)
at t.module.exports.t._initializeConsole (https://dv5.intcx.net/tribe/00af4867f66 ... js:15:1915)
at new t (https://dv5.intcx.net/tribe/00af4867f66 ... .js:15:767)
at Object.113 (https://dv5.intcx.net/tribe/00af4867f66 ... .js:468:62)
at s (https://dv5.intcx.net/tribe/00af4867f66 ... n.js:1:254)
Source: https://dv5.intcx.net/tribe/00af4867f66 ... dle.min.js


Do you have any clue why there are redundant processes left in background?

Interestingly, when I manually ran the test, (i.e. login to the same website with same username and password, then closed the client), there was NO redundant cefclient.exe process left in background.

Thanks a lot for your time.
xman
Newbie
 
Posts: 5
Joined: Wed Feb 11, 2015 4:12 pm
Location: New York

Re: Automated testing tool for CefSharp CEF3 ?

Postby magreenblatt » Fri Feb 20, 2015 12:42 pm

xman wrote:I repeated the above test, every time I ran the script then closed the client, there were 2 extra processes left in background.

It seems like the script is not terminating the cefclient application cleanly.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Automated testing tool for CefSharp CEF3 ?

Postby xman » Wed Feb 25, 2015 10:52 am

Just FYI:

I just found out that the extra 2 processes running in background was due to that I manually closed the browser.
If I let the script does it (browser.quit), everything is OK.
xman
Newbie
 
Posts: 5
Joined: Wed Feb 11, 2015 4:12 pm
Location: New York


Return to CEF Discussion

Who is online

Users browsing this forum: No registered users and 52 guests

cron