How to send ENTER from keyboard using TestStack.White Framework - ui-automation

I am writing a c# code to test UI in my application. I want to send ENTER from Keyboard.
I already checked TestStack.White.WindowsAPI.KeyboardInput.SpecialKeys. It doesnt contain any method send ENTER.
Thanks.

Any reason you can't use KeyboardInput.SpecialKeys.RETURN ? It should do the same thing and get you what you need.

Related

write a vscode extension visual test

I created a VSCode Extension and then I need to write some tests.
I am using Mocha and chai.
I wrote a few tests and I don't have any issue with that part. My problem is with the below scenario:
I have a button, when I press that button, an input box will appear and then I need to key in a value in the input box and press the okay button.
Can you help me with how I can simulate this scenario by a test? should simulate press the first button by calling the Command palette but how to key in value in the input box?
** Please take note that I already wrote the function test, but the user wants to test the UI also.
can you help me in finding an example related to my problem?
There is something like vscode-extension-tester which lets you test the GUI very comfortable. All information you can find on its github main page:
https://github.com/redhat-developer/vscode-extension-tester/wiki

appAPI.notifier.show sometimes not work

i have a problem with Crossrider code.
I want to display notifier with this code:
appAPI.notifier.show({
'name':'my-notification-name',
'title':'Title',
'body':body_popUp,
'theme':'facebook',
'position':'bottom-left',
'close':false,
'sticky':true,
'fadeAfter':1,
'width':'700px',
'closeWhenClicked':false
});
but sometimes work, sometimes not work.
Do you have an idea? I have to write any instructions before call .show()?
Thanks in advance, Mattia
You don't show what body_popUp is set to but, assuming it's valid HTML and it's placed in the extension,js file, the code look fine.
In general, note that the notification is smart and only appears when it detects user movement in the browser. This algorithm is used as a way to ensure that the notification is seen, as it assumes the user is looking when activity is detected.
[Disclosure: I am a Crossrider employee]

Handling pop ups using selenium with perl

I want a solution for the following scenario:
In a page I am uploading an xml and while clicking on the upload button I am going to recieve an pop up for confirmation (I am able to detect this), after this again I am recieving an pop up which I am not able to detect (The page is still getting loaded in the browser ). Kindly help me to sort this out .
I have tried with many solutions for this like: get window ids,titles .
Thanks
You can you use -
$sel->get_confirmation()
This retrieves the message of a JavaScript confirmation dialog generated duringthe previous action. By default, the confirm function will return true, having the same effectas manually clicking OK. This can be changed by prior execution of thechooseCancelOnNextConfirmation command. If an confirmation is generatedbut you do not get/verify it, the next Selenium action will fail.
NOTE: under Selenium, JavaScript confirmations will NOT pop up a visibledialog.
NOTE: Selenium does NOT support JavaScript confirmations that aregenerated in a page's onload() event handler. In this case a visibledialog WILL be generated and Selenium will hang until you manually clickOK.
Returns the message of the most recent JavaScript confirmation dialog.
You should always refer to WWW::Selenium - Perl Client while working with perl and RC.
I have found what is the problem #amey ...I am tring to upload an file which is not actually not permitted due to some security issues with firefox... There was actually an work around for this
http://cakebaker.42dh.com/2006/03/29/file-upload-with-selenium/
.....Which will not work with latest Selenium RC with Firefox since firefox have removed the support for enablePrivilege
https://support.mozilla.org/en-US/questions/944433.
So it is a mandate to shift to WEBDRIVER it seems.............
http://git.erp5.org/gitweb/erp5.git/commitdiff/06898bbfae4f238b7e79ce05048646529216064e
Thanks for your support....
my solution was using the function:
$driver->execute_script("Events.invokeEvent('UserDetailPage:UserDetailScreen:UserDetailToolbarButtonSet:UserDetailToolbarButtons_DeleteUserButton_act', true);");
analyzing what the javascript code does when the Accept button was pressed. and executing that code in the function.

How to read message from console tab view in eclipse plugin development

requirement is to read message from IConsoleConstants.ID_CONSOLE_VIEW and write it into text file.
Say myConsole (of type MessageConsole) is the reference to your console. The below code will give you the required.
myConsole.getDocument().get();
I don't think you will be able to retreive a direct stream to read the console content. Note also that the console view may have multiple different consoles, you will have to retrieve the good one.
Retrieving the content displayed in a single console should be possible going through the IDocument of a TextConsole. You can get the whole text content. You could also have a look to the IDocumentListener if you can be notified of changes.
Another solution should be to go with a PatternMatchListener of the TextConsole directly.
Anyway I don't think there is a direct solution to do this with the Eclipse console API.

Automatically returning to the application after dialing the number in iPhone

I'm developing an iPhone re-dialer application in which a number is dialed and if the call is waiting then it will once again redial. But my application is exiting when number is dialed. I don't want that, it should automatically return.
Can somebody help me in solving the problem?
Thanks in Advance.
No, this is not possible. You should save your application state when the call is received, so that the user can pick up where he or she left off in your application, after taking the call.
Create a ‘UIWebView‘ that's hidden and use it load a ‘tel:‘ URL request. It will prompt you to make the call but when the call finishes you'll be returned to your app.
File a bug though to make it proper API though.
The Solution which Ashley suggested works well.
I tried it and the control returns back to the app after call is disconnected.
Also using a webView one can use letter like 1-800-CallUS, etc for dialing.
Declare a webview, create a html file with phone# as a link(this link is automatically detected in your app) and import the file in resources and load the html in a string variable , add this subview to your main view.