Simulate the use of a website with a client

224 views Asked by At

I would like to achieve the following scenario:

Create a client that opens a web site, for example www.stackoverflow.com, click a button with an id (for example the button "Ask Question"), fill the forms (knowing the ids of the fields) and press another button.

No, I do not want to do bad things :D I'm only trying to create a demo to customers about a website (I do not have source of this website) and I would like to know if there's a way to program a client in order to reproduce some steps.

Thanks a lot!

2

There are 2 answers

0
Vano Maisuradze On BEST ANSWER

If you want it for .net, then there is WatiN.

Here is an example how to use it:

public void SearchForWatiNOnGoogle()
{
  using (var browser = new IE("http://www.google.com"))
  {
    browser.TextField(Find.ByName("q")).TypeText("WatiN");
    browser.Button(Find.ByName("btnG")).Click();

    bool contains = browser.ContainsText("WatiN");
  }
}

p.s. You can also try Test Recorder for generating macros.

4
Ivan Sander de Jong On

you can configure a webtest within visual studio

https://msdn.microsoft.com/en-us/library/vstudio/dd293540%28v=vs.110%29.aspx

in the creation of such a webtest you can click trough your website and fill forms. you can use the webtest just once or put it even in a load test to get more information from any website

While running a webtest you get to see a in visual studio browser preform all the steps. you can enter delays between actions like clicking and filling text boxes

a thing to mention is load testing is a visual studio ultimate only function