How can I simulate; app has stopped
After I click a button? I'm trying to make my program display that (exactly) after I click a button.
easy way to do this is,
let your app crash in the first place ( cause some sort of exception) take a screenshot from that exact message.
Create a new form called mCrashForm, place a picturebox with the screenshot of that message ( leave out the close Program button.
Create a button in your main Form to open the crashForm with mCrashForm.Show()
Create a Button in mCrashForm which says "Close program" which executes this code snippet when pressed mCrashForm.Close()
Related
i have ok button on my dialog box and on the top of dialog new dialog is opening which having again ok button while recording it identify the button but when i run coded ui test then it will not identify second ok button and not clicking on it because of it my test get fail...i am using visual studio 12 ultimate.... please help
Thanks in Advance
Use uielements wait methods WaitForControlExist, WaitForControlEnabled and WaitForControlReady before you click when dealing with popups, or any button. It's likely that your tests are trying to click before the popup "ok" button is ready.
uiControl.WaitForControlExist(20000);
uiControl.WaitForControlEnabled(20000);
uiControl.WaitForControlReady(20000);
mouse.click(uiControl);
I can't seem to get the Open Panel's New Document button to work. Currently I am just using the default application provided Open Panel (iCloud enabled OS X app) which has a New Document button at bottom left of the window.
However I just get a system beep when I click on it, I would expect this button would do the same as File->New menu option but it does nothing other than beep.
How can I either enable this button to simply create a new blank file or remove it altogether.
Finally I figured it out.
It seems the New Document button is somehow hardware to the CMD+N keystrokes. I had reassigned CMD+N to apply Normal style to text and this breaks the New Document button.
Seems odd that the button is not wired to newDocument method on First Responder rather than to a keystroke combination.
EDIT
I logged a Bug ID# 14886108 and it seems it may be fixed in Mavericks
So I am pretty new to Xcode and Objective C, I've been using it about 2 weeks now. I am building an app for OSX. One of the windows in the app has 5 text boxes, some labels and a submit button at the bottom. The submit button is linked to a method that closes the window, opens a new one and outputs the contents of the text boxes into one text field on the new window.
I had it working correctly, but now when I do anything but click on the top text field the submit method is called and the window closes. I can click on the black space in the window, but click on any of the objects calls the method. Also, pressing tab calls the method. I am not sure when I did to cause this error, but any insight or tips would be very useful.
Sorry if this is vague, I'm not even sure how to describe the problem. If you need any specific information please ask.
Try looking in Interface Builder. Ctrl Click or Right click on the each one of the fields that are responding with calling the function. See if they are linked to the function.
Also check the "responder" as was suggested earlier. You can do this by also right click or ctrl clicking the red responder box labeled "responder". See if anything in there maps to your function
I am facing a strange hang issue with IKPictureTaker and on clicking a "Choose" button. I am doing below operation using IKPictureTaker.
When a user wants to change a profile picture, upon clicking "Change Image" button, I display a IKPictureTaker view along with "Choose" button by setting IKPictureTakerAllowsFileChoosingKey to YES.
First time on clicking the "Choose" button, open panel will be displayed allowing user to select an image of his choice.
Next, on clicking the "Set" button, internally I am calling a profile picture upload function of a server in a separate thread and everything works great.
Next if the user tries to do the operation 1) and 2) again application hangs on clicking the "Choose" button.
After investigation I found that this issue is something to do with the background upload operation I am doing with the server.Because if I comment the upload part of code everything looks good.
I don't see any issues with the upload operation performed in the separate thread and it gives up it s runloop once it is done with its upload operation and all UI related operations again taken care in the main thread.
Application hangs only if I click on the "Choose" button. If I select the recent pictures or take a new photo using the camera everything works great.
Is there anyone who faced the same issue? Is it something to do with the NSOpenPanel displayed when we click on the "Choose" button?
I'm making a simple form that is to step through a program iteratively.
How can I get it to run a method each time a user clicks a button and wait once it is finished for the next click?
Maybe I'm not understanding your question very well, but is it like the "Next" button on a Wizard?
You can have a State variable to store the current "state", so at starup its has the value 1. when click "Next" then do the code for State=1 and then change to State=2 and so on.
Inside you Click event you can have a case statement to proceed according
You want to create a method that gets called when it sees the OnClick event.
The simplest way to do this is to double-click the button in the GUI Form Designer, and it will go to the code page and start the method for you with the correct syntax.