How do I install Robot framework and selenium 2 library with Jython? - selenium

I searched a lot regarding this. Still I didn't get any definite answer for this. Someone Please explain me on how to do this. Please mention the compatible versions also.

You can use the Selenium 2 java robot framework.
Just add the following dependency to the pom file (if you use maven)
<dependency>
<groupId>com.github.markusbernhardt</groupId>
<artifactId>robotframework-selenium2library-java</artifactId>
<version>1.4.0.6</version>
</dependency>
If you don't use maven, just download the jar from
https://github.com/MarkusBernhardt/robotframework-selenium2library-java
(You can find a link there to the jar with the dependencies in it)
This is compatible with all jython versions (since it's java based)

Related

cucumber.io VS info.cukes , which group i should use for developing the cucumber framework

cucumber jars for selenium are given by info.cukes and cucucumber.io , which one should i use. Any specific reason to use any of these
one difference i have observed is that when i have cucumber-java,cucumber-junit,cucumber-jvm,cucumber-jvm-deps, cucumber-reporting, cucumber-picocontainer jars from info.cukes, few features like inheritance ,dependency injunction are not working, when i have changed info.cukes to cucumber.io in pom.xml, the fatures are working. I am not sure if this is because of the info-cucks jars are not working or supported. Is these info.cukes groups is not suitable for cucumber project
Want to know which group jars i should use.
If you are using Cucumber directly you should use io.cucumber. You also should not concern yourself with any dependencies other then cucumber-java, cucumber-junit and cucumber-picocontainer. They'll be pulled in automatically by your dependency management tool. If you are not using a dependency management tool I would recommend using Maven, Gradle or if you are using Ant; Apache Ivy.
If you are using Cucumber through another project, you should use the groupId and version that project recommends.
info.cukes is deprecating slowly and it's not encouraged for further use. Most of the automation scripts written using info.cukes are migrated to io.cucumber
info.cukes was switched to io.cucumber to accompany changes in Gherkin jars which was consumed by Cucumber-JVM.
The info.cukes version of Gherkin is located in https://mvnrepository.com/artifact/info.cukes/gherkin and the io.cucumber version is at https://mvnrepository.com/artifact/io.cucumber/gherkin
It is very important not to mix up the two groupIds in the same POM. It should be same for all the cucumber jar dependencies.

intellij JavaDoc browser plugin can't find javax

I'm on Arch linux x64 machine , I installed intellij idea but whenever I open a project a startupabortedexception occurs with the JavaDoc browser plugin.
I looked into my idea.log and figured out that it can't find javax.servlet.Servlet, I disabled the plugin in order to open a java project and indeed when I type import javax; it says it can't find javax.
I have java-openjfx installed and still intellij can't find it, what to do in this case ? .
Environment information
jdk:openjdk 1.8.0_60 64 bit.
intellij version: 14.1.5 community edition.
Goal
My goal is to get the JavaDoc browser plugin to work not to program in javax.servlet, I don't intend to do any web development with java right now.
If you don't have Maven project, you can just add the jar to the project. The one you are missing can be downloaded from:
http://mvnrepository.com/artifact/javax.servlet/javax.servlet-api/3.1.0
(just click "Download (JAR)" button)
The class javax.servlet.Servlet is not part of the standard JDK, it is part of the JEE, so you have to add servlet-api.jar to your classpath.
If your project is a Maven project you add the dependency like this:
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
</dependency>
And you probably want to add
<scope>provided</scope>
as this dependency is most likely present in your application server.

How to add Java EE Servlet API library on your compile classpath in IntelliJ

I am new to IntelliJ and I have been working on a few small projects to familiarize myself with IDE and how to develop Java web projects with it.
I recently picked up Professional Java for Web Applications to practise my web development skills and I wanted to try it because it focuses on IntelliJ rather than Eclipse.
My main issues are from not knowing my way around the IDE at all. I have come across a problem that I have been unable to figure out how to do correctly.
How do you add Java EE Servlet API library on your compile classpath ?
Where is the compile classpath located in IntelliJ ?
Any help is appreciated!
This depends on how you are managing dependencies in your project.
If you are using Maven simply add it as a dependency in your pom.xml. When IDEA sees a maven based project it will over for you to Import Changes and/or Enable Auto Import. A common JavaEE 7 maven dependency would look like this in your pom.xml:
<dependencies>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>7.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
If you are only using an IDEA project to manage things (vs. maven, gradle etc.) then you can go into the project structure dialog, click on modules and select the module containing your web tier code. Then click on the dependencies tab. Then click on plus button (+) and add a JAR, then navigate to the JAR containing the servelet APIs that is bundled with your application server and select that.
There are another half dozen ways to set this up and exactly which one you choose depends on a lot of factors like how you want to manage provided dependencies in your project etc. Either of these methods should get you on your way though.

Using different eclipselink than bundled in glassfish-embedded-web

I use glassfish-embedded-web for integration tests inside a maven project:
<dependency>
<groupId>org.glassfish.extras</groupId>
<artifactId>glassfish-embedded-web</artifactId>
<version>3.2-b06</version>
<scope>test</scope>
</dependency>
glassfish-embedded-web comes with Eclipselink 2.2.0, but the project requires features of 2.4. For regular deployment, this is solved by adding je required jars to glassfish's modules directory and this dependency:
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.core</artifactId>
<version>2.4.1</version>
<scope>provided</scope>
</dependency>
I tried also compile scope, still the embedded EL 2.2.0 is used. Adding a test scope dependency on EL 2.4.1 doesn't help. Is there any way to solve this?
Did you try to specify the maven scope test? Otherwise it will not be available while testing! To only provide this version for testing you could use maven profiles.
I see two possible solutions to this problem: either you build your own glassfish-embedded or you just use a brute force approach and modify the jar.
On the 1st approach:
After spending some time building GF I figured that even with my dilettante shell scripting skills its easier to just use the second approach instead of figuring GF code. However, if you're up for this one I'd suggest to start at oracle wiki.
On the 2nd approach: As I've mentioned above, automating this task is the best approach in my opinion (at least if you're dealing with numerous libs and continuous changes), so I wrote this script with all the necessary instructions on how to use it. After you get the new jar just install it in your local repo. I'm using Nexus so for me it was a matter of couple buttons getting pressed.
P.S.: Any comments/advices/improvements on the script are welcome.

Can maven3 runtime execute maven2 compatible pom.xml files

Some of our new projects have been migrated to maven3 and some of the older projects are still using the maven2 compliant pom.xml files.
Can maven3 runtime execute maven2 compatible pom.xml files also?
maven 3 is mostly compatible with maven 2 configuration. But there is still some incompatibilities.
For a full list you should check here there is also sometime problems with plugins (as Torsten suggested).
Resources:
Maven 3.x Plugin Compatibility Matrix
On the same topic:
switching to maven3
Typically yes, but it may depend on the plugin version you are using.
Please note that e.g. the maven site plugin is different for maven 2 and maven 3 or some options of the maven enforcer plugin are no longer valid for maven 3. There might be others.
Yes, it is.
At first you may be alarmed by the fact that it reports a bunch of warnings and sometimes refuses to build before you take care of the problems, but this is actually better for you as (if you run into this) it simply tells you what was wrong with your project so far.
Other than that, the site plugin is completely re-written and you need to use the version for Maven 3. (Check here)