I was wondering if there was a way to force thread identity for a test list. I'm currently working on an intranet site and I have to test different user profiles on one of our dev servers. The thing is that we don't do "login"; the site takes the logged in identity. For manual testing and verification, we've developed a script that forces the desired identity (all browser windows must be closed for it to work), THEN opens a browser window and opens the site . But with test studio, the browser opens as soon as you want to record a test.
Any help would be appreciated.
Thank you
Sam
6 Answers, 1 is accepted
I'm not sure what you mean by "force thread identity". That sounds like a programming term, but I'm not sure you meant thread programming in this context.
For recording, you can always use our "Attach to Existing Instance" feature. But I'm concerned about test playback. Our playback mechanism MUST launch a new browser window to work. It cannot connect to an existing browser instance during test playback.
To overcome this you can implement your own Test Extension DLL and add code to the OnBeforeTestStarted method. This method gets control before Test Studio launches the browser.
Cody
the Telerik team
Test Studio Trainings
Thanks for the reply. I've read the page on Test Extention DLL and it would most likely solve my problem, except for one tiny detail that I'm not sure of: Will deploying into the \Telerik\Test Studio\Bin\Plugins\ folder will make the code run for every test list that I run, from any project? Because I only need this done on a single test project.
You are correct, the code will run for all test lists for all projects unconditionally.
To handle this you can filter when the code is activated with something like this:
/// <summary>
/// This function is called just before a Test Studio test list starts executing.
/// NOTE: Is NOT called when using Visual Studio test list.
/// </summary>
/// <param name="list">The test list about to be executed.</param>
public
void
OnBeforeTestListStarted(TestList list)
{
if
(list.TestListName ==
"Special Test List"
)
{
// Insert code here that sets the user authentication
}
There are other properties off of the TestList parameter you could use instead if you like. It's completely up to you how you filter when your custom code will/won't be executed. Kind regards,
Cody
the Telerik team
Test Studio Trainings
That's a great suggestion! Thanks a lot. I'll keep it in mind.
It seems that the first solution that we thought about won't work because of a few factor. BUT now, I'm able to get a windows logon when we get to the site. So I'm thinking that this will help for another solution, but when I try to record a test, it only says "Handle 'Generic' dialog." as step. Where do I have to put in the values so that the test logs me in?
Thanks
Thanks a lot for all your help!
Sincerely, Sam
Excellent! Thank you for the update.
All the best,Cody
the Telerik team
Test Studio Trainings