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

How to validate drop down list items?

3 Answers 296 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Marcus
Top achievements
Rank 1
Marcus asked on 28 Jan 2011, 05:21 AM
Hi,

I need to validate that there are 4 items available with the appropriate text when I mouseover "Contact" on my silverlight site. My dev team is using the telerik radmenu control for this.

My test case would basically be:
  1. Mouseover "Contacts"
  2. Validate drop down menu appears upon mouseover
  3. Validate that the drop down menu contains "All contacts", "Account contacts", "Partner contacts" and "Personal contacts"

Can someone please advise on how I can accomplish this?

Cheers
Marcus

3 Answers, 1 is accepted

Sort by
0
Stoich
Telerik team
answered on 31 Jan 2011, 04:31 PM
Hi Marcus,
  1) You can add a Hover-over actions from WebUI's GUI. Here's how you do it:
start your recorder and enable Highlighting from the menu in the bottom-right corner. Now try hovering your mouse over the menu element (i.e. the element that expands the drop-down menu).

The elements will become highlighted in green as you do that. If you linger your mouse over an element for a few seconds, various "nubs" will appear (screenshot 1). Each "nub" represent a layer of your application you can validate. In this case the one you want will probably be RadMenuItem. Click on the nub.From the pop-up menu that comes up choose Mouse Actions (bottom-middle button). You'll find the Hover-over action on the bottom of the list (screenshot 2). You have two options - to choose the the center of the element as the hover-over "target" or manually pick a position in the browser.

2) Add a Verification step. Expand the drop down, highlight an element contained there and open the pop-up menu. From Quick Tasks add a "WaitForElements is visible" step. This will test whether the menu expands on hover-over.

3) Add Verification steps. Expand the drop down and highlight the element "All contacts" for instance. Open the pop-up menu. From Quick Tasks choose "Verify text contains 'All contacts' ". This will add a Verification step to your test that will effectively check whether this specific element exists. Do this for all the element (All contacts", "Account contacts", "Partner contacts" and "Personal contacts").

I hope you find this helpful, let me know if you're having any trouble getting this to work!

Regards,
Stoich
the Telerik team
Interested in Agile Testing? Check out Telerik TV for a recording of Automated Testing in the Agile Environment
0
Marcus
Top achievements
Rank 1
answered on 01 Feb 2011, 03:27 AM
Hi Stoich,

Thank you for the assistance. Worked perfectly.

Cheers
0
Stoich
Telerik team
answered on 01 Feb 2011, 02:55 PM
Hi Marcus,
   I'm glad I could help, please don't hesitate to post if you have any other questions!

Best wishes,
Stoich
the Telerik team
Interested in Agile Testing? Check out Telerik TV for a recording of Automated Testing in the Agile Environment
Tags
General Discussions
Asked by
Marcus
Top achievements
Rank 1
Answers by
Stoich
Telerik team
Marcus
Top achievements
Rank 1
Share this question
or