public static WatiN.Core.Button waitForButton(this WatiN_IE watinIe, string nameOrId, int sleepMiliseconds, int maxSleepTimes) { var count = 0; while (watinIe.hasButton(nameOrId).isFalse()) { if (count++ >= maxSleepTimes) { break; } watinIe.sleep(500, false); } return(watinIe.button(nameOrId)); }
public static WatiN_IE click(this WatiN_IE watinIe, string id) { if (watinIe.hasButton(id)) { var button = watinIe.button(id); button.click(); } else if (watinIe.hasLink(id)) { var link = watinIe.link(id); link.click(); } else { "in WatiN_IE click, could not find button or link with id: {0}".error(id); } return(watinIe); }