Forum Xamarin.Forms

Announcement:

The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

app.REPL() not working

Hi, I'm trying to use REPL in my local UI tests but whenever I insert it, likewise :

[Test]
public void Test5_SignInWithCorrectCredentials()
{
new LoginUITestPage(app)
.ClearCredentialsFields()
.EnterCredentials("[email protected]", "a")
.ClickOnLoginButton()
.WaitForElementByText("Menu");
app.Repl();
}

I get all of this :
Android SDK Path: C:\Program Files (x86)\Android\android-sdk
Skipping assembly: C:\Users\Amrou Bellalouna\Source\Repos\PepinoTechDEV2\Expensya\UITestNewUX\bin\Debug\e_sqlite3.dll - Scan failed with exception: System.BadImageFormatException: Format of the executable (.exe) or library (.dll) is invalid.
at Mono.Cecil.PE.ImageReader.ReadOptionalHeaders(UInt16& subsystem, UInt16& dll_characteristics)
at Mono.Cecil.PE.ImageReader.ReadImage()
at Mono.Cecil.PE.ImageReader.ReadImageFrom(Stream stream)
at Mono.Cecil.ModuleDefinition.ReadModule(Stream stream, ReaderParameters parameters)
at Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters parameters)
at Xamarin.UITest.Repl.Program.LoadAssembliesAndAddUsingsForExtensionMethods(String assemblyPath, String uiTestPath, ReplFacade replFacade)
Skipping assembly: C:\Users\Amrou Bellalouna\Source\Repos\PepinoTechDEV2\Expensya\UITestNewUX\bin\Debug\libSkiaSharp.dll - Scan failed with exception: System.BadImageFormatException: Format of the executable (.exe) or library (.dll) is invalid.
at Mono.Cecil.PE.ImageReader.ReadOptionalHeaders(UInt16& subsystem, UInt16& dll_characteristics)
at Mono.Cecil.PE.ImageReader.ReadImage()
at Mono.Cecil.PE.ImageReader.ReadImageFrom(Stream stream)
at Mono.Cecil.ModuleDefinition.ReadModule(Stream stream, ReaderParameters parameters)
at Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters parameters)
at Xamarin.UITest.Repl.Program.LoadAssembliesAndAddUsingsForExtensionMethods(String assemblyPath, String uiTestPath, ReplFacade replFacade)
WARNING: Detected System.Net.Http.dll in bin folder. This may be due to this known mono issue: https://bugzilla.xamarin.com/show_bug.cgi?id=60315#c2 - we recommend you delete this dll before running tests to avoid test failures.
Full log file: C:\Users\Amrou Bellalouna\AppData\Local\Temp\uitest\log-2020-11-25_14-15-21-214.txt
Execution failed with exception: System.Exception: Java Development Kit (JDK) not found. Please make sure that it is installed and if it's still not located, please set the JAVA_HOME environment variable to point to the directory.

Searched locations:Windows Registry
[ Source: JAVA_HOME ]
at Xamarin.UITest.Shared.Dependencies.JdkFinder..ctor()
at Xamarin.UITest.Shared.Android.DefaultAndroidFactory.BuildExecutor(IProcessRunner processRunner)
at Xamarin.UITest.Android.AndroidApp..ctor(IAndroidAppConfiguration appConfiguration, IExecutor executor)
at .Host(Object& $retval)
at Mono.CSharp.Evaluator.Evaluate(String input, Object& result, Boolean& result_set)
at Xamarin.UITest.Repl.Evaluation.MonoCSharpReplEngine.Evaluate(String line)
at Xamarin.UITest.Repl.Repl.ReplFacade.RunCode(String code)
at Xamarin.UITest.Repl.Program.Main(String[] args)

How can I solve this ?

Answers

  • YelinzhYelinzh Member, Xamarin Team Xamurai
    edited November 2020

    The exception that is thrown when the file image of a dynamic link library (DLL) or an executable program is invalid. Try calling the app.Repl() command directly to check if it'll work.

    Did you test the Xamarin.UITest on UWP platform? Xamarin.UITest only supports to wrok in Android and iOS. Check the doc:
    https://docs.microsoft.com/en-us/appcenter/test-cloud/frameworks/uitest/


    Xamarin forums are migrating to a new home on Microsoft Q&A!
    We invite you to post new questions in the Xamarin forums’ new home on Microsoft Q&A!
    For more information, please refer to this sticky post.

Sign In or Register to comment.