FAQ
Selenium 2.24, Python 2.7, Windows 7 64-bit, Firefox 13.0.1

The test runs fine on my local machine. But on the build machine, it errors
with the following message:
WebDriverException: Message: 'Can\'t load the profile. Profile Dir:
c:\\users\\<USER_NAME_BLANKED_OUT>\\appdata\\local\\temp\\tmpj0oyp_\\webdriver-py-profilecopy
Firefox output: *** LOG addons.manager: Application has been
upgraded\r\n*** LOG addons.xpi: startup\r\n*** LOG addons.xpi: Skipping
unavailable install location app-system-local\r\n*** LOG addons.xpi:
Skipping unavailable install location app-system-share\r\n*** LOG
addons.xpi: checkForChanges\r\n*** LOG addons.xpi: Opening database\r\n***
ERROR addons.xpi: Error during startup file checks, rolling back any
database changes: [Exception... "Component returned failure code:
0x80520015 (NS_ERROR_FILE_ACCESS_DENIED) [nsIPrefService.savePrefFile]"
nsresult: "0x80520015 (NS_ERROR_FILE_ACCESS_DENIED)" location: "JS frame
:: resource:///modules/XPIProvider.jsm :: XPIDB_openConnection :: line
4351" data: no]\r\n*** ERROR addons.manager: Exception calling provider
startup: [Exception... "Component returned failure code: 0x80004005
(NS_ERROR_FAILURE) [mozIStorageStatement.execute]" nsresult: "0x80004005
(NS_ERROR_FAILURE)" location: "JS frame ::
resource:///modules/XPIProvider.jsm :: XPIDB_rollbackTransaction :: line
4208" data: no]\r\n'

I traced this message to selenium\webdriver\firefox\firefox_binary.py
-> _wait_until_connectable() -> utils.is_connectable(self.profile.port)
-> socket_.connect(("localhost", port))
The execution is timing out because the it is not able to connect to a
socket on the local machine.

------------------------

After spending ~2 days on this, I traced the source of the issue.
We have checked into perforce (as part of the robot framework) the firefox
profile that is to be used with the webdriver.
The problem is perforce makes the files as read-only unless you check them
out for editing.
So since the files were write-able in my machine, the tests ran fine. But
in the build machine, since the profile files (specifically *prefs.js*) are
read-only, so the tests fail as mentioned above.

Making the profile files write-able (once they are copied into the new temp
dir), fixes the error. I have added the following code to the __init__
of selenium\webdriver\firefox\firefox_profile.py:
for profile_file in os.listdir(self.profile_dir):
profile_file = os.path.join(self.profile_dir, profile_file)
if not os.access(profile_file, os.W_OK):
os.chmod(profile_file, shutil.stat.S_IWRITE)


Is there a cleaner way to handle this? .. without altering our existing
setup/workflow - i.e. having the firefox profile (and hence the test
framework) outside source control or modifying the build machine in any way
etc.
Is this a common enough scenario for this code to be checked into the main
branch? (I don't want to have the burden of maintaining this patch in our
source control)


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/Cz8OvjOHUy0J.
To post to this group, send email to selenium-users@googlegroups.com.
To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en-US.

Search Discussions

  • Luke Inman-Semerau at Jul 10, 2012 at 5:05 am
    If you haven't done so already please log a new issue for this
    http://code.google.com/p/selenium/issues/entry

    Post back the issue number here when you do. I'll bring it up with David
    Burns (the maintainer of the python bindings) to see if he thinks this is
    ok or not. I don't see anything in particular that would keep this from
    going in... other than it's not very optimal to have to do a file system
    check on every file in the profile directory.
    On Monday, July 9, 2012 12:26:50 PM UTC-7, Mohan Raj Rajamanickam wrote:

    Selenium 2.24, Python 2.7, Windows 7 64-bit, Firefox 13.0.1

    The test runs fine on my local machine. But on the build machine, it
    errors with the following message:
    WebDriverException: Message: 'Can\'t load the profile. Profile Dir:
    c:\\users\\<USER_NAME_BLANKED_OUT>\\appdata\\local\\temp\\tmpj0oyp_\\webdriver-py-profilecopy
    Firefox output: *** LOG addons.manager: Application has been
    upgraded\r\n*** LOG addons.xpi: startup\r\n*** LOG addons.xpi: Skipping
    unavailable install location app-system-local\r\n*** LOG addons.xpi:
    Skipping unavailable install location app-system-share\r\n*** LOG
    addons.xpi: checkForChanges\r\n*** LOG addons.xpi: Opening database\r\n***
    ERROR addons.xpi: Error during startup file checks, rolling back any
    database changes: [Exception... "Component returned failure code:
    0x80520015 (NS_ERROR_FILE_ACCESS_DENIED) [nsIPrefService.savePrefFile]"
    nsresult: "0x80520015 (NS_ERROR_FILE_ACCESS_DENIED)" location: "JS frame
    :: resource:///modules/XPIProvider.jsm :: XPIDB_openConnection :: line
    4351" data: no]\r\n*** ERROR addons.manager: Exception calling provider
    startup: [Exception... "Component returned failure code: 0x80004005
    (NS_ERROR_FAILURE) [mozIStorageStatement.execute]" nsresult: "0x80004005
    (NS_ERROR_FAILURE)" location: "JS frame ::
    resource:///modules/XPIProvider.jsm :: XPIDB_rollbackTransaction :: line
    4208" data: no]\r\n'

    I traced this message to selenium\webdriver\firefox\firefox_binary.py
    -> _wait_until_connectable() -> utils.is_connectable(self.profile.port)
    -> socket_.connect(("localhost", port))
    The execution is timing out because the it is not able to connect to a
    socket on the local machine.

    ------------------------

    After spending ~2 days on this, I traced the source of the issue.
    We have checked into perforce (as part of the robot framework) the firefox
    profile that is to be used with the webdriver.
    The problem is perforce makes the files as read-only unless you check them
    out for editing.
    So since the files were write-able in my machine, the tests ran fine. But
    in the build machine, since the profile files (specifically *prefs.js*)
    are read-only, so the tests fail as mentioned above.

    Making the profile files write-able (once they are copied into the new
    temp dir), fixes the error. I have added the following code to the
    __init__ of selenium\webdriver\firefox\firefox_profile.py:
    for profile_file in os.listdir(self.profile_dir):
    profile_file = os.path.join(self.profile_dir, profile_file)
    if not os.access(profile_file, os.W_OK):
    os.chmod(profile_file, shutil.stat.S_IWRITE)


    Is there a cleaner way to handle this? .. without altering our existing
    setup/workflow - i.e. having the firefox profile (and hence the test
    framework) outside source control or modifying the build machine in any way
    etc.
    Is this a common enough scenario for this code to be checked into the main
    branch? (I don't want to have the burden of maintaining this patch in our
    source control)

    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/s3jjxNdIJnUJ.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en-US.
  • Mohan Raj Rajamanickam at Jul 10, 2012 at 6:49 pm
    Created a new issue http://code.google.com/p/selenium/issues/detail?id=4228


    As I have commented in the issue:
    "The above code makes all files in the profile dir writeable. I am doing
    this even though I know only prefs.js is causing the problem right now
    because I don't know what other files will trigger the same exception." ..
    and


    "I am not even sure this is a selenium issue. It seems like it could be a firefox issue as selenium copies the given profile files into a new dir and launches firefox. Maybe it is firefox that is rejecting a read-only prefs.js. But even in that case, if it is decided that this is not a selenium issue and that we shouldn't be fixing this - a nicer error message would be great (one that wouldn't have required me to spend ~2 days chasing this issue)."


    Thanks,
    On Tuesday, July 10, 2012 1:05:45 AM UTC-4, Luke Inman-Semerau wrote:

    If you haven't done so already please log a new issue for this
    http://code.google.com/p/selenium/issues/entry

    Post back the issue number here when you do. I'll bring it up with David
    Burns (the maintainer of the python bindings) to see if he thinks this is
    ok or not. I don't see anything in particular that would keep this from
    going in... other than it's not very optimal to have to do a file system
    check on every file in the profile directory.
    On Monday, July 9, 2012 12:26:50 PM UTC-7, Mohan Raj Rajamanickam wrote:

    Selenium 2.24, Python 2.7, Windows 7 64-bit, Firefox 13.0.1

    The test runs fine on my local machine. But on the build machine, it
    errors with the following message:
    WebDriverException: Message: 'Can\'t load the profile. Profile Dir:
    c:\\users\\<USER_NAME_BLANKED_OUT>\\appdata\\local\\temp\\tmpj0oyp_\\webdriver-py-profilecopy
    Firefox output: *** LOG addons.manager: Application has been
    upgraded\r\n*** LOG addons.xpi: startup\r\n*** LOG addons.xpi: Skipping
    unavailable install location app-system-local\r\n*** LOG addons.xpi:
    Skipping unavailable install location app-system-share\r\n*** LOG
    addons.xpi: checkForChanges\r\n*** LOG addons.xpi: Opening database\r\n***
    ERROR addons.xpi: Error during startup file checks, rolling back any
    database changes: [Exception... "Component returned failure code:
    0x80520015 (NS_ERROR_FILE_ACCESS_DENIED) [nsIPrefService.savePrefFile]"
    nsresult: "0x80520015 (NS_ERROR_FILE_ACCESS_DENIED)" location: "JS frame
    :: resource:///modules/XPIProvider.jsm :: XPIDB_openConnection :: line
    4351" data: no]\r\n*** ERROR addons.manager: Exception calling provider
    startup: [Exception... "Component returned failure code: 0x80004005
    (NS_ERROR_FAILURE) [mozIStorageStatement.execute]" nsresult: "0x80004005
    (NS_ERROR_FAILURE)" location: "JS frame ::
    resource:///modules/XPIProvider.jsm :: XPIDB_rollbackTransaction :: line
    4208" data: no]\r\n'

    I traced this message to selenium\webdriver\firefox\firefox_binary.py
    -> _wait_until_connectable() -> utils.is_connectable(self.profile.port)
    -> socket_.connect(("localhost", port))
    The execution is timing out because the it is not able to connect to a
    socket on the local machine.

    ------------------------

    After spending ~2 days on this, I traced the source of the issue.
    We have checked into perforce (as part of the robot framework) the
    firefox profile that is to be used with the webdriver.
    The problem is perforce makes the files as read-only unless you check
    them out for editing.
    So since the files were write-able in my machine, the tests ran fine. But
    in the build machine, since the profile files (specifically *prefs.js*)
    are read-only, so the tests fail as mentioned above.

    Making the profile files write-able (once they are copied into the new
    temp dir), fixes the error. I have added the following code to the
    __init__ of selenium\webdriver\firefox\firefox_profile.py:
    for profile_file in os.listdir(self.profile_dir):
    profile_file = os.path.join(self.profile_dir, profile_file)
    if not os.access(profile_file, os.W_OK):
    os.chmod(profile_file, shutil.stat.S_IWRITE)


    Is there a cleaner way to handle this? .. without altering our existing
    setup/workflow - i.e. having the firefox profile (and hence the test
    framework) outside source control or modifying the build machine in any way
    etc.
    Is this a common enough scenario for this code to be checked into the
    main branch? (I don't want to have the burden of maintaining this patch in
    our source control)

    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/hUU1eVgHTcAJ.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en-US.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupselenium-users @
categoriesselenium
postedJul 9, '12 at 7:40p
activeJul 10, '12 at 6:49p
posts3
users2
websiteseleniumhq.org

People

Translate

site design / logo © 2022 Grokbase