Firefox profile in hudson

259 views
Skip to first unread message

poobathy r

unread,
Feb 18, 2013, 1:17:37 AM2/18/13
to seleniu...@googlegroups.com
Hi  Folks
     I am running the automation suite through maven in my local machine
     where i created my firefox profile in my location machine and i hardcoded in my code as "FirefoxProfile fox = new FirefoxProfile(new File("C:\\profile"));"
     it is running in my local machine but when i created the hudson job and  while am running there it says that firefox profile doesn't exist 
     as  far as i know the profile is not there in hudson .. i want to know where can i create the  firefox profile for hudson any help would be appreciated.
     thanks in advance...

-P

Krishnan Mahadevan

unread,
Feb 18, 2013, 1:20:41 AM2/18/13
to seleniu...@googlegroups.com
And why are you specifically looking to working with a Firefox Profile ? Wouldn't your tests NOT work without this ?

To answer to your question, since you did mention "Hudson" am guessing you have your codebase checked into a version control system [Git/SVN etc.,]. So if you absolutely must work with a Firefox Profile, I would suggest that you have it under your project. If you are using Java, you could have your profile under src/test/resources or src/main/resources and then work with that.



Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/



-P

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

poobathy r

unread,
Feb 18, 2013, 1:26:12 AM2/18/13
to seleniu...@googlegroups.com
krishanan thanks for the quick response ... my project contains the SSL certificates and proxies .. so i thought it is better to have an firefox profile yes i have the codebase checked in svn

How can i create my profile under  src/test/resources 
any help would be more usefull to me..

Thanks
Poobathy

Krishnan Mahadevan

unread,
Feb 18, 2013, 1:29:43 AM2/18/13
to seleniu...@googlegroups.com
Just move your c:\FirefoxProfile directory into src/test/resources and change new FirefoxProfile("c:\Profile"); to new FirefoxProfile("src/test/resources/Profile");
That should do.


Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/


poobathy r

unread,
Feb 18, 2013, 4:53:57 AM2/18/13
to seleniu...@googlegroups.com
Krishnan
      I moved  the profile to src/test/resources and after that also it says unable to find the profile 
     and my directory look like attached screenshot 

Still it is not configured in hudson yar.. am not able to run the test cases. 
please help me out 
forum.png

poobathy r

unread,
Feb 18, 2013, 4:55:14 AM2/18/13
to seleniu...@googlegroups.com
Or do you want me to add anything in pom.xml 

Krishnan Mahadevan

unread,
Feb 18, 2013, 5:10:53 AM2/18/13
to seleniu...@googlegroups.com
Poobathy,
Can you please elaborate a bit more on the error ? Stacktrace would do good. Also let me know as to where you are seeing this error. Is it in your local execution or is it in your hudson execution.

If this is on your hudson execution, then I suspect that you may not have checked in your firefox profile into svn.

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/


On Mon, Feb 18, 2013 at 3:23 PM, poobathy r <poob...@gmail.com> wrote:

poobathy r

unread,
Feb 18, 2013, 5:26:19 AM2/18/13
to seleniu...@googlegroups.com
 Krishanan
       Am seeing the error in hudson enviorment    Please find the strack trace

Running TestSuite
[Parser] [WARN] Unknown value of attribute 'parallel' at suite level: ''.
org.openqa.selenium.firefox.UnableToCreateProfileException: Given model profile directory does not exist: src/test/resources/Profile
Build info: version: '2.25.0', revision: '17482', time: '2012-07-18 22:18:01'
System info: os.name: 'Linux', os.arch: 'i386', os.version: '2.6.9-89.0.15.ELlargesmp', java.version: '1.6.0_25'
Driver info: driver.version: unknown
	at org.openqa.selenium.firefox.FirefoxProfile.verifyModel(FirefoxProfile.java:150)
	at org.openqa.selenium.firefox.FirefoxProfile.<init>(FirefoxProfile.java:92)
	at org.openqa.selenium.firefox.FirefoxProfile.<init>(FirefoxProfile.java:79)
	at com.yahoo.ydn.library.Functions.openurl(Functions.java:17)
	at com.yahoo.ydn.library.FirefoxLogin.Startup(FirefoxLogin.java:15)
	at com.yahoo.ydn.library.FirefoxLogin.Login(FirefoxLogin.java:33)
	at com.yahoo.ydn.Forum.community(Forum.java:23)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
	at org.testng.internal.Invoker.invokeMethod(Invoker.java:673)
	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:842)
	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1166)

And the src/test/resources/profile is checked in to Svn
please find the screenshot for profile in svn

-Poobathy
forum.png

Krishnan Mahadevan

unread,
Feb 18, 2013, 6:14:20 AM2/18/13
to seleniu...@googlegroups.com
Poobathy,
The issue is with your CODE.

Take a closer look at the stack trace 

org.openqa.selenium.firefox.UnableToCreateProfileException: Given model profile directory does not exist: src/test/resources/Profile
Build info: version: '2.25.0', revision: '17482', time: '2012-07-18 22:18:01'
System info: os.name: 'Linux', os.arch: 'i386', os.version: '2.6.9-89.0.15.ELlargesmp', java.version: '1.6.0_25'
Driver info: driver.version: unknown


You are running on a LINUX box, which means, folder names are CASE SENSITIVE.

Your code is instructing WebDriver to find the firefox profile from "src/test/resources/Profile" whereas from the screenshot you shared of your svn repo, your folder name is actually "src/test/resources/profile".

Change :

src/test/resources/Profile 

To:

src/test/resources/profile [profile is in all small case ]

That should fix the problem.

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"



poobathy r

unread,
Feb 18, 2013, 6:44:01 AM2/18/13
to seleniu...@googlegroups.com
Thank you very much for the fix and and new problem now 
it says that 

org.openqa.selenium.WebDriverException: Cannot find firefox binary in PATH. Make sure firefox is installed. OS appears to be: LINUX
Build info: version: '2.25.0', revision: '17482', time: '2012-07-18 22:18:01'
System info: os.name: 'Linux', os.arch: 'i386', os.version: '2.6.9-89.0.15.ELlargesmp', java.version: '1.6.0_25'
Driver info: driver.version: FirefoxDriver
	at org.openqa.selenium.firefox.internal.Executable.<init>(Executable.java:70)
	at org.openqa.selenium.firefox.FirefoxBinary.<init>(FirefoxBinary.java:56)
	at org.openqa.selenium.firefox.FirefoxBinary.<init>(FirefoxBinary.java:52)
	at org.openqa.selenium.firefox.FirefoxDriver.getBinary(FirefoxDriver.java:170)
	at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:100)
	at com.yahoo.ydn.library.Functions.openurl(Functions.java:23)
	at com.yahoo.ydn.library.FirefoxLogin.Startup(FirefoxLogin.java:15)
	at com.yahoo.ydn.library.FirefoxLogin.Login(FirefoxLogin.java:33)
	at com.yahoo.ydn.Forum.community(Forum.java:23)
so i have to check in linux machine  for the firefox path ?
but am running on hudson ... anything should i do for this

--Poobathy

Krishnan Mahadevan

unread,
Feb 18, 2013, 7:59:52 AM2/18/13
to seleniu...@googlegroups.com
Is your hudson box a LINUX box or is it a headless environment ?

DO you know if firefox is installed on that box ? If not, then you would have to install it.


Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/


poobathy r

unread,
Feb 18, 2013, 8:03:04 AM2/18/13
to seleniu...@googlegroups.com
Your are right krishanan i request my release manager for the same
and one more thing in which path should  I install the firefox in that Linux box
the normal path where we installed the firefox or some other path we need to give..

Krishnan Mahadevan

unread,
Feb 18, 2013, 8:06:50 AM2/18/13
to seleniu...@googlegroups.com
If Firefox is installed with the default options, am guessing that Selenium/WebDriver should be able to find it on its own without much of a hurdle. But I am guessing that in this case, firefox is NOT even installed.


Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"

poobathy r

unread,
Feb 18, 2013, 12:33:15 PM2/18/13
to seleniu...@googlegroups.com
Thanks krishnan,, As you will install the ff in linux machine
 Thanks  for the timely help
Will update you once my Rm is done with FF installation.

--Poobathy

Shilpa

unread,
Mar 26, 2015, 8:38:01 AM3/26/15
to seleniu...@googlegroups.com
Hi 
I am using firefoxiphone browser for automation testing . After executing selenium script using testng this error is displayed  "org.openqa.selenium.firefox.UnableToCreateProfileException: Given model profile directory does not exist: src\test\resources\firefox_profile\iphone".
Please give me solution for this problem.
SeleniumError.png
Reply all
Reply to author
Forward
0 new messages