Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » scout » [neon] Enable HTML Selectors for Selenium
[neon] Enable HTML Selectors for Selenium [message #1759518] Wed, 12 April 2017 05:43 Go to next message
Nick Payne is currently offline Nick PayneFriend
Messages: 3
Registered: February 2017
Junior Member
We will start using Selenium in our project and I was wondering how we would best use selectors for the DOM elements that Scout generates.

When scout.dev.mode is enabled in the config.properties, elements receive the data-modelclass attribute, which is really handy for writing CSS selectors in Selenium. However we don't really want the other effects that dev mode has, like disabled caching. Is it possible to somehow activate only the data attributes on the elements?

The other possibility would obviously be to add class names to the elements we want to use in the Selenium test, however the other approach seems a lot nicer. Or do you have any other ideas?
Re: [neon] Enable HTML Selectors for Selenium [message #1759528 is a reply to message #1759518] Wed, 12 April 2017 14:55 Go to previous messageGo to next message
Andre Wegmueller is currently offline Andre WegmuellerFriend
Messages: 31
Registered: September 2012
Location: Baden-D├Ąttwil, Switzerla...
Member
When Scout runs in dev mode it activates multiple flags at once (see class org.eclipse.scout.rt.server.commons.servlet.UrlHints for details). All these flags can be set separately per session via URL parameters.
So you can run your App with scout.dev.mode=true for your Selenium test case, but call http://localhost:8082/?cache=true if you need to have caching enabled. You can specify this URL when you start your Selenium test. In our own Selenium environment we'd set the "web.app.url" environment variable to do that.

We run our own Selenium tests in dev mode and use the data-modelclass attribute. There are some nice base classes and utility functions in module "org.eclipse.scout.rt.ui.html.selenium" which make it easy to write unit tests with Selenium and Scout. The module "org.eclipse.scout.widgets.ui.html.app.selenium" available on GitHub is probably a good base for your own Selenium tests with Scout, or provides at least some inspiration.

https://github.com/BSI-Business-Systems-Integration-AG/org.eclipse.scout.docs/tree/releases/6.1.x/code/widgets/org.eclipse.scout.widgets.ui.html.app.selenium
Re: [neon] Enable HTML Selectors for Selenium [message #1759533 is a reply to message #1759528] Wed, 12 April 2017 15:33 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie BressonFriend
Messages: 1250
Registered: October 2011
Senior Member
I hope this piece of information is not outdated:

Debug-Flags
Main flag is "debug", is active when the App is started from Eclipse.
When activated, all the other flags are activated.

Other flags:
* inspector: Model-class, Class-ID
* cache: caching from ressources
* compress: GZIP-compression
* minify: text-compression of JS and CSS Files.
Re: [neon] Enable HTML Selectors for Selenium [message #1759563 is a reply to message #1759533] Thu, 13 April 2017 07:17 Go to previous messageGo to next message
Nick Payne is currently offline Nick PayneFriend
Messages: 3
Registered: February 2017
Junior Member
Thanks for the replies! The URL parameters should work just fine.

Is there another way to set scout.dev.mode to true, for example in the system properties, instead of the config.properties file?
Re: [neon] Enable HTML Selectors for Selenium [message #1759859 is a reply to message #1759563] Wed, 19 April 2017 08:18 Go to previous message
Matthias Villiger is currently offline Matthias VilligerFriend
Messages: 124
Registered: September 2011
Senior Member
Yes, all properties can also be set using system properties.

More about this in the documentation.
Previous Topic:Eclipse neon error
Next Topic:How can i integrate jasper reports on scout?
Goto Forum:
  


Current Time: Wed Nov 22 16:56:09 GMT 2017

Powered by FUDForum. Page generated in 0.02602 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software