Cucumber feature file not getting executed from Test runner - junit

I am trying to run my Cucumber feature file from Test runner but when executed it does nothing on the console. It does not throw any exception or error also. please advise as what may be wrong here
enter image description here
please find the code below
package TestRunners;
import org.junit.runner.RunWith;
import io.cucumber.junit.Cucumber;
import io.cucumber.junit.CucumberOptions;
#RunWith(Cucumber.class)
#CucumberOptions(
features= {"src/test/java/AppFeatures"
},
glue= {"StepDefinations"}
)
public class AmazonTest {
}

Just had same error, when I was trying to run with "Run as -> Cucumber Feature" command nothing was happening.
It seems like the run configuration was not created at all, so what I did is go to "Run as -> Run Configurations" and I created the run configuration manually (go to "Cucumber feature" option and click the "Launch New Configuration" button).

Related

dart:html is placed inside the file but Error is not found?

I have a project using JSON APIs was working fine suddenly error occurs while i was debugging my application and want to modify but when i restarted the app it suddenly shows the following error. The required import 'dart:html'; is already in that file. but don't know why this happens. I tried to import dart.io but same issue. i tried to to restart and invilidate caches but the problem exist.
Error:
Launching lib\main.dart on Infinix X652 in debug mode...
Running Gradle task 'assembleDebug'...
Invalid depfile: E:\Flutter Projects\criclite\.dart_tool\flutter_build\d908c0f5b30e137aa06d363a041f44ee\kernel_snapshot.d
Invalid depfile: E:\Flutter Projects\criclite\.dart_tool\flutter_build\d908c0f5b30e137aa06d363a041f44ee\kernel_snapshot.d
lib/ui/News.dart:6:8: Error: Not found: 'dart:html'
import 'dart:html';
Note: project was working fine this issue suddenly comes out without any changes made.
Please remove import dart:html
then flutter clean
and run will resolve issue.

How to run selenium IDE on chrome

I want to run selenium IDE on chrome. for that i have to write following cmd command. As it is shown here
E:\Automation\Selenium>java -jar selenium-server-standalone-3.5.3.jar chromedriver.exe
But it gives me the error like below :
Exception in thread “main” com.beust.jcommander.ParameterException: Was passed main parameter ‘chromedriver.exe’ but no main parameter was defined
at com.beust.jcommander.JCommander.getMainParameter(JCommander.java:914)
at com.beust.jcommander.JCommander.parseValues(JCommander.java:759)
at com.beust.jcommander.JCommander.parse(JCommander.java:282)
at com.beust.jcommander.JCommander.parse(JCommander.java:265)
at com.beust.jcommander.JCommander.(JCommander.java:210)
at org.openqa.grid.selenium.GridLauncherV3$1.setConfiguration(GridLauncherV3.java:227)
at org.openqa.grid.selenium.GridLauncherV3.buildLauncher(GridLauncherV3.java:155)
at org.openqa.grid.selenium.GridLauncherV3.main(GridLauncherV3.java:75)
Please let me know if am doing anything wrong in the above command.
You need to run it like this
java -jar -Dwebdriver.chrome.driver=chromedriver.exe selenium-server-standalone-3.5.3.jar

Setup libGDX project using MOE plugin

How to setup the libGDX project using MOE plugin.
If i try to select ios-moe at the setup of libGDX project then my build fails with following error.
Generating app in
/Users/USERNAME/Desktop/PaxPlay/libGDXProjects/SampleGame Executing
'/Users/USERNAME/Desktop/PaxPlay/libGDXProjects/SampleGame/gradlew
clean --no-daemon' To honour the JVM settings for this build a new JVM
will be forked. Please consider using the daemon:
https://docs.gradle.org/2.10/userguide/gradle_daemon.html.
Configuration on demand is an incubating feature.
FAILURE: Build failed with an exception.
What went wrong: A problem occurred configuring root project
'SampleGame'.
Could not resolve all dependencies for configuration ':classpath'.
Could not find com.intel.gradle:moeGradlePlugin:1.1.0.final-1.
Searched in the following locations:
file:/Users/USERNAME/.m2/repository/com/intel/gradle/moeGradlePlugin/1.1.0.final-1/moeGradlePlugin-1.1.0.final-1.pom
file:/Users/USERNAME/.m2/repository/com/intel/gradle/moeGradlePlugin/1.1.0.final-1/moeGradlePlugin-1.1.0.final-1.jar
https://repo1.maven.org/maven2/com/intel/gradle/moeGradlePlugin/1.1.0.final-1/moeGradlePlugin-1.1.0.final-1.pom
https://repo1.maven.org/maven2/com/intel/gradle/moeGradlePlugin/1.1.0.final-1/moeGradlePlugin-1.1.0.final-1.jar
https://oss.sonatype.org/content/repositories/snapshots/com/intel/gradle/moeGradlePlugin/1.1.0.final-1/moeGradlePlugin-1.1.0.final-1.pom
https://oss.sonatype.org/content/repositories/snapshots/com/intel/gradle/moeGradlePlugin/1.1.0.final-1/moeGradlePlugin-1.1.0.final-1.jar
file:/Applications/Intel/multi_os_engine/gradle/com/intel/gradle/moeGradlePlugin/1.1.0.final-1/moeGradlePlugin-1.1.0.final-1.pom
file:/Applications/Intel/multi_os_engine/gradle/com/intel/gradle/moeGradlePlugin/1.1.0.final-1/moeGradlePlugin-1.1.0.final-1.jar
Required by: :SampleGame:unspecified
Try:
Run with --stacktrace option to get the stack trace. Run with --info
or --debug option to get more log output.
BUILD FAILED
Total time: 8.492 secs Done! To import in Eclipse: File -> Import ->
Gradle -> Gradle Project To import to Intellij IDEA: File -> Open ->
build.gradle To import to NetBeans: File -> Open Project...
I had the same problem from time to time. Use the newest version of the multi os engine, which requires no local installation.
Multi-OS Engine Release 1.1.0
Samples Repository on GitHub

while using real Android device I got "Selendroid server on the device didn't came up"

I tried to automated android device Galaxy S4 (v4.2.2).
I started with the "getting started" as appear in the selendroid.io web
I used selendroid-standalone-0.10.0-with-dependencies.jar
tried to automate the app tha the web provide as training : selendroid-test-app0.10.0.ap
java jdk 1.8
ADT was installed
by typing "adb devices " - I see the android device as well
the selendroid-standalone-0.10.0-with-dependencies.jar and the app were placed in teh same folder
6.. I run the command :
java -jar selendroid-standalone-0.10.0-with-dependencies.jar -app selendroid-test-app-0.10.0.apk" -- and 4444 port was opened as needed
Now , when I tried to run the follwing code :
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import io.selendroid.SelendroidCapabilities;
import io.selendroid.SelendroidDriver;
public class login {
public static void main(String[] args) throws Exception {
SelendroidCapabilities capa = new SelendroidCapabilities("io.selendroid.testapp:0.10.0");
WebDriver driver = new SelendroidDriver(capa);
}
}
and I got the following exceptions :
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Selendroid server on the device didn't came up after 20sec:
stop the selendroid server from command prompt (press ctrl+C) and uninstall the apk in your device if the apk is already installed.
Now install the resigned apk (which is already created when you run the selendroid server previously) in your device
Now start the selendroid server from your command promt like "java -jar -aut <.apk>"
Now, run your test. It will run without any error
Even I was getting this error.
Fix :
Don't install the app under test by yourself on the device/emulator.
Let selendroid resign and install the apk by itself.

How do I get log4J to work - I'm getting "package org.apache.log4j does not exist"

i know this may be a newbie qestion, but I'm having issues with setting up Log4J:
I want to run a log4j demo, and here's my code:
import org.apache.log4j.Logger;
import org.apache.log4j.BasicConfigurator;
public class HelloLOG4j {
private static final Logger logger = Logger.getLogger(Hello.class);
public static void main(String argv[]) {
BasicConfigurator.configure();
logger.debug("Hello world.");
logger.info("What a beatiful day.");
}
}
I set my Classpath:
C:\Users\Adel\Downloads\apache-log4j-1.2.17\log4j-1.2.17.jar
in both System and User var's
But when I run my program I still get
errors found:
File: C:\Users\Adel\Desktop\various_topics\JavaProjects\HelloLOG4j.java [line: 2]
Error: package org.apache.log4j does not exist
I know that I set classpath right - if I run cmd line:
C:\Program Files\Java\jdk1.6.0_20>print %LOG4J_HOME%
C:\Users\Adel\Downloads\apache-log4j-1.2.17\log4j-1.2.17.jar is currently bein
g printed
You need to add log4j home to the classpath as the JVM needs the path to the log4j classes
if on windows, you can use
set classpath=%classpath%;%LOG4J_HOME%
On linux/ ubuntu (much better than windows for development & servers)
export classpath=$classpath:$LOG4J_HOME
then run your app after adding other paths to classpath
like
set classpath=%classpath%;c:\users\adel\....
You do not need to add log4JHOME again - as %classpath%; will add to the current classpath.
LOG4J_HOME is not known to Java. It is just used by log4j in case of auto config/default config.
On a side note try using the new log4j2 !
Can you show how you are trying to compile the code?
And also, try adding the log4j.jar to 'lib' directory and compile with the classpath referencing this jar
Just want to remind that don't capitalized Log4j keyword , unlike Logger:
import org.apache.Log4j.Logger; //typo
import org.apache.log4j.Logger; //correct
/usr/share/java/log4j-1.2-api-2.8.2.jar path can be located by issue dpkg -L liblog4j2-java(debian-based) command, then do:
$ sudo javac -cp .:xxx.jar:/usr/share/java/log4j-1.2-api-2.8.2.jar xxx.java