Skip to content
This repository has been archived by the owner on Nov 23, 2021. It is now read-only.

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

Open
varmavg opened this issue Aug 20, 2020 · 18 comments
Open

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

varmavg opened this issue Aug 20, 2020 · 18 comments
Labels

Comments

@varmavg
Copy link

varmavg commented Aug 20, 2020

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
Copy link
Author

varmavg commented Aug 21, 2020

can any one help us ?

does Serenity support new Edge Chromium?

@wakaleo
Copy link
Member

wakaleo commented Aug 21, 2020

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
Copy link
Author

varmavg commented Aug 21, 2020

ok thank you

@Chelinadevi
Copy link

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
Copy link

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

@varmavg
Copy link
Author

varmavg commented Apr 15, 2021

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
Copy link

@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
Copy link
Author

varmavg commented Apr 16, 2021

(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
Copy link

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

@moebius23
Copy link

moebius23 commented May 19, 2021

@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
Copy link

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
Copy link

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
Copy link

juanquiceno2000 commented Nov 21, 2021

@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
Copy link

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
Copy link

moebius23 commented Nov 21, 2021

@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
Copy link

@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
Copy link

Is there any update on this?

@wakaleo
Copy link
Member

wakaleo commented Nov 22, 2021

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.

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

No branches or pull requests

9 participants