SelectAgent

From Documentation
Revision as of 09:59, 11 May 2012 by Hawk (talk | contribs) (Created page with "{{ZATSEssentialsPageHeader}} We'll keep using the todo list application to demonstrate <tt> SelectAgent </tt> usage. In this application, when selecting a ''listitem'', its va...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)



We'll keep using the todo list application to demonstrate SelectAgent usage. In this application, when selecting a listitem, its value will be loaded to three different input fields for modification. The following test case steps verifies whether or not listitem's data are correctly loaded into three input fields.

To single select a listitem, we must retrieve it first. The same rule applies to grid and combobox. We should retrieve a row or comboitem before selecting them.

TodoTest.java

public class TodoTest {
	@Test
	public void test() {
		//remove irrelevant code for brevity

		//update
		desktop.queryAll("listbox > listitem").get(0).as(SelectAgent.class).select();
		//verify selected
		assertEquals("one-item",itemName.as(Textbox.class).getValue());
		assertEquals((Integer)3,priority.as(Intbox.class).getValue());
		assertEquals("2012-03-16",date.as(Datebox.class).getRawText());
	}
  • Retrieve a listitem and use SelectAgent to select it.




Last Update : 2012/05/11

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.