Build the tree hierarchy of apps in Coded UI test for windows phone without manually building the UIMap - user-interface

I was looking for automation testing tools for Windows Phone like adb for Android or iOS instruments for iOS. I have found Coded UI Test. That works fine if you want to build your test on a subset of UI elements.
But I need to build the list of all UI elements dynamically, or rather I need to know the hierarchical tree of the window with which the user interacts (something similar to logElementTree in iOS instruments) during the test.
I wouldn't build UIMap for every page of my app. Instead I'd prefer to build the hierarchical tree of UIElements dynamically in order to find the element of interest (such as an object for a tap action) by its properties (name, text, bounds, etc.).
For example, to give you an idea, I would like to do something like this pseudo code:
listOfUIObjects = getWindowTree(app);
element=listOfUIObjects.getElementByText("Pippo");
element.tap();
Does someone of you know a way to do this with coded ui test?
If it's not possible, is there an automation tool to do this?

You won't grab a 'tree' as such, but you can search for controls programatically. Take a look here for a starter:
http://www.codewrecks.com/blog/index.php/2014/04/10/programmatically-use-of-coded-ui-in-visual-studio/
Another good place to look is the generated code behind a UI map - it will show you the search code used which you should be able to modify for your own uses.

Related

Multiple "panes" view in single document Windows application

I'm trying to write an editor for game scenes. So far, I'm able to present results in a single window. However, I would like to have several "panes", for example for material properties or resources preview.
The good example would be Blender layout:
I know MFC and WinAPI, I wouldn't rather use Qt, since it's not free.
I did it on a commercial application and it works fine:
Create a Single Document application
Read about CDockablePane, then look into the MFC Feature Pack exanples.
Finally implement the CDockablePanes and their contents
Arrange them the way you want by docking them to your own CFrameWndEx-derived class.

What is imgMain control in visual Basic 6?

I'm using a VB6 application as a reference and have come across imgMain. I'm assuming its an image control, however, I cannot find the object on any of the forms. It's used to load the image. I'm just not sure what's going on with this. I'm assuming its an IMAGE CONTROL, but I cannot find this on any of the forms? it's mentioned a lot of times in teh application as it lets you view incoming faxes and stuff.
Without having a look on source code i assume It might be custom user control that was created for some reasons probably to extend basic picturebox control.
One thing i can advise you is to further inspect code and dig to code of this custom control. If code for this control is not available then see what methods and properties instances of that particular control uses and compare them with regular picturebox.

How to compare User interface elements of a website after a code deployment?

I want to compare a website before and after a code deployment for any change in UI elements. Is there any tool online which allows for such comparisons?
As per your comment on Yan's question, I think you are looking for a way to automate Layout Testing of your website.
If Yes, here is a way to automate layout testing of a web application using Galen Framework. Open source solution for layout testing.
This tool has its own language and is very easy to learn and understand. It is a Selenium based and you can run test in Selenium Grid, Sauce Labs if you want to test your application in different browsers. even you can use chrome driver or IEDriver for running it locally without using Selenium grid or Sauce Labs
This tool gets the location of specified element on page and check them relatively to each other.
Example: If you want to check icon sizes and its placement on the web page (lets assume it is inside header), you can do it like this:
First define object using any of the available locators(css path, ID, xpath)
=======================================
header css #header
icon id icon
=======================================
Now state where exactly your icon should exist inside header and what should be it's height and width. (I have assumed all the values here)
icon
inside: header 5px top, 10px right
width: 20px
height: 25px
This tool can also be used to test responsive designs.
You can find complete documentation on official website http://galenframework.com
The best part is you can even create JAVA Tests. Galen JavaScript API is also available along with the sample projects in github.
At my place HTML designers write the specifications (in Galen language) of web pages and in the later stages of application lifecycle same specifications are used by developer/testers
As you mentioned that you want to
compare a website before and after a code deployment for any change in UI elements, you can use html reports generated by Galen after each run/test.
I believe you don't want to compare the changes manually but want to automate the process. You can use selenium web driver to find the elements on the web page and then test if they present on the changed one. Applitools provides the framework that allows to test the image changes combined with the selenium code.

MvvmCross localization: switch at runtime

Is there a way to change the current language to another one at runtime ?
For example: be able to switch when a button is clicked or when starting the app, get the user language and switch.
How to tell the plugin to check the user language at startup ?
Thanks in advance for your help.
Is there a way to change the current language to another one at runtime ?
yes, call builder.LoadResources(whichLanguage) on your MvxTextProviderBuilder.cs
For example: be able to switch when a button is clicked
The UI framework isn't really setup to perform switching live. When you switch between languages then the new JSON resource files will all be loaded OK - but existing displayed text will not be updated. This is a bit like most mobile operating systems - if you want to switch language you often need to reboot!
If you wanted to add dynamic switching then you'd have to find a way to tell the UI to completely refresh all text - I suspect this wouldn't be hard to do, but it might require some manual coding on every page/View which has already been created and displayed :/
or when starting the app, get the user language and switch.
This is a much more straight-forward way to do i18n. It's normally OK because MvvmCross mainly targets phones - and phones are normally single user devices which don't switch languages very often.
You could, for example, use some variable (e.g. System.Globalization.CultureInfo.CurrentUICulture) to work out the best language to display.
Or you detect on load whether the user has picked a language yet - if they have, then show HomeViewModel - if they haven't then show a LanguagePickerViewModel - this is what we did in StarWarsKinect - the StartNavigationObject is a perfect place for this sort of logic!
How to tell the plugin to check the user language at startup ?
Currently, you'll have to code this logic as part of your app startup.
I'd definitely be open to providing an improved plugin on this - perhaps with a demo!
If you are looking at i18n, then one alternative implementation to consider is Vernacular - the team at Rdio have a very good offering for Mono and MS platforms - https://github.com/rdio/vernacular

How to approach implementing a layout editor using Cocoa

I want to build an OS X application, in which one of the requirements is for the user to be able to generate PDF output according to a layout that they, the user, will create. Typical items on the page would be things like a corporate logo (a JPEG or PNG), an address (a block of text) and a narrative (another block of text).
I'd like the user to be able to move and resize the items using the mouse to drag handles around on-screen.
Is there an Interface Builder object that will let me do that, or some third-party library that exists for this purpose?
Try GCDrawKit if you're looking for a drop-in solution. It's still in beta (and has been for ages) but you might find it useful.
You seem to be looking for an all-encompassing, self-contained "Pages" control or some sort of reporting suite. That's asking a bit much.
There is nothing in the Cocoa frameworks that gives you this. Unfortunately, there's no Cocoa equivalent of Crystal Reports either. You'll have to roll your own.
I suggest using standard CSS / HTML templates with WebKit. The only drawback is WebKit doesn't yet support CSS pagination, so there's no concept of "8.5"x11" page 1...15" but it's the closest you'll come without writing your own Pages application (NOT an easy project by any stretch of the imagination).

Categories

Resources