Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

capability with a colon #1479

Closed
Oagile opened this issue Dec 8, 2018 · 19 comments
Closed

capability with a colon #1479

Oagile opened this issue Dec 8, 2018 · 19 comments

Comments

@Oagile
Copy link

Oagile commented Dec 8, 2018

Hi,

I have a driver capability that i want to set "e34:token". on the serenity.properties i have serenity.driver.capabilities="e34:token:cccccccccccc" . The problem i'm having is the capability that i want to set has a colon in it :-(, is there a way for me to programatically set capability before the driver is instantiated?

On my old tests i have something like this :
ChromeOptions options = new ChromeOptions();
options.setCapability("e34:token", "cccccccccccc");

 try {
                driver = new RemoteWebDriver(new URL("http://xxxxxx.xxxxxx.xx/wd/hub"), options);
            } catch (MalformedURLException e) {
                e.printStackTrace();
            }

Below is the exception that i'm getting with serenity
Build info: version: '3.7.1', revision: '8a0099a', time: '2017-11-06T21:01:39.354Z'
System info: host: 'LW09643872', ip: '172.27.248.48', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_161'
Driver info: driver.version: DefaultRemoteDriver
net.thucydides.core.webdriver.UnsupportedDriverException: Could not instantiate new WebDriver instance of type class org.openqa.selenium.firefox.FirefoxDriver (A test token needs to be provided via the e34:token capability. http://x.x.x.xx:xxx/ui/test-projects/selfservice

@wakaleo
Copy link
Member

wakaleo commented Dec 8, 2018

Could you post your serenity.properties or serenity.conf file?

@Oagile
Copy link
Author

Oagile commented Dec 8, 2018

Define the default driver

#webdriver.driver=chrome
webdriver.gecko.driver=src/drivers/geckodriver.exe
webdriver.chrome.driver=src/drivers/chromedriver.exe
webdriver.wait.for.timeout=20000

chrome.switches=--args -disable-extensions
chome_preferences.disable_infobars=true
chome.switches=useAutomationExtension=false

serenity.logging=QUIET
webdriver.remote.url=http://xxxxxxx.xxxxx.xx/wd/hub
webdriver.remote.os=WINDOWS
serenity.driver.capabilities="e34:token:ccccccccc"

@Oagile
Copy link
Author

Oagile commented Dec 8, 2018

The exception is


[main] ERROR net.serenitybdd.core.Serenity - TEST FAILED AT STEP Given user navigates to SGATE homepage on his browser
[main] ERROR net.serenitybdd.core.Serenity - Could not instantiate new WebDriver instance of type class org.openqa.selenium.firefox.FirefoxDriver (A test token needs to be provided via the e34:token capability. http://x.x.x.x:xxxx/ui/test-projects/selfservice
[main] ERROR net.serenitybdd.core.Serenity -

@Oagile
Copy link
Author

Oagile commented Dec 10, 2018

Hi John, any recommendations?

@wakaleo
Copy link
Member

wakaleo commented Dec 10, 2018

Handling the colon needs a change to the code, but your reports mention Firefox rather than chrome, so you may also need to add serenity.remote.driver=chrome.

@Oagile
Copy link
Author

Oagile commented Dec 10, 2018

Much appreciated I have updated remote driver,

I guess handling it the colon will be on future releases?

@Oagile
Copy link
Author

Oagile commented Dec 11, 2018

much appreciated Liviu, with the code that you have commited i guess the below config should work?

serenity.driver.capabilities="e34:token:ccccccccc"

Where can i get the build artifact of serenity-core that contains your commit? i understand that it won't be a released version

@cliviu
Copy link
Collaborator

cliviu commented Dec 11, 2018

hi @Oagile , yes, it should work , see the tests from the commit
Stay tuned, a new version will come out soon I think.

@Oagile
Copy link
Author

Oagile commented Dec 11, 2018

awesomeness @cliviu

@wakaleo
Copy link
Member

wakaleo commented Jan 23, 2019

Fixed.

@wakaleo wakaleo closed this as completed Jan 23, 2019
@Oagile
Copy link
Author

Oagile commented Jan 24, 2019

much appreciated, i guess that will be this dependency

net.serenity-bdd serenity-core 2.0.33

@wakaleo
Copy link
Member

wakaleo commented Jan 24, 2019

Yes. The rule is that all options need to be prefixed with “—“

@Oagile
Copy link
Author

Oagile commented Jan 24, 2019

awesomeness, busy updating project dependencies.

hmmm not sure if i follow John .i.e. regarding the prefix. e.g?

@wakaleo
Copy link
Member

wakaleo commented Jan 24, 2019

Actually, the prefix (two dashes) is only needed for Chrome options

@Oagile
Copy link
Author

Oagile commented Jan 24, 2019

ooh got that... much appreciated

@Oagile
Copy link
Author

Oagile commented Jan 24, 2019

       __  _____ _____ ____ _____   _____ _    ___ _     _____ ____

_ / / |_ | / | _| | / \ | _| | | ___| _
(
)
| | | | | | _ \ | | | |
/ _ \ | || | | | | | | |
|| | | | | | ) || | | / ___ \ | || || || || |
(
) | | |
| |_____|
/ || ||// __||__|____/
_\

TEST FAILED WITH ERROR: Create a vehicle Group

[main] ERROR net.thucydides.core.steps.ConsoleLoggingListener - TEST FAILED AT STEP Given user navigates to SGATE homepage on his browser
[main] ERROR net.thucydides.core.steps.ConsoleLoggingListener - Could not instantiate new WebDriver instance of type class org.openqa.selenium.firefox.FirefoxDriver (A test token needs to be provided via the e34:token capability. http://xx.xx.x.xx:4444/ui/test-projects/selfservice

@Oagile
Copy link
Author

Oagile commented Jan 24, 2019

inside serenity.properties i have

serenity.driver.capabilities="e34:token:99999999-xxxx-xx"

@Oagile
Copy link
Author

Oagile commented Jan 24, 2019

bummer, i have removed the quotes.... all good...

Happiness :-)

@Paulo1661
Copy link

Hi, i want to pass this option : serenity.driver.capabilities=se:downloadsEnabled:true.
But doesn't work as i expected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants