I realise that my scenario is not the normal use of Selenium, but I do need to do this, I don't want an alternative architecture!
I need
(Demo Browser) -get-> Servlet-in-Tomcat using Selenium WebDriver ---> Another Web App
My problem is I'm hitting some classpath issues of the kind reported in this question - I don't understand how to apply any of the suggested solutions.
What I did:
- Install Selenium using maven as described here, I have used
<groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-server</artifactId>
as per the article, but I'm not sure whether I should be using that combination.
- Convert to Eclipse project using mvn eclipse:eclipse
- In Eclipse, write some Java against the WebDriver API. This all compiles and runs perfectly.
- Create a Dynamic Web Project and write a servlet. Again no issue.
- Grab my Selecium-based code and move it into the servlet project, selectively merge in the entries from the selenium .classpath file - I the check the build paths in the project Properties it seems to be consistent.
Project launches but hits the class not found error, exactly as reported in the other question.
As I write this I'm beginning to realise that I've not correctly set up my Tomcat classpath - not sure how best to do that.
What would be the best recipe for getting this scenario to work?