This question is locked. New answers and comments are not allowed.
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
sitefinitysteve
asked on 11 May 2011, 04:25 PM
Ok so I have the databound logins working
So now on certain pages Admins can see things other users cant (like a RadButton)
How do I go about writing the test so that the step passes (looking for the button) in both cases?...like admin=visible, regular=invisible
So now on certain pages Admins can see things other users cant (like a RadButton)
How do I go about writing the test so that the step passes (looking for the button) in both cases?...like admin=visible, regular=invisible
4 Answers, 1 is accepted
0
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 11 May 2011, 08:10 PM
I guess what I'd like to do is right-click on the element in the explorer which i found as admin...then create a new validation step off of that to say element is not visible...
If possible I'd like to do it without a coded step, but I guess I could convert it to one...
If possible I'd like to do it without a coded step, but I guess I could convert it to one...
0
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 11 May 2011, 08:26 PM
Should I not be able to do this?
Assert.IsTrue(!Pages.CTPortfolio_defaultaspx.CreateNewButton.IsVisible());
The test fails, and I don;t to duplicate the code from the selector for the CreateNewButton if possible
Assert.IsTrue(!Pages.CTPortfolio_defaultaspx.CreateNewButton.IsVisible());
The test fails, and I don;t to duplicate the code from the selector for the CreateNewButton if possible
0
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 11 May 2011, 10:25 PM
So this is what I came up with...grab the current data bound index and validate
Easier way?...or coded steps are the only way
var item = ActiveBrowser.Find.ById(
"~adminAllUsersComboBox"
);
if
(
this
.Data[
"Username"
].ToString() ==
"steve@medportal.ca"
) {
Assert.IsTrue(item !=
null
);
}
else
{
Assert.IsTrue(item ==
null
);
}
Easier way?...or coded steps are the only way
0
Hello Steve,
We also provide ability to use logical steps without using code - you can find more about it here:
http://www.telerik.com/automated-testing-tools/support/documentation/user-guide/logical-steps/if-else.aspx
Basically you can do verification if an element, that is specific for admin only and if this is visible to execute some specific steps, if not to execute other steps, specific for the other users.
Hopefully it will be what you are looking for.
All the best,
Daniel Djambov
the Telerik team
We also provide ability to use logical steps without using code - you can find more about it here:
http://www.telerik.com/automated-testing-tools/support/documentation/user-guide/logical-steps/if-else.aspx
Basically you can do verification if an element, that is specific for admin only and if this is visible to execute some specific steps, if not to execute other steps, specific for the other users.
Hopefully it will be what you are looking for.
All the best,
Daniel Djambov
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>