An exception of type 'Microsoft.VisualStudio.TestTools.UITest.Extension.FailedToPerformActionOnHiddenControlException' - coded-ui-tests

Im getting the following error when I run the coded UI application:
An exception of type 'Microsoft.VisualStudio.TestTools.UITest.Extension.FailedToPerformActionOnHiddenControlException' occurred in Microsoft.VisualStudio.TestTools.UITesting.dll but was not handled in user code
This exception arises in the Mouse.Click() function in the below code.
public static void DestinationMaster()
{
Mouse.Hover(PPI.PPIHome.PPI_Main.PPI_Window.MastersPane);
Mouse.Click(PPI.PPIHome.PPI_Main.PPI_Window.DestinationMasterPane.DestinationMasterHyperlink);
}
The application doesnt run after this exception.I am using IE 8 as my browser to run the application.But when I run the application ,IE mode is changed automatically to compatibility mode.Is this related to the exception?
Is there a way to resolve this issue and get my application to running.Thanks in advance.

Does the hover work? Can you hover over the link instead to make sure that works? What happens when you find the control from the UIMap?
What does PPI.PPIHome.PPI_Main.PPI_Window.DestinationMasterPane.DestinationMasterHyperlink.TryGetClickablePoint() return?
Does the UI need to scroll to see the link? If so you could use PPI.PPIHome.PPI_Main.PPI_Window.DestinationMasterPane.DestinationMasterHyperlink.EnsureClickable() to scroll to the control.
Try to use WaitForControlReady() to make sure the page is fully loaded before coded ui acts on it. Sometimes coded ui can move faster than the application under test.
Make sure you have the latest update for VS2012

Related

Why is micronaut invoking the wrong controller method?

I have a micronaut API like this:
#Get("/")
List<Club> listClubs()
#Get("/{id}")
Club show(Long id)
In my unit test, when I invoke the show method, the listClubs() method is actually getting invoked, instead.
Why is this happening?
Details:
Thinking that my URL mappings must be wrong, I started debugging into Netty to try to understand how the framework constructs URLs.
In HttpClientIntroductionAdvice, the context shows the API method like this:
Club show(Long param0)
The interceptor is setting param0 in the parameter map, which doesn't match the actual parameter name of my method. When the URI template is expanded, this causes the ID to get dropped (thus the URI becomes / instead of /1).
I am trying to follow this example:
https://github.com/alvarosanchez/micronaut-workshop/tree/master/ex02/solution/clubs
There is one important different in my project, which is that the endpoint is set at "/club" instead of at "/":
#Controller("/club")
#Client("/club")
I am using a diff tool to compare my project to the sample, but I am struggling to find any other difference (besides package name changes).
Why is this happening? What should I be looking for?
Thanks
Update:
Tested the target endpoint with the browser - looks fine.
Gradle clean does not resolve the issue.
I switched from debugging the Application class with IntelliJ to using "gradlew run" and in the process, I made a change to build.gradle (adding JVM properties pass-through from the gradle CLI). I also played with enabling/disabling the annotation processor in the IDE.
(note: In the previous project, I enabled annotation processing as soon as I imported into the IDE. On this project, I didn't enable it until I started having issues.)
I think the build.gradle alteration caused the problem to go away. Since the issue shows up unreliably, it's hard to tell for certain if this is the change that caused it to be fixed.

Xamarin Android: Can I not create a new object of my MainActivity?

I have a location mocking method in my main activity. Unfortunately, I cant put this method into another class (yet!). So, I need a service, to call this method from my main activity every 5 seconds. So i created a countdown in within a service that, while the app is in the background, should run the method in my MainActivity. But it doesnt.
public void OnTimedEvent(object sender, System.Timers.ElapsedEventArgs e)
{
Log.Info("2", "CountDown ausgeführt!");
var test = new MainActivity();
test.getMockLocation();
}
This is my code. As you can see, I'm installing a new object of my Main Activity and then ask for the method in within this activity. This does work. Well at least Visual Studio does not complain. If I now debug my app on my phone, nothing happens. I dont get no errors or anything.
Now, when I run this app Step by Step and it reaches this point
"var test = new MainActivity();"
I get "Frame not in Module".
So, it basically crashes as soon as I ask it to install a new object of my Main Activity.
May anybody tell me why this is?
THANKS :)
Unfortunately in Android you cannot create Activities like this, they need to be instantiated by the OS. Also, instantiate a whole Activity only for a method is not ideal, I suggest you to find the way to get that method/function out of that Activity so you can use it anywhere in your program.
Did you create your app via Xamarin Forms? If you did, you can utilize the Xamarin Forms MessagingCenter for background services and then you can call your mock location tasks.
This is the link for a very helpful walk-through and example of MessagingCenter.

Getting EXC_BAD_ACCESS(code=EXC_i386_GPFLT) when migrating existing tests to XCTest

I have been using GHUnit with it without any problem to test a library.
This library basically perform calls to an API and use CoreData to decrease the number of API calls.
Then, I decided to switch to XCTest:
Created the test Target
Created the test class
Tests runs fine! wheeee!!!
However anything I try to do that involves CoreData I get a error: EXC_BAD_ACCESS(code=EXC_i386_GPFLT)
It does not happens with GHUnit, it is the same code!
Also, it runs if I set the "Host Application".
I know that the error is related to trying to access an address that the code is not suppose to, but there's no more details.
I see that in the DatabaseManager the line:
NSString *modelPath = [bundle pathForResource:bundlePath ofType:#"momd"];
Returns nil, but, as I said it runs fine when using GHUnit
or simply using the library.
I feel like I am missing some property in the project settings.
I have added the log here:
https://gist.githubusercontent.com/wilsolutions/96e3ae1310ccae86d344/raw/03ea1dfcdab75fc215baaba9d07123bd2e915617/gistfile1.txt
tkx

Handling WinJS app upon relaunch

When back home is pressed app exists but it is not terminated yet.
When user press primary or secondary tile app is relauched.
Default way is to let application navigate to the last visited page in the navigation history.
I don't know if there is a bug but this way doesn't work as expected because any code inside page ready function executes but it doesn't count later when page is rendered. Static binding works but not dynamic.
I need to know what is the proper way of handling relaunch in an app that uses default navigation template?
What to do if I want clean start, destroy everything and than navigate to home?
How to overcome problem with framework not taking into consideration code inside page ready function?
Upon app initialization you should check for the ApplicationExecutionState, and do whatever you want in either case.
Thanks for your answer but it is quite clear from the start how to obtain ApplicationExecutionState.
Actually what I need was to execute all bindings and other post processing after DOM has been loaded in a promise timeout.
if (app.sessionState.previousExecutionState === 1) {
WinJS.Promise.timeout().then(function () {
performeAfterProcessing();
});
}
else {
performeAfterProcessing();
}
So if everyone encounters some strange behavior after application has been relaunched try to execute your code using promise timeout.

How to debug a j2me application in netbeans with breakpoint?

I am unable to check the flow of execution of my j2me application using breakpoint.
I am using Netbeans IDE.Googling it I came to know that after setting a breakpoint,I need to run the app and then when the AMS reaches the breakpoint,if I go on pressing F6,i'll get to know the flow of execution .But it doesnt seem to work for me.
If the IDE is not doing what you want, maybe try to add this code right before your breakpoint:
try
{
throw new RuntimeException();
}
catch(RuntimeException rex)
{
rex.printStackTrace();
}

Resources