Safari driver not running tests in multiple browsers

42 views
Skip to first unread message

Nigel

unread,
May 14, 2015, 7:07:08 AM5/14/15
to seleniu...@googlegroups.com
I'm using Selenium WebDriver with Java and testng on a mac. I am using testng.xml as the testrunner, and have it set so that when the suite runs 10 browsers open concurrently, which is working for the firefox driver and the chrome driver. I am finding that when I use the Safari driver only 1 browser runs the tests, the other 9 browers do not run and are shown as skipped in the IDE. Has anyone else experienced this, or have any workarounds? 

Some further details:
1. I am using selenium 2.45.0 and installed safari driver for 2.45. Safari version is 8.0.5, on OS Yosemite
2. Below are details of how I have setup testng.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Suite" verbose="1">
    </test>
    <test name="Main" parallel="classes" thread-count="10">
        <packages>
            <package name="Tests.HomePage"/>
            <package name="Tests.Searches"/>     
        </packages>
    </test>
</suite>

Shawn McCarthy

unread,
May 14, 2015, 10:50:05 AM5/14/15
to seleniu...@googlegroups.com
Try adding preserve-order="false" after thread-count=10.

Krishnan Mahadevan

unread,
May 14, 2015, 10:57:58 AM5/14/15
to Selenium Users
Can you please help share the code that is responsible for instantiating a SafariDriver browser ?

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/df4fbf14-bb05-4337-bde1-dd265a494475%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Nigel

unread,
May 14, 2015, 12:15:59 PM5/14/15
to seleniu...@googlegroups.com
Sure, the following code instantiates the Safari driver:

@BeforeMethod
capabilities = DesiredCapabilities.safari();
SafariOptions safariOptions = new SafariOptions();
safariOptions.setUseCleanSession(true);
capabilities.setCapability(SafariOptions.CAPABILITY, safariOptions);
driver = new SafariDriver(capabilities);
driver.manage().window().maximize();
Reply all
Reply to author
Forward
0 new messages