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

Automation and SQL Date test

4 Answers 90 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Luis Tapia
Top achievements
Rank 1
Luis Tapia asked on 05 Apr 2010, 10:12 PM
My name is Luis

I am trying to build an automation and I have a few questions:

1. I have a page when you click a save button the information will be display in the next page, for that I will use a validation and it works fine, but with this action, before going to the next step, the same action have to storage data on my SQL data base.  This data is not going to be shown in browser.  How can I validate the insertion?  For example, if one textbox is blank I shouldnt see the record, if the record =! null it should be on the data base.  How do I integrate this step in to my recording?
2. Windows login.  A login in to a SharePoint page, how can I implement the login?

Thanks

Luis

4 Answers, 1 is accepted

Sort by
0
Missing User
answered on 05 Apr 2010, 10:46 PM
Hello Luis,

Thanks for the post and your evaluation of WebUI Test Studio. I'll answer your questions by point if that's ok.

1) WebUI has built in features to test and automate only the User Interface layer of an application.

If you wanted to incorporate a database check, you would need to write your own custom coded step in a code behind file to run after the WebUI test step that submits the information from the page.

The custom coded step would have a template like this:

[CodedStep("MyCustom Step Description")]
public void MyCustomStep()
{
// Custom SQL code goes here
}

Please check out this video for more information on using custom code in your test.

2) If the login is like the type from this link, there is a Logon Dialog Handler you can add in WebUI as described in this video. If it's a Gmail or Hotmail html type login, then you can record the login as a user would on the page.

Please let us know if you have any further questions.

Greetings,
Nelson Sin
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Luis Tapia
Top achievements
Rank 1
answered on 06 Apr 2010, 12:56 AM
Thanks Nelson

I got what to do, just one question about it:

Let's say that the record in my data base to pass the test is null.  How do I build my condition...

if(record = null){
What's here????
}
else{
Doesn't pass what's here??
}

What I need to know is, what instruction will send the fail or pass test? 
0
Accepted
Missing User
answered on 06 Apr 2010, 05:00 PM
Hello again Luis,

So you wouldn't need to do anything when the condition is met, the custom step will pass. In the code you posted, you would not need the else branch.

If the condition is not met, you can throw an exception with a custom message like:

if(record == null)
{
    throw new Exception("Entry Not Found in Data Base");
}

The exception will propagate to the WebAii test step UI and the exception message will be viewable in the test log.

Best wishes,
Nelson
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Missing User
answered on 22 Apr 2010, 04:04 PM
Hi again Luis,

Just wanted to check back with you on this to see how this went. Please let us know if you have any further questions on this or feel free to create new tickets for any other issues.

Regards,
Nelson
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
General Discussions
Asked by
Luis Tapia
Top achievements
Rank 1
Answers by
Missing User
Luis Tapia
Top achievements
Rank 1
Share this question
or