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

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Anand JOis

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


--
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 [hidden email].
To post to this group, send email to [hidden email].
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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

⇜Krishnan Mahadevan⇝

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/

 

From: <[hidden email]> on behalf of Anand JOis <[hidden email]>
Reply-To: <[hidden email]>
Date: Monday, June 5, 2017 at 11:02 AM
To: Selenium Users <[hidden email]>
Subject: [selenium-users] Run selenium projects in two browsers from two different installed paths at a time

 

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

 

--
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 [hidden email].
To post to this group, send email to [hidden email].
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.

--
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/6B659E06-5999-4D70-9F23-5CE71A9C55B4%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
Loading...