Page 1 of 1

click on cancel buttono

Posted: Wed Jun 20, 2012 10:15 pm
by omayer
How to click on Cancel button which path "/form[@title='Windows Internet Explorer']/button[@text='Cancel']"
some reason i can't focus to click on it, i tried various different way to click on it but no go
Thank you,

Re: click on cancel buttono

Posted: Wed Jun 20, 2012 10:36 pm
by Ciege
MyButton.click()???

Can you explain a little more? What do you mean you can't click on it? Is it off page? Needs to be scrolled into view? Can it not find the element? What "various ways" have you already tried?

Re: click on cancel buttono

Posted: Thu Jun 21, 2012 4:37 am
by omayer
Thank you Ciege to look into it, issue with window popup that triggered when missing enterring required field on webpage . I was using thread to catch any popup then click Ok or Cancel on pop up, it was working all along until upgrade to 3.3 .

Re: click on cancel buttono

Posted: Thu Jun 21, 2012 5:12 am
by omayer
problem solved using the following code -Thank you Ranorex support team to give an example code on http://www.ranorex.com/support/user-gui ... mples.html


public void popup()
{
Ranorex.Button cancelButtonVar = null;
bool found = Host.Local.TryFindSingle<Ranorex.Button>("/form[@title='Windows Internet Explorer']/button[@text='Cancel']", 2000, out cancelButtonVar);
// Move mouse pointer to button
cancelButtonVar.MoveTo();
cancelButtonVar.Click();
}