Robot not able to import .java library - jython

I am trying to import the 'SwingLibrary' into my Robot project and have had a lot of issues with it. I was able to work around my first error that seems very common by removing the version number from the file name:
Importing test library 'SwingLibrary' failed: ImportError: No module named SwingLibrary
Now everything is named SwingLibrary (jar & xml included) so I got a little further but I am now seeing the error:
Importing test library 'SwingLibrary' failed: Expected class or module, got javapackage.
I know Robot is supposed to know when it's trying to import a python or jython package but for some reason it doesn't seem to be working here. I did not have an issue importing the java version of Selenium or any of the standard libraries.

Related

Installed modules not found, but show up in python interpreter config

I tried to install EZGmail module for Python. When I check my interpreter settings, it shows it as installed in the PyCharm list. I then use this same interpreter for my project, but I get a module not found error when trying to import EZGmail. What should I check?
Looks like you're trying to import the module in a different casing than it's mentioned on the document.
You're trying to do:
import EZGmail
while the Quickstart document says:
import ezgmail

setting up ACRA 5.5.1 in ReactNative 0.61.2

I am trying to setup ACRA for my react native project which using 0.61.2 version. I followed the basic setup tutorial from https://github.com/ACRA/acra/wiki/BasicSetup .
But while building the project I got errors
/android/app/src/main/java/com/agentnativeapp/MainApplication.java:36: error: cannot find symbol
CoreConfigurationBuilder builder = new CoreConfigurationBuilder(this)
^
symbol: class CoreConfigurationBuilder
location: class MainApplication
I don't understand what am I missing. I thought I might be missing the jar file, but there are no instructions showing the requirement of jar file.
I am new to JAVA side of programming so I am new to all these jar stuff
Turns out it was all importing problem.
import org.acra.;
import org.acra.annotation.;
The above statement doesn't actually import every class, so I have to CoreConfigurationBuilder separately
import org.acra.config.CoreConfigurationBuilder;

No module named lstm_predictor

When I am trying to import the following module,
>>> from lstm_predictor import lstm_model
The error says no module named lstm_predictor.
How can I solve the problem?
It seems like you are utilizing the lstm_predictor package present in https://github.com/tgjeon/TensorFlow-Tutorials-for-Time-Series.
Since this is not a standard module, make sure you have cloned this project and you have the lstm_predictor.py file in the same folder as your python terminal.

Import org.apache.commons.io.FileUtils; not possible in latest apache poi.Instead import org.apache.tools.ant.util.FileUtils; is coming

In the latest Apache poi download(poi-3.15-beta2), while taking screenshot, I need to use FileUtils.copyFile. In its previous version, the imported package was import org.apache.commons.io.FileUtils;. In the latest download, this package is not coming, and it is giving error in my existing executable code. Now I tried to remove the previous import and it gave import org.apache.tools.ant.util.FileUtils;
Code:
FileUtils.copyFile(
scrFile,
new File(location+"LR_"+strDate+"_scr1.png")
);
Gives the error:
Cannot make a static reference to the non-static method
`copyFile(File, File)` from the type `FileUtils`
Apache POI never bundled or required Apache Commons IO, which contains the FileUtils class and so it seems some other project dragged in this code previously, but does not any longer. See http://poi.apache.org/overview.html#components for the list of third-party projects that Apache POI uses.
You should simply add a recent commons-io dependency to your project depending on which type of buildsystem you use, e.g. a normal dependency in Gradle/Maven or the actual jar-file if you have a buildsystem without full dependency-support.
Use the code below:
FileUtils.getFileUtils().copyFile(sourceFile, new File(directory + filename));
And import file should be:
import org.apache.tools.ant.util.FileUtils;

Running evosuite generated tests in Eclipse

I have generated the test cases using evosuite from the command line in Linux.
I try to execute the tests in Eclipse. I have imported in my project the evosuite-standalone-runtime-0.2.0.jar.
All the imported classes regarding evosuite are marked with the error sign.
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.evosuite.runtime.testdata.EvoSuiteFile;
import org.evosuite.runtime.testdata.EvoSuiteLocalAddress;
import org.evosuite.runtime.testdata.EvoSuiteRemoteAddress;
import org.evosuite.runtime.testdata.EvoSuiteURL;
I don't understand this. It looks like these classes are unknown even though are in the imported jar file.
Try:
Right button in your project-->build path--> Add External Archives
(select evosuite-0.2.0.jar)
Do not forget to put the two classes in the project. (ESTest.java and ESTest_scaffolding)
I hope this helps.