Selenium WebDriver for Automation of NW.js Desktop based web technologies implemented

576 views
Skip to first unread message

Vijay Pusuluri

unread,
Feb 2, 2016, 4:24:32 AM2/2/16
to webdriver

Hi 

Iam trying to Automate my application which is a standalone application build using NW.JS technologies. and based on chromium embedded framework NW.JS is a desktop application with web technologies implementation. The Application to be tested is actually embedded inside the Web Took Kit and looks like a normal window application. It does not make use any of the traditional browsers(IE/Firefox/Chrome/Safari) I automated the basic login functionality of my application using selenium web driver and python script and when i run it, it invokes my application but unable to identify the objects in the App. I tried with other testing tools, like UFT TestComplete White Ranorex WinTask

All of these tools are invoking my application, but unable to identify the objects inside the App like login link etc. when i use object spy,it always highlights the main window only and does not identifies the objects inside the application My developer was saying that the app uses web view tag? developer has given us the Chrome Dev tools, using which we can inspect the objects properties, but despite this i still see errors when i try to run my automation script developed in selenium python script Not sure which testing framework and test automation tools will match my requirements Any one can please guide me, Iam struggling with the Test Automation tools to make it identify the objects inside the application The Application is built using CSS3.0,HTML5.0,JavaScript,C++ and node.js Technologies


i see that the latest version chromedriver-nw-v0.12.3-win-x64.zip----belongs to chromedriver 2.13 version, can you please let me know what is the corresponding version for chromedriver 2.20
can i get the chromedriver-nw-vx.x.x-win-x64.zip version for chromedrive 2.20 version.
Hope you will reply to my mail.
please help me, iam struggling to automate my nw.js desktop based application,due to lack of chrome version 2.20 bundled with nw.js?
Thanks in Advance

David

unread,
Feb 2, 2016, 5:56:44 PM2/2/16
to webdriver
You should do online search for something like "nw.js selenium" to see what are your options. can also search for "webdriver" or "chromedriver" in place of "selenium" in that search term.

Doing a brief search gave me these results which seem most helpful to you:


this one seems specific to JS-based testing, so you may have to switch away from Python for this...

Vijay Pusuluri

unread,
Feb 3, 2016, 6:33:52 AM2/3/16
to webdriver
Hi,
     Already done the R&D for which you have specified, but with no result, hence with a hope for a solution to my problem, posted in this group. Anyway thanks for your suggestions.

Thanks,
Vijay

David

unread,
Feb 4, 2016, 4:09:32 PM2/4/16
to webdriver
Sadly based on your research, this indicates you are likely one of the first to deal with this kind of scenario, and no one has the knowledge and/or time to implement a solution for it. It would seem nw.js apps and functional/UI testing them is not a very common use case at present, maybe in the future...

Vijay Pusuluri

unread,
Feb 6, 2016, 9:24:17 AM2/6/16
to webdriver
Hello David,
                      Thanks for your response.probably you may be true. and iam still not sure whether we can use selenium web driver to automate nw.js sort of applications
Iam still struggling to automate my application.
first i was struggling to invoke my application,but luckly i managed to invoke my application finally
but now i have issue clicking on the login link of my application.selenium simply does not click on the link. i tried with both java and python, and i always see the "chrome not reachable error"
with chromedriver version 2.20

Thanks
Vijay

PeterJeffreyGale

unread,
Feb 6, 2016, 1:40:33 PM2/6/16
to webdriver
Webdriver can only control instances of browsers that it has launched for itself.

If you can't launch your app with one of the existing drivers, then you can't use webdriver.

There is no driver for chromium, I believe, and even if there were, webdriver could not launch it in embedded mode.

Is there not a URL for your app so that you can launch you app directly in a browser such as chrome, and test the browser aspects of your app as far as possible from there?

Vijay Pusuluri

unread,
Feb 7, 2016, 12:20:21 AM2/7/16
to webdriver
Hi Peter
                 Thanks for your response.
                 Our Application is built using nw.js technology, saying that what i mean is that nw.js are desktop based web technologies implemented(JavaScript,CSS3.0,HTML5.0,node.js and C++)
This nw.js technology is browser independent.it does not makes use of any of the traditional browsers(IE/googleChrome/firefox/safari). so using nw.js technology we can built our own customized browser like window.ie customized browser.
and endusers can simple open the browser from the desktop by double clicking it.hence no browsers are required to invoke the app.
Our application acts like a desktop application upto the point of invokng the application, once application is launched, then it works like a web application.
Our application is embedded inside the node webkit window based on the chromium embedded framework, whcih is now called as nw.js 
we indeed have url for our application,previously we used to launch our application from the browser
and we have couple of automation scripts to test the functionality, but in the recent past, the developers switched from browser to node webkit window to launch the application.
and now we have  stopped  the use of browsers, and the application will be shipped to the end users in the form of window like application(ie desktop application)
and my problem starts from here. but Roger-Wang  says that we can use selenium webdriver for automation of nw.js based applications. and iam still struggling to automate our test cases.
Any help from anyone would be greatly appreciated.

Thanks,
Vijay

PeterJeffreyGale

unread,
Feb 7, 2016, 6:23:56 AM2/7/16
to webdriver
I'm sure you can't use webdriver if it's an embedded web app. If ROger Wang thinks you can do it, ask him how.

David

unread,
Feb 7, 2016, 7:24:29 PM2/7/16
to webdriver
Vijay,

3 comments:

* Who is Roger Wang?

* It sounds like in the past, your app was a web app run in a chosen browser (IE, FF, Chrome). In such case, I would check with your developers whether there is any specific nw.js/node.js functionality that the new app uses (e.g. it calls some node.js javascript modules that don't run standalone in a regular browser as regular javascript code). If there is no specific functionality added (e.g. they just wrapped the web app in nw.js so that it can launch as a Windows executable, meaning it is the same code that can run as a regular web app without nw.js) and assuming this web app just talks to some servers at your company over the internet or is entirely client side (no server side code communication to PHP, ASP.Net, Java, etc.) then there is actually no external dependencies that would break for a pure Selenium automated test. Meaning, instead of launching the nw.js executable, just use Selenium to open up browser to the index.html page that the nw.js executable opens. And continue the automated testing from there with Selenium. If Selenium has trouble opening local HTML files for testing, you'll need to run a local web server for automation testing so that http://localhost or http://localhost:8080 (or some port) loads the index.html file. You only can't do this approach if the new app really uses node.js server side modules that won't run standalone in browser (hence the need to run inside nw.js).

* and last, whatever Roger Wang said, to be able to use Selenium to drive a true nw.js app requires a custom Selenium ChromeDriver (server) that knows how to launch nw.js and control it from there as if it was a Chrome browser. I've seen some mentions of this online but they only mention you can then navigate to some web URL, none that mention local file URLs nor continuing test from default page that nw.js loads after starting up. I don't think anyone has customized ChromeDriver server binary to go that far yet. Maybe you should contact the Chromium/ChromeDriver team or the nw.js team to get their inputs on how to automate your stuff.

Vijay Pusuluri

unread,
Feb 13, 2016, 9:45:59 AM2/13/16
to webdriver
David,
            Thanks for your response.

Roger Wang is the founder of the NW.js Technology,yes you are correct, in the past we used to open our application in a web browser now they have removed support for the browser, and instead end users can now open the application by simply double clicking on the app exe
this SDK build flavour has a customized chrome driver which can interact with nw.js application
the proof is iam able to launch my application However my problem starts from here,after my application is invoked,selenium is unable to identify the login link and thus fails to click the login element. Our developers are saying that the webpage is embedded inside a webview tag
and i think selenium can handle, only windows and frames/iframes,
and not web views, but from the chrome documentation, i see that then chromedriver 2.20 
supports web view tags, but then iam not sure about it I Already had couple of discussions, with Roger Want, but so far he could not give a solution.He says that it is possible to automate nw.js applications using selenium web driver, you can view all the discussions i had with Roger Want in the nw.js Google groups
Iam still wondering whether we can use selenium web driver for automation of nw.js applications
Still struggling to find a solution to my problem with selenium webdriver
Any help from anyone would be greatly appreciated

Thanks,
Vijay

==========================================================================
Reply all
Reply to author
Forward
0 new messages