Run selenium projects in two browsers from two different installed paths at a time

26 vistas
Ir al primer mensaje no leído

Anand JOis

no leída,
5 jun 2017, 1:32:37 a.m.5/6/2017
para Selenium Users

I have a selenium webdriver project which has child projects as well. Is it possible to run two child projects at a time in two different browsers say firefox installed in default location and another location? The first project should take default location browser and the second project should check if first browser free if not it should go for second browser. Both should run in different instances.

Please let me know if someone has any solution for it

Thanks in advance


private static WebDriver driver;

private static WebDriver driver1;



if (driver == null) {


File pathToBinary = new File("C:\\Users\\Anand Jois\\AppData\\Local\\Mozilla Firefox\\firefox.exe");

FirefoxBinary ffBinary = new FirefoxBinary(pathToBinary);

FirefoxProfile firefoxProfile = new FirefoxProfile();

driver = new FirefoxDriver(ffBinary, firefoxProfile);


if(driver != null){

File pathToBinary2 = new File("C:\\Users\\Anand Jois\\Documents\\firefox.exe");

FirefoxBinary ffBinary2 = new FirefoxBinary(pathToBinary);

FirefoxProfile firefoxProfile2 = new FirefoxProfile();

driver1 = new FirefoxDriver(ffBinary2, firefoxProfile2);

}


I want two different browsers from different locations to execute their respective test cases without disturbing the script. The proejct is Junit Cucumber project


Thanks


Krishnan Mahadevan

no leída,
5 jun 2017, 1:35:53 a.m.5/6/2017
para seleniu...@googlegroups.com

Running a project is a trait of a build system and has got nothing to do with Selenium/WebDriver. Based on your build tool, you might want to post this query on a relevant forum.

 

Your code is not ready for concurrent executions (since you are making use of a static WebDriver reference).

 

 

 

Thanks & Regards

Krishnan Mahadevan

 

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"

My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/772f9df1-7cbd-4f50-bcd3-0a5a3b4a22c1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Responder a todos
Responder al autor
Reenviar
0 mensajes nuevos