执行测试时未加载firefox插件

时间:2015-03-12 09:01:56

标签: firefox robotframework

我使用的是firefox插件"标题工具"我的selenium2library /资源中的 prefs.js 如下: -

# Mozilla User Preferences

/* Do not edit this file.
 *
 * If you make changes to this file while the application is running,
 * the changes will be overwritten when the application exits.
 *
 * To make a manual change to preferences, you can visit the URL about:config
 */

user_pref("app.update.enabled", true);
user_pref("app.update.lastUpdateTime.addon-background-update-timer", 0);
user_pref("app.update.lastUpdateTime.background-update-timer", 0);
user_pref("app.update.lastUpdateTime.blocklist-background-update-timer", 0);
user_pref("app.update.lastUpdateTime.browser-cleanup-thumbnails", 1426143464);
user_pref("app.update.lastUpdateTime.experiments-update-timer", 0);
user_pref("app.update.lastUpdateTime.search-engine-update-timer", 0);
user_pref("app.update.migrated.updateDir", true);
user_pref("browser.bookmarks.restore_default_bookmarks", false);
user_pref("browser.cache.disk.capacity", 358400);
user_pref("browser.cache.disk.smart_size.first_run", false);
user_pref("browser.cache.frecency_experiment", 2);
user_pref("browser.download.importedFromSqlite", true);
user_pref("browser.migration.version", 26);
user_pref("browser.newtabpage.enhanced", true);
user_pref("browser.newtabpage.storageVersion", 1);
user_pref("browser.pagethumbnails.storage_version", 3);
user_pref("browser.places.smartBookmarksVersion", 7);
user_pref("browser.rights.3.shown", true);
user_pref("browser.search.highlightCount", 4);
user_pref("browser.sessionstore.upgradeBackup.latestBuildID", "20150305021524");
user_pref("browser.shell.checkDefaultBrowser", false);
user_pref("browser.slowStartup.averageTime", 12217);
user_pref("browser.slowStartup.samples", 3);
user_pref("browser.startup.homepage", "http://welcome.com.intraorange/");
user_pref("browser.startup.homepage_override.buildID", "20150305021524");
user_pref("browser.startup.homepage_override.mstone", "36.0.1");
user_pref("browser.syncPromoViewsLeftMap", "{\"addons\":4}");
user_pref("browser.taskbar.lastgroupid", "E7CF176E110C211B");
user_pref("datareporting.healthreport.nextDataSubmissionTime", "1426229629644");
user_pref("datareporting.healthreport.service.firstRun", true);
user_pref("datareporting.policy.dataSubmissionPolicyAcceptedVersion", 2);
user_pref("datareporting.policy.dataSubmissionPolicyNotifiedTime", "1426143291916");
user_pref("datareporting.policy.firstRunTime", "1426143229644");
user_pref("datareporting.sessions.current.activeTicks", 3);
user_pref("datareporting.sessions.current.clean", true);
user_pref("datareporting.sessions.current.firstPaint", 952);
user_pref("datareporting.sessions.current.main", 69);
user_pref("datareporting.sessions.current.sessionRestored", 1056);
user_pref("datareporting.sessions.current.startTime", "1426148629078");
user_pref("datareporting.sessions.current.totalTime", 38);
user_pref("datareporting.sessions.currentIndex", 2);
user_pref("datareporting.sessions.previous.0", "{\"s\":1426143197238,\"a\":23,\"t\":144,\"c\":true,\"m\":502,\"fp\":1088,\"sr\":34629}");
user_pref("datareporting.sessions.previous.1", "{\"s\":1426143343218,\"a\":11,\"t\":132,\"c\":true,\"m\":1,\"fp\":950,\"sr\":1084}");
user_pref("extensions.blocklist.pingCountVersion", 0);
user_pref("extensions.bootstrappedAddons", "{}");
user_pref("extensions.databaseSchema", 16);
user_pref("extensions.enabledAddons", "pavesilo%40gmail.com:0.6.1,%7B972ce4c6-7e08-4474-a285-3208198ce6fd%7D:36.0.1");
user_pref("extensions.getAddons.databaseSchema", 5);
user_pref("extensions.headertool.preferencies.editor", "sm_universalid : swkv8851\nftusergivenname : vidushi\nftusersn : shukla\nftapplicationroles :Admin\nftusercredentials : ES;PL");
user_pref("extensions.headertool.preferencies.onoff", true);
user_pref("extensions.lastAppVersion", "36.0.1");
user_pref("extensions.lastPlatformVersion", "36.0.1");
user_pref("extensions.pendingOperations", false);
user_pref("extensions.shownSelectionUI", true);
user_pref("extensions.ui.dictionary.hidden", true);
user_pref("extensions.ui.experiment.hidden", true);
user_pref("extensions.ui.lastCategory", "addons://discover/");
user_pref("extensions.ui.locale.hidden", true);
user_pref("extensions.xpiState", "{\"app-profile\":{\"pavesilo@gmail.com\":{\"d\":\"C:\\\\Users\\\\swkv8851\\\\AppData\\\\Roaming\\\\Mozilla\\\\Firefox\\\\Profiles\\\\2itxhiy8.default\\\\extensions\\\\pavesilo@gmail.com.xpi\",\"e\":true,\"v\":\"0.6.1\",\"st\":1426143343455}},\"app-global\":{\"{972ce4c6-7e08-4474-a285-3208198ce6fd}\":{\"d\":\"C:\\\\Program Files (x86)\\\\Mozilla Firefox\\\\browser\\\\extensions\\\\{972ce4c6-7e08-4474-a285-3208198ce6fd}\",\"e\":true,\"v\":\"36.0.1\",\"st\":1426143188556,\"mt\":1425555445000}},\"winreg-app-global\":{\"{D19CA586-DD6C-4a0a-96F8-14644F340D60}\":{\"d\":\"C:\\\\Program Files (x86)\\\\Common Files\\\\McAfee\\\\SystemCore\",\"st\":1426140476119}}}");
user_pref("gecko.buildID", "20150305021524");
user_pref("gecko.mstone", "36.0.1");
user_pref("gfx.direct3d.last_used_feature_level_idx", 0);
user_pref("media.gmp-gmpopenh264.lastUpdate", 1426143302);
user_pref("media.gmp-gmpopenh264.version", "1.3");
user_pref("media.gmp-manager.lastCheck", 1426143295);
user_pref("network.automatic-ntlm-auth.trusted-uris", ".orange.com,.francetelecom.fr,.ftgroup,.equant.com,.globalone.net");
user_pref("network.cookie.prefsMigrated", true);
user_pref("network.negotiate-auth.delegation-uris", ".orange.com,.francetelecom.fr,.ftgroup,.equant.com,.globalone.net");
user_pref("network.negotiate-auth.trusted-uris", ".orange.com,.francetelecom.fr,.ftgroup,.equant.com,.globalone.net");
user_pref("pdfjs.migrationVersion", 2);
user_pref("pdfjs.previousHandler.alwaysAskBeforeHandling", true);
user_pref("pdfjs.previousHandler.preferredAction", 4);
user_pref("places.history.expiration.transient_current_max_pages", 104058);
user_pref("plugin.disable_full_page_plugin_for_types", "application/pdf");
user_pref("plugin.importedState", true);
user_pref("plugin.state.java", 0);
user_pref("plugin.state.npdeploytk", 0);
user_pref("privacy.sanitize.migrateFx3Prefs", true);
user_pref("signon.importedFromSqlite", true);
user_pref("toolkit.startup.last_success", 1426148629);
user_pref("toolkit.telemetry.previousBuildID", "20150305021524");
user_pref("toolkit.telemetry.prompted", 2);
user_pref("toolkit.telemetry.rejected", true);

当我执行测试时,我的firefox插件没有加载,在这种情况下我只有("标题工具")并且我的页面没有显示。请让我知道错误是什么?或者是否有其他方法可以在机器人框架中创建配置文件。

我在我的Appdata / mozilla /漫游文件夹中为我的firefox提供了相同的配置文件,它运行正常。

1 个答案:

答案 0 :(得分:1)

我想说,首选方法是使用firefox -P开关创建专用测试配置文件。然后在机器人测试用例中启动浏览器,如下所示:

Open Browser    ${URL}    ${BROWSER}    ff_profile_dir=${FF_PROFILE}

路径应指向创建firefox配置文件的目录。有关详细信息,请参阅Selenium2library doc。在Windows机器上,例如: $ {HOME} \应用程序数据\漫游\ Mozilla的\火狐\概况\ o5wy8zbt.MyCustomProfile

Selenium2Library然后将此配置文件复制到TEMP并使用Temp-Profile运行firefox。