Error when running Sauce Labs, C# and Selenium tests using

63 views
Skip to first unread message

Thangadurai S

unread,
Aug 11, 2015, 1:08:47 AM8/11/15
to gallio-user
Hi All,


I am trying to run all my Selenium Webdriver +C#  tests in sauce lab. This requires Gallio.

When i tried the code mentioned here http://www.joecolantonio.com/2015/05/12/how-to-run-a-net-c-test-in-sauce-labs/. i get the below error

A fatal exception occurred while exploring tests.  Possible causes include invalid test runner parameters.
Gallio.Model.ModelException: An exception occurred while invoking a test driver. ---> System.Runtime.Serialization.SerializationException: Type 'Microsoft.Cci.Pdb.PdbDebugException' in Assembly 'Gallio, Version=3.4.0.0, Culture=neutral, PublicKeyToken=eb9cfa67ee6ab36e' is not marked as serializable.
HResult: -2146233076

Server stack trace: 
   at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter, SerializationBinder binder)
   at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Write(WriteObjectInfo objectInfo, NameInfo memberNameInfo, NameInfo typeNameInfo)
   at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck)
   at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph, Header[] headers, Boolean fCheck)
   at System.Runtime.Remoting.Channels.BinaryServerFormatterSink.SerializeResponse(IServerResponseChannelSinkStack sinkStack, IMessage msg, ITransportHeaders& headers, Stream& stream)
   at System.Runtime.Remoting.Channels.BinaryServerFormatterSink.ProcessMessage(IServerChannelSinkStack sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders, Stream requestStream, IMessage& responseMsg, ITransportHeaders& responseHeaders, Stream& responseStream)

Exception rethrown at [0]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at Gallio.Model.Isolation.HostedTestIsolationContext.RunIsolatedTaskDelegate.EndInvoke(IAsyncResult result)
   at Gallio.Model.Isolation.HostedTestIsolationContext.RunIsolatedTaskInHost[TIsolatedTask](HostSetup hostSetup, StatusReporter statusReporter, Object[] args) in c:\Server\Projects\MbUnit v3\Work\src\Gallio\Gallio\Model\Isolation\HostedTestIsolationContext.cs:line 127
   at Gallio.Model.Isolation.HostedTestIsolationContext.RunIsolatedTaskImpl[TIsolatedTask](HostSetup hostSetup, StatusReporter statusReporter, Object[] args) in c:\Server\Projects\MbUnit v3\Work\src\Gallio\Gallio\Model\Isolation\HostedTestIsolationContext.cs:line 83
   at Gallio.Model.DotNetTestDriver.ExploreOrRunAssembly(ITestIsolationContext testIsolationContext, TestPackage testPackage, TestExplorationOptions testExplorationOptions, TestExecutionOptions testExecutionOptions, RemoteMessageSink remoteMessageSink, IProgressMonitor progressMonitor, String taskName, FileInfo file) in c:\Server\Projects\MbUnit v3\Work\src\Gallio\Gallio\Model\DotNetTestDriver.cs:line 195
   at Gallio.Model.DotNetTestDriver.ExploreOrRun(ITestIsolationContext testIsolationContext, TestPackage testPackage, TestExplorationOptions testExplorationOptions, TestExecutionOptions testExecutionOptions, IMessageSink messageSink, IProgressMonitor progressMonitor, String taskName) in c:\Server\Projects\MbUnit v3\Work\src\Gallio\Gallio\Model\DotNetTestDriver.cs:line 156
   at Gallio.Model.DotNetTestDriver.ExploreImpl(ITestIsolationContext testIsolationContext, TestPackage testPackage, TestExplorationOptions testExplorationOptions, IMessageSink messageSink, IProgressMonitor progressMonitor) in c:\Server\Projects\MbUnit v3\Work\src\Gallio\Gallio\Model\DotNetTestDriver.cs:line 141
   at Gallio.Model.DefaultTestFrameworkManager.FilteredTestDriver.<>c__DisplayClass1b.<ExploreImpl>b__19(ITestDriver driver, IList`1 items, Int32 driverCount) in c:\Server\Projects\MbUnit v3\Work\src\Gallio\Gallio\Model\DefaultTestFrameworkManager.cs:line 446
   at Gallio.Model.DefaultTestFrameworkManager.FilteredTestDriver.ForEachDriver[T](MultiMap`2 testFrameworkPartitions, Func`4 func) in c:\Server\Projects\MbUnit v3\Work\src\Gallio\Gallio\Model\DefaultTestFrameworkManager.cs:line 528
   --- End of inner exception stack trace ---
HResult: -2146233088
   at Gallio.Model.DefaultTestFrameworkManager.FilteredTestDriver.ForEachDriver[T](MultiMap`2 testFrameworkPartitions, Func`4 func) in c:\Server\Projects\MbUnit v3\Work\src\Gallio\Gallio\Model\DefaultTestFrameworkManager.cs:line 534
   at Gallio.Model.DefaultTestFrameworkManager.FilteredTestDriver.ExploreImpl(ITestIsolationContext testIsolationContext, TestPackage testPackage, TestExplorationOptions testExplorationOptions, IMessageSink messageSink, IProgressMonitor progressMonitor) in c:\Server\Projects\MbUnit v3\Work\src\Gallio\Gallio\Model\DefaultTestFrameworkManager.cs:line 439
   at Gallio.Runner.DefaultTestRunner.Explore(TestPackage testPackage, TestExplorationOptions testExplorationOptions, IProgressMonitor progressMonitor) in c:\Server\Projects\MbUnit v3\Work\src\Gallio\Gallio\Runner\DefaultTestRunner.cs:line 242


Code that i have used : 

using Gallio.Framework;
using MbUnit.Framework;
using OpenQA.Selenium;
using OpenQA.Selenium.Remote;
using System;
using Gallio.Model;
using System.Linq;
using System.Threading.Tasks;
using OpenQA.Selenium.Support.UI;
using System.Text;


namespace RunInSauce
{
    [TestFixture]
    [Header("browser", "version", "platform")]
    [Row("chrome", "42", "Windows 10")]
    [Row("firefox", "35", "Windows 10")]
    public class Class1
    {
        [Test, Parallelizable]
        public void SimpleTest(string browser, string version, string platform)
        {
            Uri commandExecutorUri = new Uri("http://ondemand.saucelabs.com/wd/hub");
            DesiredCapabilities desiredCapabilites = new DesiredCapabilities(browser, version, Platform.CurrentPlatform);
            desiredCapabilites.SetCapability("platform", "Windows 10");
            desiredCapabilites.SetCapability("username", "thangadurais");
            desiredCapabilites.SetCapability("accessKey", "1700c16d-4786-4b54-9ec5-23f9d1ce856f");
            desiredCapabilites.SetCapability("name", TestContext.CurrentContext.Test.Name);
            var _Driver = new RemoteWebDriver(commandExecutorUri, desiredCapabilites);
            _Driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(30));
            // navigate to the page under test
            _Driver.Navigate().GoToUrl("http://www.joecolantonio.com/SeleniumTestPage.html");
            // verify the page title is correct
            Assert.Contains(_Driver.Title, "Selenium WebDriver Validation");
            _Driver.Quit();


        }
    }
}


Screenshots for reference : http://screencast.com/t/CILx6DFo8Kg

Can anyone say when went wrong?


Thanks in advance !

Thangadurai
Reply all
Reply to author
Forward
0 new messages