Not able to run a simple test through TestNG | Selenium Forum
M
Posted on 21/04/2016
Steps:
1. Created a simple class file (opening a browser and to navigate to gmail.com)
2. Added testng.xml to the project
3. Added build.xml to the project

Getting error in eclipse: Unable to bind to locking port 7054 within 45000 ms

When I run the same test case through ANT (command prompt) it shows the message 'Running' but it never opens up the browser.

Attached is the project.

M
Replied on 22/04/2016

Hi Dipti,

What i observed is, in "testng.xml" file, you have not mentioned the package name. It should be "<class name="Packagename.Test_Ant" ></class>". I just modified and tried and its working fine. Please try.

Thanks,


M
Replied on 22/04/2016

Thank you!

I thought if the package is default package then we don't have to provide the package name. But I updated it and tried again. It works fine when I run it through testing (Eclipse). But when I run the same from ANT(command prompt) nothing happens. It indicates 'Running' but the browser never gets opened.
Please see the attached files.

Responsive image

M
Replied on 23/04/2016

Hi Dipti,

I just tried through command prompt and is working fine. Might be some issue with your build.xml file. Please use the attached build.xml file.

Responsive image

M
Replied on 23/04/2016

Hi,

Thank you for your response. I tried with the build.xml you provided but I see the same results (command prompt says its running but nothing happens). Attached is the build.xml you provided.


M
Replied on 23/04/2016

Did u add TestNg library under your proj? Please find the attached screenshot.

Responsive image

M
Replied on 23/04/2016

dipti is your problem resolved?


M
Replied on 24/04/2016

Issue still exists. I made sure to have the testng library and testng annotation.


M
Replied on 26/04/2016

problem is with your firefox

[quote:wlefx7m9]Unable to bind to locking port 7054 within 45000 ms[/quote:wlefx7m9]

reduce the firefox version.


M
Replied on 26/04/2016

I uninstalled and reinstalled firefox (version 38.0)
I noticed that though I uninstalled and reinstalled firefox it still has the firebug add-in. I didn't have the firefox profile setup.
And then I ran the same test through ANT - as soon as I run the command 'ant run' I get the Mozilla Crash Reporter screen but it never displays any error in command prompt.

Responsive image

M
Replied on 26/04/2016

try this

http://stackoverflow.com/questions/16140865/unable-to-bind-to-locking-port-7054-within-45000-ms