0

I am new to c-sharp. I was asked to retrieve the selenium commands which are present in the html in c#. I mean to say if we type username as UserName: testUser we get in selenium IDE as

command=type
target = xpath="/html..blah blah"
value= testUser

Now I have got this information in my C# as I used C# and HTML Parsing. Now I want to execute this in the form of switch.

switch(command)
{
  case "type":
             selenium.Type(target,value);
              break;
            // and so on..
    case "click":
         ...........
         break;



 }

So in this do I need delegates or some concepts of C# to dynamically execute commands ? Please reply. I am new to c#. I hope my question is clear.

1
  • do you just need to import selenium test cases in C#? I'm not clear what you are asking in the switch statement Commented Jan 24, 2012 at 4:53

2 Answers 2

2

You could use the Selenium-C#-Client which does all that work for you and you can generate test classes automatically with Selenium IDE.

Sign up to request clarification or add additional context in comments.

Comments

0

Using C# with selenium you can do actions on webpage and verify the information on the webpage by retrieving text values etc.

On How to setup selenium with C# and creating basic script, you can refer below to webpages

How to setup C#,nUnit and selenium client drivers on VSExpress for Automated tests

Creating Basic Selenium web driver test case using Nunit and C#

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.