.net - Find option to right click c# White/TestStack UI Automation -
i creating software process automation using language c # framework white \ teststack.
i have problem because unable capture alternative when click right mouse button.
image preview
the code i'm using seek this
panel.rightclick(); var propclick = _mainwindow.get<white.core.uiitems.menuitems.popupmenu>(searchcriteria.bytext("propeties")); propclick .click();
can not capture option, making variable becomes null propclick
sorry english language sucks :(
help!
thanks :)
i haven't tried right mouse menus. menu show after
panel.rightclick();
else, isn't context menu part of panel?
have tried using
panel.rightclick(); var propclick = panel.get<menuitems.popupmenu>(searchcriteria.bytext("propeties")); propclick.click();
instead?
or maybe seek menu instead of popupmenu
var propclick = panel.get<menuitems.menu>(searchcriteria.bytext("propeties"));
or allow white decide first, , read type putting breakpoint
var propclick = panel.get(searchcriteria.bytext("propeties"));
edit: add together this, next methods might help select context menu using keyboard commands.
to add together that, might want seek select menu keyboard. white not have special key context menu (right mouse menu), method below can help that.
/// <summary> /// right mouse click simulation (shift+f10) /// </summary> /// <param name="container">container in whish click should occur.</param> private static void showcontextmenu(this uiitemcontainer container) { container.keyboard.holdkey(keyboardinput.specialkeys.shift); container.keyboard.pressspecialkey(keyboardinput.specialkeys.f10); container.keyboard.leavekey(keyboardinput.specialkeys.shift); }
and 1 select context menu
/// <summary> /// context menu (right mouse menu) of <paramref name="container"/> whre current focus is. /// </summary> /// <param name="mainwindow">main window of application, because context menu kid of window.</param> /// <param name="container">container on right click shoul occur.</param> /// <returns>context menu</returns> internal static popupmenu getcontextmenuof(this window mainwindow, uiitemcontainer container) { using (coreappxmlconfiguration.instance.applytemporarysetting(c => c.popuptimeout = 750)) { container.showcontextmenu(); homecoming mainwindow.popup; } }
c# .net white
No comments:
Post a Comment