Not able to run the ant project when we MAVEN | Selenium Forum
M
Posted on 15/09/2015
[attachment=1:24e1s6jy]build.xml[/attachment:24e1s6jy]Hi Ashish

I was watching MAVEN video of tutorial 31. In that I tried to use build.xml of your project and trying to run throught ANT. The project runs and it opens the browser and after that I wrote the code as
"driver.get("http://yahoo.com");"

It do not go to the above site and command prompt shows me the TEST as failed

Report throwed the exception as


com.google.common.collect.Multimaps.transformValues(Lcom/google/common/collect/ListMultimap;Lcom/google/common/base/Function;)Lcom/google/common/collect/ListMultimap;

java.lang.NoSuchMethodError: com.google.common.collect.Multimaps.transformValues(Lcom/google/common/collect/ListMultimap;Lcom/google/common/base/Function;)Lcom/google/common/collect/ListMultimap;
at com.google.common.net.MediaType.toString(MediaType.java:708)
at org.openqa.selenium.remote.http.JsonHttpCommandCodec.encode(JsonHttpCommandCodec.java:214)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:131)
at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.execute(NewProfileExtensionConnection.java:170)
at org.openqa.selenium.firefox.FirefoxDriver$LazyCommandExecutor.execute(FirefoxDriver.java:393)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:568)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:242)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:128)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:221)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:216)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:212)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:125)
at com.testing.YahooTest.testYahoo(YahooTest.java:16)


Attached is the screenshot of command prompt and my build.xml

M
Replied on 16/09/2015

I didn't understand any of your explanations


M
Replied on 16/09/2015

Please give me the solution on urgent basis because first step of framework is configuring maven so if with maven using ant I will not be able to run the project then its of no use


M
Replied on 17/09/2015

[quote="abdulrahmanchaudhari@gmail.com":1zkp13aq]I didn't understand any of your explanations[/quote:1zkp13aq]

okay let start again.

the screen shot you gave me had this.

[quote:1zkp13aq]multiple version of ANT found[/quote:1zkp13aq]

delete your entire .m2/repository and then run test again.


M
Replied on 17/09/2015

[quote="abdulrahmanchaudhari@gmail.com":2kbk007r]Please give me the solution on urgent basis because first step of framework is configuring maven so if with maven using ant I will not be able to run the project then its of no use[/quote:2kbk007r]

zip and send me your entire project.


M
Replied on 17/09/2015

I got the solution but still small issue I am facing



When I deleted collections folder present under google folder of seleniumhq then my build.xml runs successfully by using jars downloaded by Maven but if I give the command mvn test then that collection folder again comes so my build.xml i.e ant gives the failure

In report,also I get the failure

So my question is that if I deleted the collection folder from the downloaded jars present in my .m2/repository then what should I do if I don't want that jars present in collection folder to appear again


M
Replied on 17/09/2015

Attached is my zip file for my project


M
Replied on 18/09/2015

working for me I tried running your project 3-4 times. after I deleted 1 version Ant jar files.

[attachment=0:k5zfyawj]Screenshot (15).png[/attachment:k5zfyawj]

Responsive image

M
Replied on 19/09/2015

I am facing this issue because of collection folder present in my .m2/repoository

When I deleted collections folder present under google folder of seleniumhq then my build.xml runs successfully by using jars downloaded by Maven but if I give the command mvn test then that collection folder again comes so my build.xml i.e ant gives the failure

In report,also I get the failure

So my question is that if I deleted the collection folder from the downloaded jars present in my .m2/repository then what should I do if I don't want that jars present in collection folder to appear again


M
Replied on 19/09/2015

then delete the other ant version. and use the maven one.

in your E:/ drive//previous pc/selenium/appache ant

you might have to change environment variable.


M
Replied on 06/12/2015

Hi

I did everything which you asked but it is not working

The only solution which worked for me is below
I deleted collections folder present under google folder of seleniumhq under .m2 repository then it ran successfully but if I will again try to run it by mvn run then it will again download the collection folder so my project will again stop running


So my question is that if I deleted the collection folder from the downloaded jars present in my .m2/repository then what should I do if I don't want that jars present in collection folder to appear again

OR
Give me some other solution


M
Replied on 09/12/2015

are you using the 2 maven projects together in one machine?


M
Replied on 09/12/2015

Yes

We can have any no of maven projects ?


M
Replied on 09/12/2015

yes you can use any number of projects but sometimes jar files miss and matches between 2 projects. try to use same version of jar files in both projects.