Home > Mobile >  Multiple versions of the same dependency in Maven for same java project
Multiple versions of the same dependency in Maven for same java project

Time:12-30

I want to use different selenium versions (3.141.59 and 4.1.0) for running my project in chrome and firefox browser and android, Is it possible to use different version of selenium dependency in POM for different browsers in same JAVA project?, if so how it will code.

CodePudding user response:

You can define, but only one will be picked at a time !

As per maven documentation

Dependency mediation - this determines what version of an artifact will be chosen when multiple versions are encountered as dependencies. Maven picks the "nearest definition". That is, it uses the version of the closest dependency to your project in the tree of dependencies. You can always guarantee a version by declaring it explicitly in your project's POM. Note that if two dependency versions are at the same depth in the dependency tree, the first declaration wins

Read more about it here https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html

Ideally I'll suggest to you to use a stable version of selenium compatible with both browsers !

CodePudding user response:

Thanks for your reply, Below is the issue that we are facing. At present we are working with selenium 3.141.59 version but to resolve the below conflict planning to try selenium 4 version..

how to make control goes into the browser window? My project is using robot class for entering username and password in URL, since the pop up for entering fields are not web elements hence we used robot class keys concept for entering the values. But during sequential execution in all browsers, some times controls is not going inside the browser when the keys are initiating from robot class function. How this can perform?

  • Related