How to set up Selenium to work with Visual Studio .NET using C#? -


I tried Google, but there are many different ways to work with Selenium I am using: - Windows 2003 Server - Visual Studio 2008 - Install Selenium IDE through Facebook - Animatit 2.5 is copied into C: - Selenium RC has been copied to C: \

  1. I first created a Library Project using C #.
  2. And this is my class:
 using the system; Using System.Text; Using System.Text.RegularExpressions; Using System.Threading; Using NUnit.Fraamework; Using Selenium; Name space SeleniumTest {[TestFeacions] Public Class Newtest {Private Isleenium Selenium; Private stringbuilder verification etar; [Set Up] Public Zero SetupTest () {Selenium = New Default Selenium ("Localhost", 4444, "* IE Explorer", "http: // localhost: 4444"); Selenium.Start (); VerificationAurriers = new stringbilder (); } [Tyrund] Public Zero Turndown () {try {selenium.Stop ()}} Grip (exception) {// Ignore errors if unable to close browser} Assre.AreEqual ("", ""); } [Test] Public Zero TheNewTest () {selenium.Open ("/google.com"); C} \ Selenium RC \ Selenium-Datnet-Client-Driver-1.0.1  
  • Compiled Library Project, succeeded. no error.
  • Selenium test. NewTest.The Newest: Selenium.SeleniumException: XHR Error: URL = Response_Code = 403 Error_Message = Forbidden + for + Proxy

    You are receiving a forbidden error because you have selenium rc Setting the Basic URL You need to set it and then you will see

      [Test] Public Zero TheNewTest () {Selenium.Open ("/") in your test. / Code>  

    or you can Required Replacement Changes

      [test] Public Zero TheNewTest () {selenium.Open ("http: // www.comgoogle.com");}  
    < / Div>

    Comments

    Popular posts from this blog

    c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

    Calling GetGUIThreadInfo from Outlook VBA -

    Obfuscating Python code? -