serenity-bdd / serenity-cucumber

Cucumber integration for the Serenity BDD Reporting library
Other
78 stars 74 forks source link

how do we pass edge option from serenity.property file ? #246

Open varmavg opened 3 years ago

varmavg commented 3 years ago

We are getting pop up message “we couldn’t load the extensions from:” when trying to open Edge (chromium).

We handled this in chrome like chrome.switches = -disable-extensions

Just wondering if there is there anything equivalent to chrome.switches in Edge chromium to provide options in sereity.properties ?

popup

varmavg commented 3 years ago

can any one help us ?

does Serenity support new Edge Chromium?

wakaleo commented 3 years ago

I don’t use Edge or Windows myself, so the best would be to look into the code and see what you need to do to add support for these options

varmavg commented 3 years ago

ok thank you

Chelinadevi commented 3 years ago

Hi,

I am working on serenity framework for UI automation, and I need to run my test on Edge browser as well, there are few which I am facing when I run on edge browser. I am using msedgedriver.exe(Chromium) The error i am getting is could not instantiate Webdriver.

Could you pls help with the edge options that I need to use in serenity properties file?

Thanks in Advance

kiranAdiga commented 3 years ago

@varmavg were you able to run yours tests successfully on microsoft edge chromium browser successfully.?

varmavg commented 3 years ago

yes we were able to run successful tests in Edge chromium. use edge chromium 32 bit driver (x86 version) https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/

kiranAdiga commented 3 years ago

@varmavg Thanks for the quick response. Can you let me know what is that you passed in serenity.conf file or anything that you would have done to run your tests on edge chromium browser using serenity .

varmavg commented 3 years ago

(1) POM.xml here is my configurations

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
    <serenity.version>2.0.40</serenity.version>
    <serenity.maven.version>2.0.40</serenity.maven.version>
    <serenity.cucumber.version>1.9.31</serenity.cucumber.version>
    <tags></tags>
    <parallel.tests>4</parallel.tests>
    <webdriver.base.url></webdriver.base.url>
    <webdriver.driver>edge</webdriver.driver>
    <!-- <webdriver.driver>iexplorer</webdriver.driver> -->
    <parallel.tests>3</parallel.tests>
</properties>

(2) Serenity.properties

chrome

webdriver.chrome.driver=C:\Automation\Drivers\chromedriver.exe chrome.switches=--start-maximized --ignore-urlfetcher-cert-requests --ignore-certificate-errors --disable-machine-cert-request -disable-extensions

edge

webdriver.edge.driver=C:\Automation\Drivers\msedgedriver.exe

(3) installed 32bit Edge drive (compatible with you edge version) in above location.

(4) run configuration clean verify

kiranAdiga commented 3 years ago

@varmavg Thanks for the response. Looks like in the latest versions of serenity ,running scenarios on chromium edge browser is not possible.

moebius23 commented 3 years ago

@kiranAdiga Have you tried to remove the path of the Edge webdriver of the serenity.conf. And put the following code in the object inheriting from PageObject and that all of your custom PageObject inherit from :

    static{
        System.setProperty("webdriver.edge.driver", "your/path/to/the/webdriver/msedgedriver.exe");
    }

It worked for me.

mrjcohen commented 2 years ago

Does anyone know if this has been fixed as to be able to pass edgedriver within the serenity.config file like we do with other web drivers?

brunofelix1711 commented 2 years ago

i am also trying to pass edge driver from edge.properties file but it was not working for me and also i tried with webdriver manager it launching the browser of different version .

errors

[main] INFO net.serenitybdd.core.webdriver.driverproviders.ProvideNewDriver - Instantiating driver [main] INFO net.serenitybdd.core.webdriver.driverproviders.ProvideNewDriver - Driver capabilities: Capabilities {browserName: MicrosoftEdge, loggingPrefs: org.openqa.selenium.logging...}

juanquiceno2000 commented 2 years ago

@moebius23 Hello could you please help me with the solution that you shared before?? I Should set this static{ System.setProperty("webdriver.edge.driver", "your/path/to/the/webdriver/msedgedriver.exe"); } Where exactly??? I'm new in SerenityBDD and I need to run a couple of tests on Edge. Thanks.

juanquiceno2000 commented 2 years ago

Does anyone know if this has been fixed as to be able to pass edgedriver within the serenity.config file like we do with other web drivers?

No, is not working through Serenity.confing file.

moebius23 commented 2 years ago

@moebius23 Hello could you please help me with the solution that you shared before?? I Should set this static{ System.setProperty("webdriver.edge.driver", "your/path/to/the/webdriver/msedgedriver.exe"); } Where exactly??? I'm new in SerenityBDD and I need to run a couple of tests on Edge. Thanks. So in my serenity.conf file, I have set "webdriver.driver = edge".

In my project, every part of the front have its PageObject inheriting from net.serenitybdd.core.pages.PageObject (example: NavigationPage, HeaderPage, ProductsPage, and so on). But they don't inherit directly. I have an object than inherit from PageObject, and every specialised Page inherit from. Let's call it MyProjectPage.

Then the inheritance path should look like this: PageObject->MyProjectPage->ProductsPage

I have put the static block that we are talking about inside MyProductPage class, at the beginning.

I hope it will work for you !

juanquiceno2000 commented 2 years ago

@moebius23 Hello could you please help me with the solution that you shared before?? I Should set this static{ System.setProperty("webdriver.edge.driver", "your/path/to/the/webdriver/msedgedriver.exe"); } Where exactly??? I'm new in SerenityBDD and I need to run a couple of tests on Edge. Thanks. So in my serenity.conf file, I have set "webdriver.driver = edge".

In my project, every part of the front have its PageObject inheriting from net.serenitybdd.core.pages.PageObject (example: NavigationPage, HeaderPage, ProductsPage, and so on). But they don't inherit directly. I have an object than inherit from PageObject, and every specialised Page inherit from. Let's call it MyProjectPage.

Then the inheritance path should look like this: PageObject->MyProjectPage->ProductsPage

I have put the static block that we are talking about inside MyProductPage class, at the beginning.

I hope it will work for you !

@moebius23 Thank you Sir!!!!! It worked perfect!!!

juan2three commented 2 years ago

Is there any update on this?

wakaleo commented 2 years ago

Is there any update on this?

It's an open source project: look in the code (EdgeDriverCapabilities and WhenConfiguringEdgeOptions, get an example working with your code, write up some documentation, and submit a PR to the documentation project.