how to read the pop-up dialog box on the screen I want to read the text it contains by Python - qpython3

want to read the pop-up dialog box on the screen I want to read the text it contains by Python Please helplook screen ](https://i.stack.imgur.com/TrjP6.png)](https://i.stack.imgur.com/TrjP6.png) i use python to my project but i have a problem..i want to read the text of the alert pop please help me also i use androidhelper module of qpython but i dont any idia how do this please help me import androidhelper d=androidhelper.android()
n = droid.dialogGetInput("* i will copy this alert text*").result
print(n)

Related

How to format the text in a textArea component in Matlab so that it always displays the latest value?

I am building a MATLAB app using app designer and I have a textArea component which I use to display output message to the user using the app. The component name is OutputStatusTextArea_1 and i set the value of nb_Text to 0 in the startup function.
Whenever I need to display a message I use the following command:
app.nb_Text = app.nb_Text + 1;
app.OutputStatusTextArea_1.Value(app.nb_Text) = strcat({'# '},'New Message')
What happened is at some point the number of message fill completely the text area and then everytime i add a message, the user needs to scroll down to see it.
What I would like is to be able to always display the last message at the bottom of the TextArea and that the user needs to scroll up if he wants to see old message. Is there a way to do so?
have you tried the setCaretPosition function? see this post
https://www.mathworks.com/matlabcentral/answers/255486-set-edit-uicontrol-to-last-line

How do I display data/information with Matlab App Designer?

I would like to display some information to the user via Matlab App Designer's GUI. I am new to this program and can't seem to find a widget that provides what I feel should be a simple function. Am I missing something? Examples would include showing the user:
The path of the file that he/she selected
Errors such as "No files detected" that are printed in a Matlab script called on by the GUI code.
Other print statements in code such as "Done!", etc that will inform the user when a process is complete.
Is there a way to capture the output in the Matlab command line and report these in a window of some sort in the GUI? Thanks in advance!
You can use a TextArea to display information for the user. Here's how I made a simple example:
Drag a button to the app in design view.
Drag in a text area also. I changed the label to Feedback.
Select the button and use the Callbacks tab in the bottom right of app designer to add a callback with the default name it gives you.
Edit the callback to contain
answer = 'what your want to display';
app.FeedbackTextArea.Value = answer;
When you push the button the text area gets filled. In your code, instead of just setting 'answer' to some string, set a variable using whatever code is dealing with your user's information. The key is to store what you want the user to see in a variable and then assign that to the "Value" parameter of the text area or other widget where you want them to see the results.

How to call a Dialogue box from Menu using Matlab?

I want to Make a Help Dialogue Box. When we Press Help Menu then Dialogue box will appear.
Current code is
h_opt3 = uimenu('Label','&Help');
uimenu(h_opt3,'Label','How to Use','Callback','dialog','separator','on');
It only show empty dialog.
In place of dialog i want to put a dialogbox which will describe how to use my software.
How to code this all. Please help.
Requirements: How to Add stuff in DialogBox and how to call it in above mention scenario.
Try writing an additional callback function, and look at helpdlg instead of dialog.
I can't test any code now, but something like the following should work.
function help_callback
h = helpdlg('Directions','title');
end
Then change your uimenu call to this code
uimenu(h_opt3,'Label','How to Use','Callback',#help_callback,'separator','on');

Unable to locate WindowID

I am currently testing a web app using selenium rc with eclipse. I've been having issues with a single pop up window which appears when a submit button is clicked. The confirmation window appears with a single 'ok' option.
I've also tried 'chooseOKonnextConfirmation' in conjunction with .getConfirmation but eclipse tells me no confirmation exists. I've tried inspecting the window itself with firebug but have been unable to get any results.
I also tried with "selenium.selectWindow(getAllWindowIDs ()[1]);" but selenium not recognizing "getAllWindowIDs".
Could somebody please tell me how I can retrieve the windowID and the associated API commands I need to implement to get rid of this problem?
from your description, i understand that you have an ALERT window being appeared after clicking SUBMIT button but not the CONFIRMATION window.
if my understanding is correct
( you said single OK button - ALERT window appears with single OK button - CONFIRMATION window appears with OK and CANCEL buttons - there is another window javascript can generate which is CONFIRMATION.it appears with TEXT field and OK and CANCEL buttons )
so you must use accordingly.
here is what you should use
if(selenium.isAlertPresent()) {
String message = selenium.getAlert();
}
this will consume you Alert window and you can check the message displayed on Alert window if you want.
if this is not please post write your comment
It's selenium.getAllWindowIds(); note the capitalisation. Don't forget to make sure the popup has already appeared (e.g. selenium.waitForPopUp()).
Yes sudarsan is correct if you have an alert.
If you have an popup window not an alert with OK button then you have to click OK when popup appears.
If you are unable to locate the button use firebug to locate the element.

Select and copy text from dialog in wxPython

I have a wxPython app, and in this app, I can select and copy text from various frames, but I can't do so from dialogs. Is there a way to do this?
I understand I could probably do this by putting some kind of TextCtrl in the dialog, but I'd like to be able to do this from a standard looking dialog.
EDIT:
Sorry, I should have been more specific. I can't select text from a wx.MessageBox under Windows Vista or Mac (don't have access to Linux to try that). Here is one example of the call to create the message box:
wx.MessageBox(str(msg), "Could not load ballots", wx.OK|wx.ICON_ERROR)
I am unable to select the text of the message box.
If you make a custom MessageBox like so, it will appear to be static text until you click on the text:
class MessageBox(wx.Dialog):
def __init__(self, parent, title):
wx.Dialog.__init__(self, parent, title=title)
text = wx.TextCtrl(self, style=wx.TE_READONLY|wx.BORDER_NONE)
text.SetValue("Hi hi hi")
text.SetBackgroundColour(wx.SystemSettings.GetColour(4))
self.ShowModal()
self.Destroy()
I've only tested this on windows, you might have to adjust the color for your OS.