Presenter:Eric Lee
Visual Studio Team System makes it easy to test a Web application by recording a user’s interaction with the application and then repeatedly replaying the recorded interaction. But users do not typically perform the same actions again and again. In this video we see how to extend and customize our automated Web tests to more accurately reflect the way a user would interact with the application. We learn how to create custom extraction rules to pull data from a Web control that the default extraction rules may not support, and how to add C# or Visual Basic-coded Web tests to add functionality such as looping, logic, and accessing external data.
The following text is a software generated transcript of the video. Click on a minute link to jump to a location within the video
Minute 0
Thank you welcomed as ASP net and Visual Studio team edition for software testers that he and the studio will use Visual Studio team edition for software testers can create web testing around an ASP net application must focus on some of the different ways we can extend and customize the way we view web testing to suit the application aware fact on a test version of the protest is show for it is a simulation and that component s view that you might see in a Hotmail type of web applications so I found the chapters on e mail information lets create a Web test for this application was that recording our interactions with this particular application and I would lose with that of its useful view of the CC field the bcc field the subject in the body
Minute 1
This message they went to a gathering of this message is press the save as draft buttons will say this enough as a draft copy for men when we look at our web test editor to see the website of the week recorded because you have a two basic requests than a second request we captured all the form values we post the bachelor is begotten a page that supposedly want to increase the stress of this past or Inc will make this a soon go through a few more motions will be could do is cut and paste that request on to the second one the problem is that we re not turning any contact from the first request is sent request is even imagine if we re at the root composing an e mail resume to it over time eBay Web syntax sodas at that resume attacks based on what we are doing to us and say that as a draft and will do it I baptized can stimulate on the interaction with the user
Minute 2
That means that this raucous and quite a few of these request to save the message as a draft and we done so far is his cut and paste one request on to another switch you requested do the same thing but he knows he delivered a message tech stocks valued its still the same value now normally if we want to carry content from one request to another Visual Studio team edition for software testers will do is add an extraction rule and skin suit in the value data extraction role as a context parameter a problem with this particular scenario is that when using a text area to carry that message back in for a and before the extraction rules probably the closest women we need is the form field extraction rule or only works on input HTML elements so there s no extraction rule that allows us to pull the value of a text area into a context parameter since those are
Minute 3
This is an opportunity for us to create are an extraction were also extended his new team edition for software testers a little bit and we have is an extract text node will project already set up and we re going to use this project is something called the HTML agility pack visit the project is part of quick thoughts of this enables us to parse HTML little bit better in order to admit a custom attraction will need to implement the extraction will abstract class is part of the test will let testing framework that helps us implement that class is a manufactory support is privacy sure you can right click on a chat room class issues and not a class and numeral implement default methods for all the methods that are part of that class extraction interface is quite easy to work with the specified name something that is her duty to listen listen about the Senator will call this the extract text variable
Minute 4
Data of this class will be in the extract method itself and before we implement the extract method I will add a property to extraction rule amendment is listed as possible so we ll I m doing what you are sad or users of this class a way to specify which text is a delay to extract value from Celeste that will create a named property that captures the name of that text field in a cabin in property lets implement our extract method First Amendment then we ll discuss it with First Amendment will be doing this code is using decent agility pack HTML document will convince the Senate and the html from the body that were getting in our response to the announcement at document overviews will try to point out the element by the name that were given defined element lists at a concert
Minute 5
Grandmother was signed to with the injuries to allow value of that text area elements vulnerability is we use these to whether or not to help us or external document will find a text area that were interested in and we will set that in a bit of HTML or the value between the start tag and end tag as part of our context and not as though the project and their reference auto extraction will not let us all we need to do is go because project and add a reference to our extraction rule project in that attention will be available in summer weapons that now to go back into about test and his new request will give the user extraction rule
Minute 6
Message now to put Kerry over between requests the value of this message text box control matter what the structure of this request was going to the second post that request we have and will do to set the message text box value rather that the value of the record is instead will set it to the message context are parameters and advocate a value between one requests for not know will execute an attack since we moved anything all that special we are passing on the value that message despots from one request another run at changing it anyway whenever the ruling is as making sure we didn t make any mistakes in setting up or objectionable are setting up a context parameter ballots in the use of the net has at it like this is a great way to kind of get your websites you need before going into a coded web tests right now we re pretty close to what we pay league record is in the actual web application who said
Minute 7
Chat rooms were pulling about message now we can use a more sophisticated work inside a coded web tests will do is we ll generate a code that has from a dataset or an amnesty shark file that is exactly the same as I once has said that in terms of Jenin requests now because an organization we can do some customization of the slut test however most common uses for a coded web tests is to do some grouping was a branching zone does let Tacitus could attest that will do is release and looping of our requests soon it will do the set of hundred and two counts when you do is we live through and send a hundred requests as part of the slut test under the aspect of web cuts could work us is that you can bring in external beta and he cannot summon the will to add a little blue is an island of the stress will webcast it was read from a file in our webcast and use the
Minute 8
Is from the file to send into the requests were losers router to notify but we have been as just about everything that it is a copy of it with an open domain look at a point I lose them in the sea when there is a new class with a plan lines attached from from the book basically lose up a test and then post has event handlers in a test you can do in this resolution and tear down into the handlers for those of that s so in our protest we could do it in a process will close it down a nation where exiting a look at the code actually sends requests to see usage of the U return keyword so each time this method is called never leave and return statements will return a request back to the caller that was good about testing framework
Minute 9
And that the president is going to let that the first time when he will return a request won the second time this car will call your return request to the third try this method is called on the executional pickup at the Vitesse request request of the line and eventually you ll return request rate than we do is not a loop around at the request of the code so that we can heal you ever turn a number of requests in our case will return back a hundred Dutch requests says he is a wire loop in the loop while accounting a request is not a goal and said I was reminds to read from our Texan version of 20 000 leagues under the Sea will have aggressively before the attacks but you won t be sure now you are using the return keyword so after that first division this loop back at each iteration of the loop at executional Beta after the yield return
Minute 10
So you increment our town and that will pull out and found the message that we the context parameter will declare string to hold a message and because of investor of establishing a template with a vigil at the center will just cut and paste this context message to strain to separate message when we arrived from our text file and our new message will be accommodation obesity is a beautiful message will put in a carriage return and will put in our and we don t want to forget I asked me saluting this context parameters will now will set the message context to a new value and I m not a change in Unicode that we had to build up the request body slammed on is taken the card out of context added in mind to it and we say that context parameter
Minute 11
There is no solution and that I could webcast I will in that test we can organize and Prime Minister doesn t any other text slogan that has been and will start a run of our webcast to put what our webcast is executing the custom exception will build roads and it has looking his way through that Luther Veronis while well I look at is because once it finishes and a listing of the number of requests are basically the hundred that loop added so one could read be able to take a template of testily created and users when coding the output of a test didn t read much more on request at him through these of a request to concede that I m the Texans are sending is being built a son or a request that a few times from what I remember this the enthusiasm have a tremendous number of line so of them distress task of a number of requests in an application by the
Minute 12
You adding more and more data to that post back with us in a scene of this I believe that is how we can take a test entry extraction will deploy a value for control and data be supported with evil extraction rules fairly simple to do under chat room at that class is easy work with and the combat and support that is the procedure you can let an instructional class fairly quickly but also the notes you take a template of the Web has created a recording and the using of coded web tests you can not doing as well as pulling in external data think it
Click here to go to original video page
Monday, June 2, 2008
Video: Custom Extraction Rules and Coded Web Tests
Labels:
coded web tests,
custom extraction rules
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment