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

Testing for elements that do not exist.

2 Answers 122 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jason Pritchard
Top achievements
Rank 1
Jason Pritchard asked on 25 Jun 2010, 04:30 PM
How do you check for an element that is supposed to be there in one senario and not in another. Eg When logged in the my account tab appears, When not logged in, it is not supposed to appear.

How do you check for the not there. Must be a coded step but not sure how to complete this.

Also is there any documentation for what can be accomplised in coded steps. What syntax / business objects are available.

Also is there any way to debug our coded steps. IE (write to a log of some sort or an alert on the screen?

Thank you

2 Answers, 1 is accepted

Sort by
0
Missing User
answered on 25 Jun 2010, 11:34 PM
Hi Jason,

Thanks for the post, these are interesting questions.

For your first question, you can create one test that does the log in sequence and add a 'Wait element exists' for the account tab, then convert it to code.

You can then create another test in that same project that navigates to that page, but without the account tab. There you can copy and paste the code from the previous test, but change it to:
 
....Wait.ForExistsNot();

There is a way to change a test step element binding without going to code, but apparently it does not exist for Wait For Test steps, so I'll log a bug for this.

Here is a link to the custom code documentation. Most of the custom code will use have the following 'Pages...' reference. At the end of the Pages line, there is typically an Html or Silverlight Control Wrapper Class that you can program against using 'HTML Control Suite' or 'Silverlight Test Automation (WebAii 2.0 only)' topics in the link.

And debugging with a debugging tool you can use to step thorough the code is really only available in the Dev Edition. But you can add alert boxes in code like in C#:

MessageBox.Show("Alert");

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
Missing User
answered on 01 Jul 2010, 04:17 PM
Hello again Jason,

Just wanted to chck back of you were able to get this test scenario working.

Sincerely,
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
Jason Pritchard
Top achievements
Rank 1
Answers by
Missing User
Share this question
or