How to start and stop Selenium Grid programatically within Serenity framework

546 views
Skip to first unread message

80Vikram

unread,
Dec 19, 2016, 2:34:40 PM12/19/16
to Serenity BDD Users Group
Hi All,

I would like to start and stop Selenium Grid programmatically within Serenity framework

Also register available nodes to the the newly created hub.

Please let me know if this is possible ?

Thanks,
Vikram

80Vikram

unread,
Dec 20, 2016, 8:41:42 AM12/20/16
to Serenity BDD Users Group
Hi John,

Can you please clarify on this query ? Any demo project to refer to ?

I need to start Grid server and later register emulators as nodes ( again from programe itself ) to run appium test cases.

Thanks in advance.

Regards,
Vikram

John Smart

unread,
Dec 20, 2016, 8:44:46 AM12/20/16
to 80Vikram, Serenity BDD Users Group
This is not really the sort of thing that is in the sphere of influence of Serenity. Serenity would be a consumer/user of a Selenium Grid server, but it wouldn't start up and administrate the grid itself.

--
You received this message because you are subscribed to the Google Groups "Serenity BDD Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to thucydides-users+unsubscribe@googlegroups.com.
To post to this group, send email to thucydides-users@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
___________________________________________________
John Smart | Wakaleo Consulting  |  +44 7398 832273
Making smart teams collaborate better
http://johnfergusonsmart.com  |  john....@wakaleo.com
___________________________________________________

We love breaking down silos and helping smart teams collaborate better! Ask about our tailored on-site workshops in Agile Product Planning, BDD Requirements Discovery,  BDD, TDD and Clean Coding, and Advanced BDD Test Automation.
___________________________________________________

80Vikram

unread,
Dec 20, 2016, 8:50:07 AM12/20/16
to Serenity BDD Users Group, vikra...@gmail.com
Hi John,

Thanks for info.

Is there a way I can set value for webdriver.remote.url in the script and consume other places, than passing this value from command prompt ?

Regards,
Vikram


On Tuesday, December 20, 2016 at 2:44:46 PM UTC+1, John Smart wrote:
This is not really the sort of thing that is in the sphere of influence of Serenity. Serenity would be a consumer/user of a Selenium Grid server, but it wouldn't start up and administrate the grid itself.
On 20 December 2016 at 13:41, 80Vikram <vikra...@gmail.com> wrote:
Hi John,

Can you please clarify on this query ? Any demo project to refer to ?

I need to start Grid server and later register emulators as nodes ( again from programe itself ) to run appium test cases.

Thanks in advance.

Regards,
Vikram



On Monday, December 19, 2016 at 8:34:40 PM UTC+1, 80Vikram wrote:
Hi All,

I would like to start and stop Selenium Grid programmatically within Serenity framework

Also register available nodes to the the newly created hub.

Please let me know if this is possible ?

Thanks,
Vikram

--
You received this message because you are subscribed to the Google Groups "Serenity BDD Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to thucydides-use...@googlegroups.com.
To post to this group, send email to thucydid...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

80Vikram

unread,
Dec 22, 2016, 11:20:34 AM12/22/16
to Serenity BDD Users Group, vikra...@gmail.com
Hi John,

I'm updating Serenity + Appium project to do more advance things.

Till date I could achieve starting Selenium Hub, appium nodes ( android emulators ) register through java programme.

Now I'm struck how to run test case in parallel on available emulators ?

mvn clean verify -Dwebdriver.remote.url=http://127.0.0.1:4444/wd/hub -Dwebdriver.remote.driver=appium

It's not able to run test on any of the available emulators

It's picking up properties from serenity.properties file ( which I use to run on single mobile )

Please clarify

Thanks,
Vikram

80Vikram

unread,
Dec 22, 2016, 11:32:47 AM12/22/16
to Serenity BDD Users Group, vikra...@gmail.com
Hi John,

I've revisited section http://www.thucydides.info/docs/serenity/#_running_tests_against_a_selenium_grid_server

In case of appium, I need to mention

appium.hub ( how to give multiple values, in case of multiple emulators and/or devices , as each will have its unique IP address )

appium.deviceName ( same query applies here as well )

Please clarify

Thanks,
Vikram

80Vikram

unread,
Dec 23, 2016, 1:13:35 AM12/23/16
to Serenity BDD Users Group, vikra...@gmail.com
Hi John,

Some more issues, I've removed all the flags related to appium from serenity.properties file

Later ran below command

mvn clean verify -Drun.parallel=true -Dwebdriver.remote.url=http://127.0.0.1:4444/wd/hub -Dwebdriver.remote.driver=appium -Dappium.platformName=Android -Dappium.browserName=Chrome

below error is thrown

[pool-1-thread-1] INFO net.serenitybdd.core.webdriver.driverproviders.RemoteDriverProvider - Building remote driver with capabilitites Capabilities [{record-screenshots=false, browserName=Chrome, idle-timeout=180, platformName=Android}]
[pool-1-thread-1] ERROR net.thucydides.core.webdriver.WebDriverFacade - FAILED TO CREATE NEW WEBDRIVER_DRIVER INSTANCE class org.openqa.selenium.firefox.FirefoxDriver: Could not instantiate new webdriver instance of type class org.openqa.selenium.firefox.FirefoxDriver (Error forwarding the new session cannot find : Capabilities [{record-screenshots=false, browserName=Chrome, idle-timeout=180, platformName=Android}]
Command duration or timeout: 126 milliseconds
Build info: version: '2.53.1', revision: 'a36b8b1cd5757287168e54b817830adce9b0158d', time: '2016-06-30 19:26:09'
System info: host: 'Vikrams-MacBook-Pro.fritz.box', ip: '192.168.178.21', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.11.6', java.version: '1.8.0_102'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
net.thucydides.core.webdriver.UnsupportedDriverException: Could not instantiate new webdriver instance of type class org.openqa.selenium.firefox.FirefoxDriver (Error forwarding the new session cannot find : Capabilities [{record-screenshots=false, browserName=Chrome, idle-timeout=180, platformName=Android}]
Command duration or timeout: 126 milliseconds
Build info: version: '2.53.1', revision: 'a36b8b1cd5757287168e54b817830adce9b0158d', time: '2016-06-30 19:26:09'
System info: host: 'Vikrams-MacBook-Pro.fritz.box', ip: '192.168.178.21', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.11.6', java.version: '1.8.0_102'
Driver info: org.openqa.selenium.remote.RemoteWebDriver[pool-1-thread-2] INFO net.serenitybdd.core.webdriver.driverproviders.RemoteDriverProvider - Building remote driver with capabilitites Capabilities [{record-screenshots=false, browserName=Chrome, idle-timeout=180, platformName=Android}]


Not sure why serenity is trying to create FF browser, also I need to run native automation and not on browser, is there a way to skip flag appium.browserName ?

Thanks,
Vikram

80Vikram

unread,
Dec 23, 2016, 1:16:04 AM12/23/16
to Serenity BDD Users Group, vikra...@gmail.com
In the POC project I had shared earlier, has got below flags in serenity.properties file and it works fine.

webdriver.driver= appium
appium.browserName = ""
appium.platformName = Android
appium.platformVersion = 5.0.1
appium.deviceName  = d6e4f8d6
appium.app =  ADD_FULL_PATH_HERE/Flipkart.3.0.apk
appium.hub = http://localhost:4723/wd/hub

I need to replicate this for grid situation as well.

Kindly help to solve this last piece of puzzle.

Thanks again.

80Vikram

unread,
Dec 23, 2016, 6:33:13 AM12/23/16
to Serenity BDD Users Group, vikra...@gmail.com
I could make some baby steps progress on this problem

https://github.com/serenity-bdd/serenity-core/issues/637

currently struck with passing available devices' names.

Grid & appium experts kindly help.


Merry X-mas everyone. 

Regards,
Vikram

80Vikram

unread,
Dec 28, 2016, 5:35:58 AM12/28/16
to Serenity BDD Users Group, vikra...@gmail.com
Hi John,

Can you please look into this query and help

Thanks & Regards,
Vikram

80Vikram

unread,
Dec 31, 2016, 1:45:56 AM12/31/16
to Serenity BDD Users Group, vikra...@gmail.com

I've updated subject as earlier one was not related.

Anybody is able to run test cases in parallel with serenity + appium setup ?

I'm not sure how to pass multiple device or emulators  names/id to grid.

https://github.com/serenity-bdd/serenity-core/issues/637

Thanks & Regards,
Vikram
Reply all
Reply to author
Forward
0 new messages