c# - How to access a child window inside a main window in White Framework -
i using white framework ui automation in windows desktop based application. not able find way access child window. uiaverify depicts properties of window as:
below code reference:
public class program { application app = application.launch("path application"); public program() { //getting main window window mainwindow = app.getwindow("mainform", initializeoption.nocache); mainwindow.waitwhilebusy(); **//here wanna child window can access controls on window. below code getting child windows controls** //getting firm box textbox firm = childwindow.get<textbox>(searchcriteria.byautomationid("1313948")); //setting value firm firm.setvalue("firm2"); //getting staffid text box textbox staffid = childwindow.get<textbox>(searchcriteria.byautomationid("723272")); staffid.setvalue("staff"); button ok = childwindow.get <button>(searchcriteria.byautomationid("_okb[enter image description here][1]utton")); ok.click(); }
use treescope.children access immediate child elements of desktop:
automationelement rootelement = automationelement.rootelement; var wincollection = rootelement.findall(treescope.children, condition.truecondition); foreach (automationelement element in wincollection) console.writeline(element.current.name);
Comments
Post a Comment