This is a migrated thread and some comments may be shown as answers.

Best way to test routes

3 Answers 70 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
sitefinitysteve asked on 08 Nov 2012, 04:15 AM
I'm wanting to test some sitefinity custom routing rules.

Whats the best way to go about this?...should I even use test studio or should I use a simple webrequest to see if I get a 404 back or something?...

So really I just need to have a series of navUrls, some good, some bad and assert that the good ones pass, bad ones fail

Suggestion?

Steve

3 Answers, 1 is accepted

Sort by
0
Cody
Telerik team
answered on 12 Nov 2012, 02:41 AM
Hi Steve,

We, the Test Studio support team, are novices when it comes to Sitefinity. I pinged our Sitefinity QA engineers and they weren't sure what exactly you need to test. They did suggest using a webcrawler (Test Studio is not a webcrawler) to automatically detect bad links.

When you say "bad ones fail" how is that determined? A test needs to be programmed to expect/verify a certain output/property is set. I have no idea what that is in this instance.

Currently my only thought for "have a series of navUrls" is to create a data driven test, put your list of URL's in the data source (e.g. an Excel file) and make the NavigateTo step consume the data. Then the test will simply run though this canned list of URL's. We'll still need some way of determining whether or not you got the expected result. So what is the "expected result" that the computer can detect and report on?

One other thought, you might want to try contacting the Sitefinity team for additional ideas how to test Sitefinity (due to our lack of experience with it).

Regards,
Cody
the Telerik team
Are you enjoying Test Studio? We’d appreciate your vote in the ATI automation awards.
Vote now
0
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 12 Nov 2012, 02:53 PM
Sorry, perhaps I overcomplicated this :)

Ignore everything I just said and read it this way

Whats the best way to assert urls...so your datadriven section seems like it'd work I think...

I'd need to asset that the bad urls send me to a 404 page, so what just run one and see if I can find some text on the 404 page to know that it worked?  How would I assert that the others worked as expected (200 code) (as content would be different depending on the page)....or that a trailing slash on the url 301s me to a version without that trailing slash?

I assume I should just not use TestStudio for this?...I'm thinking :)  I just need to say X url 404s, Y url 200s, Z url 301s

Steve
0
Cody
Telerik team
answered on 12 Nov 2012, 08:42 PM
Hi Steve,

If it were me (keep in mind I love writing code), I'd probably write my own code that performs a direct HTTP request, gets the response and studies the response. You can also data drive a coded unit test. I would actually create 3 separate tests and 3 sets of data, one for each type, URL's that expect 200 response code, URL's that expect 404 response code, and URL's that expect a 301 response code. The only difference between the 3 tests is verifying you got the expected result.

You could do pretty much the same thing in a Test Studio test, create 3 tests, each having just one coded step that does the direct HTTP request and verifies the response. You won't be using any non-coded steps you can take advantage of the reporting framework and scheduling features.

Greetings,
Cody
the Telerik team
Are you enjoying Test Studio? We’d appreciate your vote in the ATI automation awards.
Vote now
Tags
General Discussions
Asked by
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
Answers by
Cody
Telerik team
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
Share this question
or