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

custmize step in code => test does not work

25 Answers 313 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
wissam ab
Top achievements
Rank 1
wissam ab asked on 09 Aug 2010, 11:43 AM
hi,
i have a test that run great.
simply, for on e step i do customize step in code , run , and the test doesn't work.
error on the step:
Exception thrown executing coded step: '[DNN_TEST_NB_OF_CLAIMS__UYW1_CodedStep] : Click 'DnnCtr911NewParameterBtnOkImage''

25 Answers, 1 is accepted

Sort by
0
Konstantin Petkov
Telerik team
answered on 09 Aug 2010, 11:53 AM
Hi wissam ab,

Can you share the test log along with the step code? Thanks!

All the best,
Konstantin Petkov
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
wissam ab
Top achievements
Rank 1
answered on 10 Aug 2010, 11:00 AM
hi,

the log :

Overall Result: Fail
--------------------------------------------------
'8/10/2010 12:58:19 PM' - 'Pass' : 1. Navigate to : 'http://192.168.1.5/nasdnn_latest/'
'8/10/2010 12:58:21 PM' - 'Pass' : 2. Click 'DnnDnnLOGINCmdLoginLink'
'8/10/2010 12:58:21 PM' - 'Pass' : 3. Set 'DnnCtrLoginLoginDNNTxtUsernameText' text to 'host'
'8/10/2010 12:58:22 PM' - 'Pass' : 4. Keyboard (KeyPress) - Tab (1 times) on 'DnnCtrLoginLoginDNNTxtUsernameText'
'8/10/2010 12:58:22 PM' - 'Pass' : 5. Set 'DnnCtrLoginLoginDNNTxtPasswordPassword' text to 'host123'
'8/10/2010 12:58:24 PM' - 'Pass' : 6. Click 'DnnCtrLoginLoginDNNCmdLoginSubmit'
'8/10/2010 12:58:55 PM' - 'Pass' : 7. Click 'PortfolioSpan'
'8/10/2010 12:59:03 PM' - 'Pass' : 8. Click 'DnnCtr911NewParameterUWYearBtnShowTreeSubmit'
'8/10/2010 12:59:08 PM' - 'Fail' : 9. [DNN_TEST_NB_CLAIMS__UYW2_CodedStep] : RadTreeNode('dnn_ctr911_NewParameter_UW Year_radTree'): 'All' action -> 'Expand'
--------------------------------------------------
Failure Information:
~~~~~~~~~~~~~~~
Exception thrown executing coded step: '[DNN_TEST_NB_CLAIMS__UYW2_CodedStep] : RadTreeNode('dnn_ctr911_NewParameter_UW Year_radTree'): 'All' action -> 'Expand''.
InnerException:
System.TimeoutException: Wait for condition has timed out
   at ArtOfTest.Common.WaitSync.CheckResult(WaitSync wait, String extraExceptionInfo)
   at ArtOfTest.Common.WaitSync.For[T,V](Func`3 func, T target, V custom, Boolean invertCondition, Int32 timeout)
   at ArtOfTest.WebAii.Synchronization.Wait.ForCondition(Func`3 condition, Boolean invertCondition, Object custom, Int32 timeout)
   at ArtOfTest.WebAii.Synchronization.Wait.ForExists(Int32 timeout, Boolean refreshElement)
   at ArtOfTest.WebAii.TestTemplates.HtmlElementContainer.Get(HtmlFindExpression expr, Boolean waitOnElement, Int32 timeout)
   at ArtOfTest.WebAii.TestTemplates.HtmlElementContainer.Get(HtmlFindExpression expr)
   at ArtOfTest.WebAii.TestTemplates.HtmlElementContainer.Get[TControl](HtmlFindExpression expr)
   at ArtOfTest.WebAii.TestTemplates.HtmlElementContainer.Get[TControl](String[] clauses)
   at TestProject21.Pages.PortfolioPage.get_ListItem() in c:\Users\User\Documents\WebUI Test Studio Projects\TestProject21\Project.cs:line 174
   at TestProject21.DNN_TEST_NB_CLAIMS___UYW2.DNN_TEST_NB_CLAIMS__UYW2_CodedStep() in c:\Users\User\Documents\WebUI Test Studio Projects\TestProject21\DNN TEST NB CLAIMS - UYW2.aii.cs:line 77
--------------------------------------------------
'8/10/2010 12:59:09 PM' - Detected a failure. Step is marked 'ContinueOnFailure=False' aborting test execution.
--------------------------------------------------
'8/10/2010 12:59:09 PM' - Overall Result: Fail
--------------------------------------------------
0
Konstantin Petkov
Telerik team
answered on 10 Aug 2010, 11:40 AM
Hello wissam ab,

This looks like a typical test that needs some verification check points in order be able to execute correctly. Can you please insert a WaitFor Visible check as step 9 before the expand action? You can find this approach described in this video we highly recommend.

Regards,
Konstantin Petkov
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
wissam ab
Top achievements
Rank 1
answered on 10 Aug 2010, 02:09 PM
something incredible, it get me crazy!
I look into the video that you propose and I added some controls validations. thank you.

what's happen i s the following scenario:
my test go well. for one specific step I do: customize in code. run => failure !
I didn't make any modifications, simply customize code.
check the attached file plz.

hereafter the error:
Overall Result: Fail
--------------------------------------------------
'8/10/2010 4:04:35 PM' - 'Pass' : 1. Navigate to : 'http://192.168.1.5/nasdnn_latest/'
'8/10/2010 4:04:36 PM' - 'Pass' : 2. Click 'DnnDnnLOGINCmdLoginLink'
'8/10/2010 4:04:37 PM' - 'Pass' : 3. Set 'DnnCtrLoginLoginDNNTxtUsernameText' text to 'host'
'8/10/2010 4:04:38 PM' - 'Pass' : 4. Keyboard (KeyPress) - Tab (1 times) on 'DnnCtrLoginLoginDNNTxtUsernameText'
'8/10/2010 4:04:38 PM' - 'Pass' : 5. Set 'DnnCtrLoginLoginDNNTxtPasswordPassword' text to 'host123'
'8/10/2010 4:04:40 PM' - 'Pass' : 6. Click 'DnnCtrLoginLoginDNNCmdLoginSubmit'
'8/10/2010 4:05:13 PM' - 'Pass' : 7. Click 'PortfolioSpan'
'8/10/2010 4:05:25 PM' - 'Pass' : 8. Verify element 'DnnCtr911NewParameterUWYearBtnShowTreeSubmit' 'is' visible.
'8/10/2010 4:05:33 PM' - 'Pass' : 9. Click 'DnnCtr911NewParameterUWYearBtnShowTreeSubmit'
'8/10/2010 4:05:50 PM' - 'Pass' : 10. Verify element 'Span_0' 'is' visible.
'8/10/2010 4:05:58 PM' - 'Pass' : 11. Desktop command: LeftClick on Span_0
'8/10/2010 4:06:11 PM' - 'Pass' : 12. RadTreeNode('dnn_ctr911_NewParameter_UW Year_radTree'): 'All' action -> 'Expand'
'8/10/2010 4:06:18 PM' - 'Pass' : 13. RadTreeNode('dnn_ctr911_NewParameter_UW Year_radTree'): 'All' action -> 'Expand'
'8/10/2010 4:06:35 PM' - 'Pass' : 14. Verify element 'Div' 'is' visible.
'8/10/2010 4:06:40 PM' - 'Fail' : 15. [DNN_TEST_NB_CLAIMS__UYW__with_highlihting_test__AND_CONTROLS1_CodedStep] : Verify 'TextContent' 'Contains' '2003' on 'x2003Span'
--------------------------------------------------
Failure Information:
~~~~~~~~~~~~~~~
Exception thrown executing coded step: '[DNN_TEST_NB_CLAIMS__UYW__with_highlihting_test__AND_CONTROLS1_CodedStep] : Verify 'TextContent' 'Contains' '2003' on 'x2003Span''.
InnerException:
System.TimeoutException: Wait for condition has timed out
   at ArtOfTest.Common.WaitSync.CheckResult(WaitSync wait, String extraExceptionInfo)
   at ArtOfTest.Common.WaitSync.For[T,V](Func`3 func, T target, V custom, Boolean invertCondition, Int32 timeout)
   at ArtOfTest.WebAii.Synchronization.Wait.ForCondition(Func`3 condition, Boolean invertCondition, Object custom, Int32 timeout)
   at ArtOfTest.WebAii.Synchronization.Wait.ForExists(Int32 timeout, Boolean refreshElement)
   at ArtOfTest.WebAii.TestTemplates.HtmlElementContainer.Get(HtmlFindExpression expr, Boolean waitOnElement, Int32 timeout)
   at ArtOfTest.WebAii.TestTemplates.HtmlElementContainer.Get(HtmlFindExpression expr)
   at ArtOfTest.WebAii.TestTemplates.HtmlElementContainer.Get[TControl](HtmlFindExpression expr)
   at ArtOfTest.WebAii.TestTemplates.HtmlElementContainer.Get[TControl](String[] clauses)
   at TestProject21.Pages.PortfolioPage.get_x2003Span() in c:\Users\User\Documents\WebUI Test Studio Projects\TestProject21\Project.cs:line 258
   at TestProject21.DNN_TEST_NB_CLAIMS___UYW___with_highlihting_test___AND_CONTROLS_1_.DNN_TEST_NB_CLAIMS__UYW__with_highlihting_test__AND_CONTROLS1_CodedStep() in c:\Users\User\Documents\WebUI Test Studio Projects\TestProject21\DNN TEST NB CLAIMS - UYW - with highlihting test - AND CONTROLS(1).aii.cs:line 77
--------------------------------------------------
'8/10/2010 4:06:40 PM' - Detected a failure. Step is marked 'ContinueOnFailure=False' aborting test execution.
--------------------------------------------------
'8/10/2010 4:06:40 PM' - Overall Result: Fail
--------------------------------------------------
0
wissam ab
Top achievements
Rank 1
answered on 10 Aug 2010, 02:21 PM

Hi,

In fact, let me explain my main issue, and I appreciate if you can help me:

My goal is, for the filter that I’m clicking, instead of clicking on 2003 or 2004…etc, I want to read this from the local data. That’s why in my test record, using the highlighting control I am testing the content of the row so I could changed it in the code to read from the local data. Hope I was clear.

(P.S: by the way when I’ recording, telerik make the website very very slowely)

0
wissam ab
Top achievements
Rank 1
answered on 10 Aug 2010, 02:38 PM
in the sentence verification builder (attached) how can I tell telerik that the value that i must verify (8,415.00) should be read from local data.
thx a lot
0
Cody
Telerik team
answered on 10 Aug 2010, 10:14 PM
Hi wissam ab,

I am sorry but it appears you have hit a known bug for Wait For steps that have been converted to code (your step 15 that's failing). This bug was fixed last week in our latest internal build.

As for using data driven testing to perform verifications I've attached a document that describes exactly how to do that. Basically the approach is to define your verification using a fixed value and then modify the expected text property to bind it to a particluar column from your data source. The document shows you how to do this.

It doesn't talk about how to access data in code. You do that easily with code similar to this:

string date = Data["year"].ToString();

In this example "year" refers to the column named "year" in your data source. The variable date will get the value of the "year" column from your datasource.

Let me know if you have further questions.

Regards,
Cody
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
wissam ab
Top achievements
Rank 1
answered on 11 Aug 2010, 07:11 AM
Hi,

I already have the latest version (2010.2.713.0) !

otherwise, I look into your document, it's great, but what I meant by data driven is the data that I put in the local test data (you know the button near the storyboard). I don't need to put my data in XLS sheet for the time being, just to put in as i told you in the local test data. and then use it in the steps. how can i do this?

thank you a lot
0
Konstantin Petkov
Telerik team
answered on 11 Aug 2010, 07:22 AM
Hello wissam ab,

The latest internal build includes a bunch of improvements compared to the official Q2 release you mentioned. The latest build is labeled 2010.2.806 and available for download from the page Cody pointed you to. Please give it a go and let us know whether it helps resolve the Firefox issue.

As to the data-driven testing with the built-in grid, please check this video. I hope this helps!

Best wishes,
Konstantin Petkov
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
wissam ab
Top achievements
Rank 1
answered on 11 Aug 2010, 07:35 AM
this is the link provide by you (attached), there's no version available !
0
Konstantin Petkov
Telerik team
answered on 11 Aug 2010, 07:39 AM
Hello wissam ab,

Then my fault, sorry! Here is the link to the Automated Testing Tools LIB page:

http://www.telerik.com/automated-testing-tools/account/downloads/internal-builds.aspx

Regards,
Konstantin Petkov
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
wissam ab
Top achievements
Rank 1
answered on 11 Aug 2010, 08:28 AM
Hi,
When I try to sue the latest version (after downloading it) a licence error occurs (attached).
0
Nikolai
Telerik team
answered on 11 Aug 2010, 08:42 AM
Hi wissam ab,

About the license error can you try to uninstall and install the QA edition again.
Also did you use "Manual" or "Automatic" activation ? 

Sincerely yours,
Nikolai
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
wissam ab
Top achievements
Rank 1
answered on 11 Aug 2010, 08:59 AM
hi, i'm sorry it's me again.
i uninstall and then install.
for automatic activation i have the following error: could not establish trust relationship for the SSL/TLS secure channel with telerik.

before i didn't have this error when i activate.

is there other solution?
0
Nikolai
Telerik team
answered on 11 Aug 2010, 09:02 AM
Hi wissam ab,

It seems your firewall is forbidding the SSL connection. You can use the "Manual" activation process thou. 
Just click on the "Manual" option on the second step and follow the License Wizard Guides. 

Sincerely yours,
Nikolai
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
wissam ab
Top achievements
Rank 1
answered on 11 Aug 2010, 09:18 AM
ok it works with the manual activation. thx.

now when i try my test again, i have a compilation error !
is that is due to the fact that i created the test in previous version?
--------------------------------------------------
c:\Users\User\Documents\WebUI Test Studio Projects\TestProject21\DNN TEST NB CLAIMS - UYW - with highlihting test - AND CONTROLS.aii.cs: Line 46: (CS0101) The namespace 'TestProject21' already contains a definition for 'DNN_TEST_NB_CLAIMS___UYW___with_highlihting_test___AND_CONTROLS'
c:\Users\User\Documents\WebUI Test Studio Projects\TestProject21\Project.cs: Line 19: (CS0101) The namespace 'TestProject21' already contains a definition for 'Pages'
c:\Users\User\Documents\WebUI Test Studio Projects\TestProject21\Project.cs: Line 66: (CS0102) The type 'TestProject21.Pages' already contains a definition for 'NASPage'
c:\Users\User\Documents\WebUI Test Studio Projects\TestProject21\Project.cs: Line 85: (CS0102) The type 'TestProject21.Pages' already contains a definition for 'UserLogInPage'
c:\Users\User\Documents\WebUI Test Studio Projects\TestProject21\Project.cs: Line 128: (CS0102) The type 'TestProject21.Pages' already contains a definition for 'NAS_0Page'
c:\Users\User\Documents\WebUI Test Studio Projects\TestProject21\Project.cs: Line 147: (CS0102) The type 'TestProject21.Pages' already contains a definition for 'PortfolioPage'
: Line 0: (CS0101) The namespace 'TestProject21' already contains a definition for 'DNN_TEST_NB_CLAIMS___UYW___with_highlihting_test__1_'
: Line 0: (CS0101) The namespace 'TestProject21' already contains a definition for 'DNN_TEST_NB_CLAIMS___UYW___with_highlihting_test___AND_CONTROLS_1_'
c:\Users\User\Documents\WebUI Test Studio Projects\TestProject21\Backup\2010.2.6.23\DNN TEST NB CLAIMS - UYW - with highlihting test - AND CONTROLS.aii.cs: Line 46: (CS0101) The namespace 'TestProject21' already contains a definition for 'DNN_TEST_NB_CLAIMS___UYW___with_highlihting_test___AND_CONTROLS'
: Line 0: (CS0101) The namespace 'TestProject21' already contains a definition for 'DNN_TEST_NB_OF_CLAIMS_BY_UWY'
c:\Users\User\Documents\WebUI Test Studio Projects\TestProject21\Backup\2010.2.6.23\Project.cs: Line 19: (CS0101) The namespace 'TestProject21' already contains a definition for 'Pages'
c:\Users\User\Documents\WebUI Test Studio Projects\TestProject21\Backup\2010.2.6.23\Project.cs: Line 66: (CS0102) The type 'TestProject21.Pages' already contains a definition for 'NASPage'
c:\Users\User\Documents\WebUI Test Studio Projects\TestProject21\Backup\2010.2.6.23\Project.cs: Line 85: (CS0102) The type 'TestProject21.Pages' already contains a definition for 'UserLogInPage'
c:\Users\User\Documents\WebUI Test Studio Projects\TestProject21\Backup\2010.2.6.23\Project.cs: Line 128: (CS0102) The type 'TestProject21.Pages' already contains a definition for 'NAS_0Page'
c:\Users\User\Documents\WebUI Test Studio Projects\TestProject21\Backup\2010.2.6.23\Project.cs: Line 147: (CS0102) The type 'TestProject21.Pages' already contains a definition for 'PortfolioPage'

0
Konstantin Petkov
Telerik team
answered on 11 Aug 2010, 09:23 AM
Hi wissam ab,

Just delete the Project.cs file (find it in the test project folder by Windows Explorer) to get rid of the compilation error.

Since the official release we changed the way we generate the project elements and that change affects the coded tests in a project. We will probably ignore this outdated file for compilation for the next official release (Service Pack) but this improvement has not come with the internal build so far.

Greetings,
Konstantin Petkov
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
wissam ab
Top achievements
Rank 1
answered on 11 Aug 2010, 10:22 AM
ok.
in fact i have a case with data driven but i don't know exactly how can i do it. i do something but something still missing. can we do a gotomeeting to show you this?
0
Cody
Telerik team
answered on 11 Aug 2010, 03:52 PM
Hi wissam ab,

I am online now with GoToMeeting waiting for you, if you're still around. I'll wait for 15 minutes. Otherwise we can meet tomorrow at 9am EST.

1.  Please join my meeting.
https://www2.gotomeeting.com/join/804042619

2.  Use your microphone and speakers (VoIP) - a headset is recommended.  Or, call in using your telephone.

Dial 714-551-0021
Access Code: 804-042-619
Audio PIN: Shown after joining the meeting

Meeting ID: 804-042-619

GoToMeeting®
Online Meetings Made Easyâ„¢

Sincerely yours,
Cody
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
Cody
Telerik team
answered on 11 Aug 2010, 11:10 PM
Hi wissam ab,

I've scheduled a GoToMeeting for 9am EST.

1.  Please join my meeting.
https://www2.gotomeeting.com/join/402058011

2.  Use your microphone and speakers (VoIP) - a headset is recommended.  Or, call in using your telephone.
Dial 712-338-7101
Access Code: 402-058-011
Audio PIN: Shown after joining the meeting
Meeting ID: 402-058-011

GoToMeeting®
Online Meetings Made Easyâ„¢


Greetings,
Cody
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
Cody
Telerik team
answered on 12 Aug 2010, 02:07 PM
Hello wissam ab,

Looks like I'm going to be late arriving to the office today. Let's meet 30 minutes later, 9:30 which is 1.5 hours from now. Thx.

Kind regards,
Cody
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
Karla
Top achievements
Rank 1
answered on 03 Feb 2012, 05:28 PM

hi,

What was the solution for this issue?

I have the same probleM
: c:\PVT\ALLPVT\PVT\CRM\ContextualReports\Login.tstest.cs: Line 44: (CS0101) The namespace 'PVT' already contains a definition for 'Login'

I just copy some test cases for one project to a new project, and I have that compilation error.

How can I resolve that?

An easy solution I can find, was delete the test cases copied in the new project, and create new test cases with the name of the test caes I need, and just copy the steps. Looks like this works, but how can avoid to do that?   just copy test cases from a proyecto to other without do the process that I explain?


Thanks
0
Cody
Telerik team
answered on 04 Feb 2012, 12:56 AM
Hello,

Unfortunately I don't remember what the resolution was for that problem. It was too long ago (over a year) and obviously I didn't note the solution in the thread.

The error message is trying to tell you that you have two (or more) .cs files that both have a definition for a Login. For example if you have two files that both start out like this it will generate that error:

using System;
using System.Collections.Generic;
using System.Text;
 
using ArtOfTest.Common.UnitTesting;
using ArtOfTest.WebAii.Core;
using ArtOfTest.WebAii.Controls.HtmlControls;
using ArtOfTest.WebAii.Controls.HtmlControls.HtmlAsserts;
using ArtOfTest.WebAii.Design;
using ArtOfTest.WebAii.Design.Execution;
using ArtOfTest.WebAii.ObjectModel;
using ArtOfTest.WebAii.Silverlight;
using ArtOfTest.WebAii.Silverlight.UI;
using Telerik.WebAii.Controls.Html;
using Telerik.WebAii.Controls.Xaml;
 
namespace MySampleTests
{
    public class RadCalendar : BaseWebAiiTest
    {
 
        [CodedStep(@"RadCalendar: Select date '6/16/2009'")]
        public void RadCalendar_CodedStep()
        {


 If you copied Login.tstest.cs more than once to multiple places (such as into multiple different sub-folders) that will cause this error.

To overcome it you need to rename the duplicate tests so that each test as a unique name across the entire test project.

Greetings,
Cody
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
Karla
Top achievements
Rank 1
answered on 07 Feb 2012, 03:03 PM

Yes, actually this is what I have, multiple Test Cases with the same name, but in sub folders. In this case is a test case just for login, but I need to log in  with different users for different scenarios, so for that reason I split those in subfolders.  I will try renaming those test cases.

thanks,

 
0
Cody
Telerik team
answered on 07 Feb 2012, 04:28 PM
Hi,

That will do the trick. We will be here if you run into further troubles.

Regards,
Cody
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
wissam ab
Top achievements
Rank 1
Answers by
Konstantin Petkov
Telerik team
wissam ab
Top achievements
Rank 1
Cody
Telerik team
Nikolai
Telerik team
Karla
Top achievements
Rank 1
Share this question
or