I have only just started with your testing framework so are probably asking some "newbie" questions (Sorry).
I have to use IIS as I'm using VS20103.
I have looked at your example code QuickSTarts_NUnit/AspNetANdTestRegion.
I have used this as a basis for my test.
I have a couple of questions.
1. When using your BaseTest, How do I get access to the TextFixture to start my IIS as the start of all my tests?
2. How do I shut down a browser at the end of a test? A Manager.RemoveBrowser(ActiveBrowser.ClientId) doesn't seem to do this.
3. When running TestMethod2 and TestMethod2B both browsers are left running. If I do this.CLeanup() in test MyTestCleanUp() this has no affect.
My aim is to start IIS at the beginning of the Tests, Load a page and perform some tests.
Some tests will load different pages in the same browser.
I want to test my javascript
I want to test multiple pages (Although I think I read that this wasn't possible).
I've attached my simple test project only TestMethod2 & TestMethod2B work at all.
8 Answers, 1 is accepted
Please take a look at the following article on getting started with Telerik Testing Framework. I hope you will also find useful automating browser actions.
On accessing TextFixture you should look over the internet for a solution since this is beyond our scope of the support expertise. You can find this article helpful.
About closing the browser you can simply use:
ActiveBrowser.Close();
About testing Javascript take a look at Invoking Javascript funtions article.
Regards,
Ivaylo
Telerik
Test Studio Trainings
Using the links you gave me and looking through the sample code I have a test project started.
I am now trying to use the samples from C:\Program Files (x86)\Telerik\Test Studio\Samples\Telerik Controls Wrappers\ASP.NET AJAX\Input. I want to find a RadTextBox and put some text in there.
When I attempt to do this I can see that the text is written (If I look closely) but then I get MouseCLick;LeftCLick and timeout waiting for the text. See RadControlsWebApp3_RadTextBox.pdf in zip file (actually real project not sample given which exhibits same problem)
Is it not possible to use these HtmlControls when using IIS as the WebServer?
If I use below, it does set the text. But how to "Wait" to check the text written?
Element PRJobIdTextBoxEl = ActiveBrowser.Find.ById("ctl00_ContentPlaceHolder1_ctl00_PRJobIdTextBox");
ActiveBrowser.Actions.SetText(PRJobIdTextBoxEl, PRJobId);
Some additional information which may help you see my problem.
Using my test harness I tried running your sample code Samples\TelerikControlWrappers\ASP.NET AJAX\Input\TextBox.cs the test SingleLineTextBox and this exhibited the same behaviour. The only change I made was to specify the full path.
ActiveBrowser.NavigateTo(http://demos.telerik.com/aspnet-ajax/input/examples/radtextbox/firstlook/defaultcs.aspx);
Please provide me with a sample demo of the test you are using against our controls so I can take a look and be able to execute it.
Looking forward to hearing from you.
Regards,
Ivaylo
Telerik
Test Studio Trainings
I am using VS2013, IIS.
Thank you for providing me with the testing project, however I had multiple issues building it and working with it since I don't have IIS running on my machine right now.
Since you are working with our Sample Tests project which is demonstrating the use of RadControl WebAii Wrappers. Here is an example test on typing into a RadTextBox control:
[TestMethod]
public
void
SingleLineTextBox()
{
Manager.LaunchNewBrowser();
ActiveBrowser.NavigateTo(
"/input/examples/radtextbox/firstlook/defaultcs.aspx"
);
RadTextBox textBox = Find.ById<RadTextBox>(
"RadTextBox1_wrapper"
);
Assert.AreEqual(
"type here"
, textBox.EmptyMessage);
// simulate typing
textBox.TypeText(
"some text"
, 100);
textBox.Blur();
Assert.AreEqual(
"some text"
, textBox.InputValue);
}
That test should be running against this ASP.NET AJAX live demo.
Regards,
Ivaylo
Telerik
Test Studio Trainings
I've found that I can use ActiveBrowser.Actions.SetText() to set the text and look at the data using the RadTextBox html controls.
So now I guess my question now is whether the (html control) RadTextBox .TypeText can be used at all or should I regard these controls as read-only and use the ActiveBrowser.Actions.SetText() for updates?
I've attached the annotation that I get when the SingleLineTextBox is run.
Yes, please use ActiveBrowser.Actions.SetText(); for updates for now.
I will investigate this further and will update this ticket accordingly.
Regards,
Ivaylo
Telerik
Test Studio Trainings