Execute button inside a ribbon - ribbon

I want to write a script (C# or AutoIT or VBScript.. whatever works) which should
Get reference of already open outlook application
Iterate through ribbons to find a specific button
Execute that button click
How can I do it?

Use AutomationPeers.
Here is the MSDN article with lots of details:
http://msdn.microsoft.com/en-us/library/ms752331.aspx
Add references to:
UIAutomationClient
UIAutomationClientsideProviders
UIAutomationProvider
UIAutomationTypes
And here is a little C# code snippet of how to get the AutomationId of what currently has focus:
var id = AutomationElement.FocusedElement.Current.AutomationId;
this.txt.Text = id;
You can navigate the entire tree of a window and drive the entire UI using automation peers. This is how accessibility applications interact with applications in Windows. This is also one way that automated UI testing applications do it as well.

Related

Must I use ActiveXObject to open a powerpoint presentation in html

I have the following code snippet which simply opens a Powerpoint presentation and calls a VBA macro.
function CallVBA()
{
var App;
App = new ActiveXObject("PowerPoint.Application");
App.Visible = true;
App.Presentations.Open("D:\\Jonathan\\PPtHymns\\b.pptm");
App.Run("Doit");
}
While this works fine on Windows, it does not work on a Mac because of using ActiveX objects.
Is there another way of opening a Powerpoint presentation within a html page?
This may appear to be trivial, but I wish use code to add several new slides and text into the presentation and then run the presentation manually when done.
There appears to be no alternative at present.
As I wanted to build up slides from Excel spreadsheets, the only way to make this happen on both Mac and PC is to create a tab delimited file output from excel. Open the powerpoint app and use javascript/typescript in Script Lab.
So far this can not be done 100% as I can not see any javascript/typescript api's for inserting audio and text shapes and setting slide tansition properties. Perhaps I have missed them. Would someone please confirm?
Many thanks.

Auto-filling web forms

I have to create video-tutorial as help. We have a document with help, but customer want video.
I have found chrome extensions for this purpose - Screencastify (https://www.screencastify.com) for recording chrome tab contenct. It is cool that this tool highlight user clicks.
The best trouble is filling forms. I can't find any tool, or chrome extension or something, whitch is able to fill fluently forms. When I am filling forms, i make some typing errors and typing is not fluent - video tutorial looks unprofesionall and chaotic.
I have tried UI Vision RPA (https://ui.vision/), but this tool does not simulate user click (yes with some extension, but before simulation user click screen becomes green for a while), but there are no highlighted clicked position.
Is there a tool that can simulate a smooth form fill according to a prepared script or a macro - basically something like an auto-run UI test, such as a keyboard shortcut that is able to simulate mouse clicks and fluently write defined form content?
There are lot of ways to do it. All below three allow record and play back.
1. VBA macros in excel,
2. Automated test tools and frameworks like Selenium
3. RPA tools like WinAutomation or automation anywhere etc.
Once you record, you can go to recorded script, correct any spelling mistakes, add any pauses needed, start your screen recorder and play back the script.

Modify DOM in content-script as a replacement for the non-ability to trigger pop-ups programmatically?

I'm working on an extension that's supposed to use the content of the page to determine whether to show an interface to the user.
The ways to show an interface, if I'm correct, are using a browser action or a page action.
And neither can be triggered programmatically. But content scripts could be written to inject an equivalent GUI into the webpage.
So, does it make sense to modify the DOM using content-scripts to display an interface as a substitute for page action? It seems like an obvious work around to me, and I'm sure there are good reasons to not let page actions be triggered programmatically.
Well, modifying DOM must be done by only Content Scripts, as that is the reason they exist.
Want to fetch any data from current page, alter anything in the page, add new UI in the page - whatever, content script will help you do that.
It has nothing to do with Page script Or Browser Script.
YES, you can not programatically trigger page/browser action. It has to be done by explicit clicking.
But if you want to open a UI by clicking a chrome extension, then there is a popup js for that.

Coded UI - Unable to identify a html controls on a Wpfbrowser

I am new to CodedUI & C#.
I am trying to automate a wpf application which has a WPF Browser.
So basically, It's WPF container with html content inside. I have created a similar sample small application and shared it here. This application opens the amazon.in website within wpfwindow.
WPF Browser application
My problem is Coded UI is not able to identify the Html-Controls/elements like 'Buttons', 'Text input fields' properly.
Below, the top image is from the WPF Browser app [Link which i have shared].
Here you can see a blue square box on the top-left. The coded UI identifies that area has the Search Go button.
Bottom part of the image is of the amazon website in IE browser where coded ui is properly highliting/ identifying the Search Go button.
Does this mean i cannot automate WPFBrowser apps using Coded UI.?
Can someone please tell what to do to identify the buttons properly in coded ui
You need to specify Id attributes for the controls that you want exposed to Coded UI.
To me this looks like CodedUI is getting some control that's similar, rather than the correct one.
You haven't mentioned if you're recording and executing tests or handwriting them in a separate CodedUI solution.
If you're recording them: Be sure that you're recording using your WPF application and interactions inside of them, rather than recording using your browser and then trying to execute tests using the WPF application
If you're writing them by hand: Be sure that you're correctly creating trees of inheritance when writing your tests. For instance, in a traditional CodedUI scenario the absolute top level object that all other controls inherit from is a web browser. In your scenario, that object should be the WPF object. There are probably going to be some other windows or various controls that are children of the WPF application which in turn will finally have the browser as a child.

Chrome app navigate htmls without creating windows

I'm creating a chrome packaged app, and I need to navigate my htmls without creating a lot of windows, like, if the user click one button, it opens the html in the same window the user are.
Is it even possible? If not, is there a way to make windows modal? So the user can't focus another window without closing the current?
Packaged apps intentionally do not support navigation. Apps are not in a browser, there is no concept of forward, back, or reload. Applications which do require the concept of navigation, or modal dialogs, should use a user interface framework that supports that functionality. In fundamentals, you can navigate by manipulating the DOM or by using CSS to animate and control visibility of components of your app.
The page you want to navigate to can be opened in a new window, then the previous page can be closed.
function navigateToLink (link) {
var current = chrome.app.window.current();
chrome.app.window.create(link);
current.close();
}