Appium Pagefactory throws noSuchMethodException when running from POM - automated-tests

When I try to run my appium scripts on the pom file ( with mvn verify or mvn test)
I get a
java.lang.RuntimeException: java.lang.NoSuchMethodException: jdk.proxy2.$Proxy12.proxyClassLookup()
On the line that instantiates my locators:
PageFactory.initElements(new AppiumFieldDecorator(driver, Duration.ofSeconds(15)), this);
When I run the test directly from InteliJ or run the testng.xml file, the test succeeds
Full pom.xml: https://pastebin.com/V0FbehMh
Full error stacktrace: https://pastebin.com/11TvTq7a
testng.xml: https://pastebin.com/8XZtCfRt
Related classes: https://pastebin.com/ynFizC9T
What can be the problem, when everything is fine running from test class / testng.xml, but suddenly failing when running with maven in command line

it's a bit embarrassing, (because i remembered I did this before)
After doing an mvn clean, and an mvn compile again,
Then the issue disappeared. something probably got stuck somewhere and needed a clean again..

Related

No main manifest attribute, Netbeans

I have the following problem when trying to launch a .jar file of my program in cmd: no main manifest attribute, in path/filename.jar
I tried to add the Main-Class to the MANIFEST.MF file, but then it says Error: Could not find or load main class.
In NetBeans I have set the Main Class at Properties->Run->Main Class to the one, which holds the function main(String[] args) in my case "com.nxp.vda_with_gui_1.version.App". I have also added VM Options for the JavaFX modules like the following:
--module-path C:\NetbeansJavaFX --add-modules javafx.controls,javafx.base,javafx.fxml,javafx.graphics,javafx.media
In NetBeans I can build and launch up my program without any errors, but when I try to "Run File" (Shift + F6) a different error will be put out:
Error: JavaFX runtime components are missing, and are required to run this application Command execution failed.
Any tips how to solve it?
Below you can find a picture of my file/package structure and some other information, maybe it helps finding a solution quicker:
file/package structure
JDK version: 16
JavaFX version: 18.0.2
OS: Windows

"NotSerializableException" occurs when running Corda-Sample on Intellij

1.Clone Sample like "git clone https://github.com/corda/samples"
2.Open Corda-Sample by Intellij
3.Chose"Run Example Cordapp - Kotlin" And Run
4.Open "build.gradle"(Clients/src) And Run "runPartyAServer" and "runPartyBServer"
5.Access "http://localhost:50005/" And "Create IOU"
6.Exception occured.
java.io.NotSerializableException: com.example.flow.ExampleFlow$Initiator was not found by the node, check the Node containing the CorDapp that implements com.example.flow.ExampleFlow$Initiator is loaded and on the Classpath
How can I solve this Exception?
Are you running nodes?
This command is example 「cordapp-example」,
./cordapp-example/workflows-kotlin/build/nodes/runnodes
If the build folder does not exist, build it.
This command is build command, (Please run 「cordapp-example」directory)
./gradlew clean deployNodes
Cheers!

Unable to run unit tests in corda 4

I was running my unit test in corda 4from intellij but getting this error.
Error opening zip file or JAR manifest missing : lib/quasar.jar-Dco.paralleluniverse.fibers.verifyInstrumentation
Error occurred during initialization of VMagent library failed to init: instrument
think the path is probably wrong and it cant find the quasar.jar. Also there should be a space between quasar.jar and -dco.parallel.... Try use an absolute path instead.
It happened to me also found that is was the wrong path of [lib/quasar.jar] on the what did was point it to the main project path and it worked.
The full path to the jar in my IDE run config in this image.

Grunt error SailsJS when lifting with --no-frontend

I have a Sails Api which the first time boots like a charm.
Press CTRL + C to stop it and then try to start it again. It works, BUT,
error: ** Grunt :: An error occurred. **
error:
------------------------------------------------------------------------
Aborted due to warnings.
Running "clean:dev" (clean) task
Warning: Cannot delete files outside the current working directory.
------------------------------------------------------------------------
error: Looks like a Grunt error occurred--
error: Please fix it, then **restart Sails** to continue running tasks (e.g. watching for changes in assets)
error: Or if you're stuck, check out the troubleshooting tips below.
error: Troubleshooting tips:
error:
error: *-> Are "grunt" and related grunt task modules installed locally? Run `npm install` if you're not sure.
error:
error: *-> You might have a malformed LESS, SASS, CoffeeScript file, etc.
error:
error: *-> Or maybe you don't have permissions to access the `.tmp` directory?
error: e.g., `folderthingy` ?
error:
error: If you think this might be the case, try running:
error: sudo chown -R 501 folderthingy
Well, I check it all, and the folder just is my own and has enough rights. I also put up a 777 for testing purposes but this didn't change a thing.
Then, I decided to clear out all the contents of the .tmp folder and try to boot again. This worked like a charm, .tmp got filled again, and when I stopped the server, tried to reboot it, I got the exact same error message again!
I'm booting with the --no-frontend option, so in fact I don't understand why it even wants to load grunt.
Why is this happening? What's going wrong here?
Why it happens is still not known to mankind, but I fixed it with removing the Gruntfile.
Fixed this by following below steps :
File path in your sails app -> tasks/config/sync.js
// 1. Install it as a local dependency of your Sails app:
// ```
// $ npm install grunt-sync --save-dev --save-exact
// ```
//
//
// 2. Then uncomment the following code:
//
// ```
// // Load Grunt plugin from the node_modules/ folder.
// grunt.loadNpmTasks('grunt-sync');
// ```
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Note: Work for Warning "sync:dev" not found
If you are using Linux, try doing sudo sails lift, you can have problems with permissions (happened to me). If Windows - check that no file manager or some other program is blocking the .tmp folder (also happened to me when I opened the folder in Total Commander).
In any case, since you don't use frontend, you can simply remove some of the grunt tasks (in the folder tasks/ you have README.md which explains which tasks are run in which case) or all of them (see documentation) and you won't have the problem.
i also got this error-
error: ** Grunt :: An error occurred. **
error:
------------------------------------------------------------------------
Aborted due to warnings.
Running "sass:dev" (sass) task
> error: Looks like a Grunt error occurred--
>
> error: Please fix it, then **restart Sails** to continue running tasks
> (e.g. watching for changes in assets)
>
> error: Or if you're stuck, check out the troubleshooting tips below.
error: Troubleshooting tips:
error:
error: *-> Are "grunt" and related grunt task modules installed locally? Run `npm install` if you're not sure.
error:
error: *-> You might have a malformed LESS, SASS, CoffeeScript file, etc.
error:
error: *-> Or maybe you don't have permissions to access the `.tmp` directory?
error: e.g., `/Users/siyaram.malav/Desktop/repo/project1/.tmp` ?
this error came because it could not find the sass module.And ran following command
sudo gem install sass
it worked for me.
In your case, try running sudo gem install clean command.
it should work.
thanks.
I had the same problem while following this tutorial:
https://www.youtube.com/watch?v=ZE7ye2G_H9Q&index=4&list=PLf8i4fc0zJBzLhOe6FwHpGhBDgqwInJWZ
I created a "linker" folder since that's what the guy did, which then prompted me with the error. It looks like he's using an older version of SailsJS since he runs into no errors.
Did you by any chance create a new folder in the assets folder? If you did, the problem is that grunt isn't able to run tasks on the specific folder since it's not linked with the rest of the assets folders and files. Try placing all newly created files within already existing folders and trying again. This worked for me.

MbUnit tests pass when run directly from visual studio, but fails when run via command line

I've been using MbUnit for unit testing for a while, along with Nhibernate and Sqlite.
I am now trying to setup a CI server with Jenkins - I have successfully managed to configure Jenkins to pull the code from github and compile it using MSBuild everytime anyone pushes to github. Finally I want to run tests on the code on each successful build.
The tests all run successfully when run from within Visual Studio without any problem whatsoever, I can run each test individually or the whole project and they all run OK. However when I call Gallio.Echo.exe from command line all the tests that have to do with Sqlite fails.
This is what I've been doing to run the test from command line:
"C:\Program Files\Gallio\bin\Gallio.Echo.exe" /report-type:Html /verbosity:quiet "D:\MyProject\MyProject.Tests\bin\Debug\*.Tests.dll"
(ps: There seems to be absolutely no documentation about gallio tools - have I been looking in all the wrong palces? I want to find more about the command line arguments that I can pass)
The tests fail with this:
Gallio Echo - Version 3.3 build 454
Get the latest version at http://www.gallio.org/
Initializing the runtime and loading plugins.
Verifying test files.
Initializing the test runner.
Running the tests.
[failed] Fixture MyProject.Tests/VerificationTests
Set Up
FluentNHibernate.Cfg.FluentConfigurationException: An invalid or incomplete configuration was used while creating a SessionFactory. Check PotentialReasons collection, and InnerException for more detail.
---> NHibernate.HibernateException: Could not create the driver from NHibernate.Driver.SQLite20Driver, NHibernate, Version=3.3.1.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4.
---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.ArgumentException: Unable to find the requested .Net Framework Data Provider. It may not be installed.
HResult: -2147024809
at System.Data.Common.DbProviderFactories.GetFactory(String providerInvariantName)
at NHibernate.Driver.ReflectionBasedDriver..ctor(String providerInvariantName, String driverAssemblyName, String connectionTypeName, String commandTypeName)
at NHibernate.Driver.SQLite20Driver..ctor()
--- End of inner exception stack trace ---
I've tried a few solutions mentioned around on SO but haven't been able to solve it. The only close thing was this answer but I am not sure what the user means by adding to config files.
Anyone has any idea why the tests fail from command line but are okay when run from within VS please?
Thanks.

Resources