HtmlElement cancel = page.getFirstByXPath("//*[@id = '" + withControlsComponentId + "Cancelbtn']");
assertNotNull(cancel);
cancel.mouseDown();
DomText text = page.getFirstByXPath("//*[@id = '" + withControlsComponentId + "Label']/text()");
assertNotNull(text);
assertEquals("Edit Text", text.getTextContent());
HtmlElement span = page.getFirstByXPath("//*[@id = '" + withControlsComponentId + "']");
assertNotNull(span);
assertEquals("rf-ii", span.getAttribute(HtmlConstants.CLASS_ATTRIBUTE));
edit(page, withControlsComponentId, "Another Test String");
HtmlElement ok = page.getFirstByXPath("//*[@id = '" + withControlsComponentId + "Okbtn']");
assertNotNull(ok);
ok.mouseDown();
text = page.getFirstByXPath("//*[@id = '" + withControlsComponentId + "Label']/text()");
assertNotNull(text);
assertEquals("Another Test String", text.getTextContent());
span = page.getFirstByXPath("//*[@id = '" + withControlsComponentId + "']");
assertNotNull(span);
assertEquals("rf-ii rf-ii-chng", span.getAttribute(HtmlConstants.CLASS_ATTRIBUTE));
edit(page, withControlsComponentId, "Test String");
blur(page);
text = page.getFirstByXPath("//*[@id = '" + withControlsComponentId + "Label']/text()");
assertNotNull(text);
assertEquals("Test String", text.getTextContent());
}