coded ui waitforcontrolready not working on VSTT2013 but worked on VSTT2010 - coded-ui-tests

I meet the following issues after migration from VSTT2010 to 2013:
all my ....WaitForControlReady(3000); throw exception object reference not defined to object reference
e.g:
UIMap.UIIdentificationWindowWindow.UIIdentificationDocument4.WaitForControlReady(3000);
Is waiting for a popup to be displayed
MonNavigateur.WaitForControlReady();
with:
public static BrowserWindow MonNavigateur; declared in the class
and: MonNavigateur = BrowserWindow.Launch(new Uri(sAppConfigExtranetUri)); in MyTestInitialize() method
I worked like a charm in VSTT2010 ;(
The temporary workaround used is to replace all my WaitForControlReady(); with a not satisfying Playback.Wait(x000);
Anyone has an idea to solve this problem please?

Make sure you upgrade your reference assemblies to the latest version. WaitForControlReady() should be a part of the Microsoft.VisualStudio.TestTools.UITesting assembly. Version 12.0 would be required to run in VS2013.

Related

AutoMapper version 5.0.0-beta-1 - Created Mapper shows exceptions

I updated automapper package today and it got updated to 5.0.0-beta and i immediately got few build errors. Going through the latest changes in their wiki page i found that CreateMap is deprecated. So i followed their instruction and here is my code below.
The created mapper shows these exception about which i have no clue. I am not able to continue further. Should i do something extra with this new version of AutoMapper? Any help would be greatly appreciated. My POCO classes are just regular ones with int and strings.
You can just create a new Mapper instance now:
var mapper = new Mapper(config);
builder.RegisterInstance(mapper).As<IMapper>();
Or, if you prefer the old static way, just use Mapper.Initialize().

Xamarin Linker : Default constructor not found for type Cirrious.CrossCore.IoC.MvxPropertyInjector

With a skeleton project with FirstView from HotTuna package, and with Build linker behavior set to "Link all assemblies", I get the following error:
System.MissingMethodException: Default constructor not found for type Cirrious.CrossCore.IoC.MvxPropertyInjector
Using NuGet package v3.1.1 for all MvvmCross (4 packages)
LinkerPleaseInclude file does have the line
[MonoTouch.Foundation.Preserve(AllMembers = true)]
Using the latest stable build:
On PC:
Xamarin for VS 1.12.278
Xamarin.iOS 1.12.278
Mac:
Xamarin.iOS 7.2.2.2
Of course with Linker behavior of SDK only, it runs fine. Any suggestions anyone?
Solved; So, with the basic project, there were three consecutive errors in the following order:
System.MissingMethodException: Default constructor not found for type Cirrious.CrossCore.IoC.MvxPropertyInjector
can be resolved either by --linkskip=Cirrious.Core (ugly), or by including the following in LinkerPleaseInclude.cs
public void Include(MvxPropertyInjector injector){
injector = new MvxPropertyInjector ();
}
Next error is:
Cirrious.CrossCore.Exceptions.MvxException: Failed to construct and initialize ViewModel for type {0} from locator MvxDefaultViewModelLocator - check MvxTrace for more information
This one is difficult; Simple fix is to ofcourse to do a --linkskip=portableLibrary, or to crate an instance of the ViewModel somewhere (perhaps in LinkerPleaseInclude.cs); problem with the second approach at-least in my case is, most of my VM doesn't have a parameter less constructor, and obviously using IOC in this case wouldn't help.
Final Error:
System.ArgumentNullException: missing source event info in MvxWeakEventSubscription
Parameter name: sourceEventInfo
Either use --linkskip=System (ugly), or add the following to LinkerPleaseInclude.cs
public void Include(INotifyPropertyChanged changed)
{
changed.PropertyChanged += (sender, e) => {
var test = e.PropertyName;
};
}
This was enough for my basic project to run with LinkAllAssemblies, Using LLVM optimizer, and Use SGen collector.
Hope this will help anyone looking for a solution.
I hit this when my XCode was out of sync with the latest Xamarin on my Mac. Upgrading XCode to the latest resolved the problem.

T4 template shadow copy does not work

I'm using VS2012 and T4 templates and assemblies are supposed to be shadow copied, meaning that you can reference an assembly in a template and then recompile that assembly. But this simply doesn't work for me. When I try it, when I try to rebuild the assembly, I get errors like:
Unable to copy file "obj\Debug\xxx.dll" to "..\bin\xxx.dll".
The process cannot access the file '..\bin\xxx.dll' because it is being used by another process.
The only way around it is to restart Visual Studio, and this is so tedious that I'm ready to abandon T4 entirely. What could I be doing wrong?
So this isn't really an answer yet but hopefully we get there
Test ran the following in VS2013 (I realize you run VS2012)
<## assembly name = "$(SolutionDir)\TestProj\bin\Debug\TestProj.dll"#>
<## import namespace = "TestProj"#>
namespace ConsoleApplication1
{
class <#=Testing.Name#>
{
}
}
The TestProj contains the Testing class
namespace TestProj
{
public static class Testing
{
public static string Name
{
get { return "Tester" ;}
}
}
}
This did work very well in VS2013 and as far as I remember this worked in VS2012 as well.I will try to install VS2012 on one of my machines but do you mind testing this simple sample on your installation to validate it's not something in your solution that holds the dll?
In case you are interested in the project file you can find it here:
https://github.com/mrange/CodeStack/tree/master/q21118821
I work around similar issue. T4 design time template is processed in different App domain under the same process of visual studio. When rebuild the solution Visual Studio tries to replace the referenced DLL, and it cannot replace it because it is still in use.
I work around this issue by deleting the AppDomain in which T4 template is processed. See msdn

c# 4.0 and async with Microsoft.Bcl.Async. I don't have all the type for async modifiy

I am using VS2012 and my project is 4.0, but I want to use the async/await keywords, so I install Microsoft.Bcl.Async.
I try to implement my async method in the following way:
public async Task<bool> myMethodAync(int paramInteger)
{
//my code, a simple code that return a bool. Is only an example
if(paramInteger == 2)
{
return true;
}
else return false;
}
I get an error and I get marked the name of the method and the error says something like this: it is not find all the types needed for the modify async. is it the target of the project a wrong version or is it missing the reference for some assembly?
I have the reference for the three assemblies Microsoft.Threading.Task, Microsoft.Threading.Task.Extensions and Microsoft.Threading.Task.Extensions.Desktop and I have the using in my class, System.Threading.task.
What else I need to do?
Thanks.
From http://michaelmairegger.wordpress.com/2012/09/19/cannot-find-all-types-required-by-the-async-modifier/:
The solution to this problem is to reference following nuGet package into all projects in which you want to use the ‘async’ and ‘await’ keyword.
Microsoft.CompilerServices.AsyncTargetingPack
So, right click on References, then select Manage NuGet Packages..., then search online. You may find the package under the name Async Targeting Pack for Visual Studio 11. Install it and the problem should be solved.

Can't get LineChartBuilder to compile

I'm creating an application that uses JavaFX 2.2 and have run into a problem. I'm trying to use a LineChartBuilder, like so:
LineChart<Number, Number> chart = LineChartBuilder.<Number, Number>
create()
.XAxis(NumberAxisBuilder.create().label("X axis").build())
.YAxis(NumberAxisBuilder.create().label("Y axis").build())
.build();
However, I'm getting the following compiler errors:
java: reference to create is ambiguous, both method create() in
javafx.scene.layout.RegionBuilder and method <X,Y>create() in
javafx.scene.chart.LineChartBuilder match
and
java: cannot find symbol
symbol: method XAxis(javafx.scene.chart.NumberAxis)
location: class javafx.scene.layout.RegionBuilder<capture#1 of ?>
I know the first error means LineChartBuilder descends from RegionBuilder and both define a create() method, and the second means it's assuming the method comes from RegionBuilder and therefore cannot find the XAxis method. I've even tried casting it,
LineChart<Number, Number> chart =
((LineChartBuilder<Number, Number, ?>)
LineChartBuilder.<Number, Number>create())....
But I get the same compiler errors.
My question is, is this a mistake in LineChartBuilder or am I using it wrong? Maybe there's even a workaround?
Are you sure you are running with JavaFX 2.2 and not a JDK8 pre-release?
JDK8 will experience these issues with builders coded for JavaFX 2.2: see RT-24272.
Workaround is to use new LineChart(xaxis, yaxis). See also the Oracle forum thread post on this issue.

Resources