TestMethod in Coded UI Test -


I am creating a TestMethod in the coded UI test which will use the UI control in my Windows Phone 8.1 app. I used the async method to do multi-thread work but I got an exception for this kind of code:

 [TestMethod] async public work coded UITest method 1 () {XamlWindow. Launch ("{556EE9D4-! 5640-4120-9916-44B1CA27352F}: Application: 556ee9d4-5640-4120-9916-44b1ca27352f_tpza89sffjg1j Application"); ExecuteOnUIThread ((= = gt; {mappage home page = new menpage ()); Microsoft. Visual Studio. TestTools.UITest.Input.Point Point = New Microsoft.VisualStudio.TestTools.UITest.Input.Point (mainPage.getX), home page .getY ()); Gesture Tap (point);}); }   

and

  public static IAsyncAction ExecuteOnUIThread (Windows.UI.Core.DispatchedHandler operation) {Back to Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow . Dispatcher.Run async (windows.u.core.cored dispatcher prerelease general, action); }   

But I have received an exception message: Test Name: Coded UIITistMath 1 Test FullNenam: CodedUITEst Project 2 Coded UITT 1 Coded Utystith1 Test Source: C: \ Users \ Thaah \ Desktop \ Calculator \ Cited UITEst Project 2 \ coded UITST 1. CS: Line 28 Test Result: Failed Test Duration: 0: 00: 02.3440269

Result Message: Test Method Coded UITEst Project 2. Coded UITT 1 Coded Utah Meth 1 Exception was televised: System. Resident Operation Exception: A method was called at an unexpected time. / p>

A method was called on an unexpected time. Results StackTrace: In Windows Application mod.Core.coreapp.get_euvent () coded UITEst Project 2 CodedUITEST 1.XActonOutHead (Dispatched Handler Action) on CodeADUTEE Project 2. CodedUITE 1.d__2.MoveDext () --- The end of the stack trace from the previous location where the exception was on the system. Runtime Complaint Services TalkWalker Task task for the system on the system. time. Complementer Services Takewayer Handlenness and Debugger Notification

How can I solve this problem? Please help me

Coded UI tests coded UI test control mechanisms to visual studio or related programs such as mstest. Exe All coded UI tests that I have seen the code:

  [TestMethod] public zero-coded UITestum1 () {...}   

They also have a [DataSource (...)] attribute is a very different type of method that you can do:

  [TestMethod] async public Job code I have not seen any documentation or examples suggesting that such a method can be used with coded UI. .  

[TestMethod] / code> to XamlWindow.Launch (...) suggests that you attempt to gather coded UI tests and applications into a program And then get the test to invite the application by calling a method within that program. It's not like how to use coded UI. A coded UI test suite should be created as a separate program (actually a DLL that is done by Visual Studio via mstest.exe or similar) test application. The coded UI then runs the program as a program (not by calling any method in the application). The coded UI test then interacts with the program by reading the screen and sending the keyboard input and mouse click in the program.

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -