Specifiying firefox 3.6.3 in custom browser path selenium RC - selenium-rc

after specifying custom browser path to firefox 3.6.3 selenium couldnt able to open the testsuite.
<*custom c:/program files/mozilla/firefox.exe>
but error message appeared through RC server that it cannot open the firefox version.
also i am confuse to use custom path through selenium ,
any one please help me out,

To use your firefox 3.6.3, you can use *firefox "Path to firefox.exe" or *chrome "Path to firefox.exe"
Also, make sure you are using the correct path to firefox.exe.

Related

Selenium::WebDriver::Error::UnknownError: unknown error: cannot find Chrome binary (Driver info: chromedriver=2.31.488774)

I'm trying to use Watir gem for writing scripts in ruby but the following code gives an error:
browser = Watir::Browser.new :chrome
Error:
Selenium::WebDriver::Error::UnknownError: unknown error: cannot find Chrome binary
(Driver info: chromedriver=2.31.488774 (7e15618d1bf16df8bf0ecf2914ed1964a387ba0b),platform=Mac OS X 10.12.5 x86_64)
Please let me know the solution to the above issue.
Remember,
You also need to have chrome installed on the machine in order for Selenium Chrome Driver to work.
There may be some libraries which the the version of chromedriver you're trying to install depends on. You need to install these libraries to start chromedriver.
How did I solve this?
I SSH'd into my testing environment and ran chromedriver (I am using the latest version at the time of this answer: 2.35 on Ubuntu Trusty 14.04)
chromedriver: error while loading shared libraries: libnss3.so: cannot open ...
This is the Network Security Service library. Other versions may require some other libraries to be installed. Checkout this answer for more on this.
So I installed the library using apt-get.
p.s: Make sure you have Chrome installed in the box too. If you're using CircleCI, checkout this tip.
This means that your script is unable to find the Chrome driver browser executable. Make sure that you have downloaded the Chrome browser from here. Additionally, from the ChromeDriver Capabilities docs,
Path to the Chrome executable to use (on Mac OS X, this should be the actual binary, not just the app. e.g., '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome')
The solution is to add the location of the Chrome or Chromium app to your PATH. You likely tried to organize the apps on your Mac and did not put Chrome directly in the Applications folder.
However it came to be, the folder containing the Chrome or Chromium .app is not in your PATH. To remedy it, edit your ~/.bash_profile and add a line such as:
export PATH="$PATH:/Applications/Web"
In this example, I have put all of my browsers in a folder called "Web" inside of Applications.
The more technical explanation is that chromedriver searches for a specific subpath within each entry in your PATH. The code that does it is here:
Chromedriver Source Code

Open Firefox with a temporary add-on on startup

Is there a way in which I can open Firefox and force it to load a temporary add-on (webextension) on startup? Normally I have to manually go to about:debugging and select the extension on my hard drive. I'm looking for a flag I can pass when I load Firefox so that this is done automatically.
If this is not possible, is there a recommended extension I can install to simulate that a user opens this URL and adds this extension?
Yes, you can use the command web-ext run from the directory in which the extension exists. This will start Firefox with the WebExtension installed using a temporary profile. web-ext run is intended for testing your WebExtension add-on during development, not for normal use of Firefox. By default, the web-ext run command will watch your WebExtension's files and automatically reload the extension when any of the files are changed. You can disable this feature by using the --no-reload option.
If you are using a Firefox version below 49, you will need to specify the --pre-install option which uses a different method of installing the extension in the profile. However, if you use the --pre-install, your WebExtension will not be operational if you are trying to use a release or beta version of Firefox and the extension is not signed. This basically means that using --pre-install is not useful for Firefox versions below 49 unless you are using a Developer Edition build. Using --pre-install can be useful for Developer Edition versions of Firefox above 49 if you are wanting to test how your extension behaves during Firefox startup. If you do not use the --pre-install option, your extension is installed as a temporary extension and does not need to be signed to be tested in release versions of Firefox.
If you want to use a specific profile, then you need to specify the profile using the --firefox-profile option. MDN says:
When using a custom profile, web-ext first copies the profile. The custom profile will not be altered.
Installing web-ext
You will need to install web-ext. You can do so by following the instructions in Getting started with web-ext. The instructions are to, after you install node/npm, run the following command:
npm install --global web-ext
References
Getting started with web-ext
web-ext command reference

Firefox addon stops working when packed in to xpi

I've made an extension using the addon sdk, and it works as expected when running with cfx run. But when I pack it in to an xpi using cfx xpi and install it - it stops working - no scripts are injected and I'm not even getting any errors :(
Any ideas on how to fix this, or how can I debug this kind of issue?
Found a solution. I'm simply using the .xpi that Firefox packs automatically for testing. In order to use it, run the cfx run with the -p parameter pointing to a profile you've created, like this:
cfx run -p <your path to firefox>\profiles\someprofile
After running, go the that profile's folder, and find in there the extensions folder, it should be something like this:
<your path to firefox>\profiles\someprofile\extensions
In there you'll have your addon with a weird file name and an .xpi file extension. Rename it to anything you want, leaving the .xpi file extension intact.
EDIT:
Apparently the cfx xpi command strips by default what it thinks to be unused modules and .js files. To avoid this you need to run it with a special flag, like this: cfx xpi --no-strip-xpi
try to uninstall and then reinstall the addon you developed
try installing the addon on another firefox build(aurora, nightly, beta)
What I do in such a case:
Disable extension from Addon Manager.
Restart Firefox.
Open Console Window (Ctrl+Shift+J)
Enable extension and watch for errors in Console.
Sometimes startup errors do not appear in Console window unless it is already opened.
Resetting firefox worked for me.
Type about:troubleshooting in your address bar
Click the reset firefox button in the upper-right hand corner of the Troubleshooting page
(source: mozilla.net)
Confirm your action

Selenium webdriver 2, can't get IE8 to open

I cannot get selenium to work with IE8. I am on a mac osx 10.5.8 with paralells virtual environment running Windows xp.
I have set up selenium and Ruby and my ruby scripts work fine with firefox in Windows but I can't get IE to work. I have downloaded selenium-server-standalone-2.8.0.jar and put it in my CLASSPATH but I think I have done it incorrectly.
This is the beginning of the error I get:
C:/Ruby192/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.8.0/lib/selenium/webdriver/common/driver.rb:43:in 'for': unknown driver: :internetexplorer (ArgumentError)
So my guess is that my Ruby script is bad and
"driver = Selenium::WebDriver.for :internetexplorer" is incorrect? Or I have set the CLASSPATH for selenium-server-standalone-2.8.0.jar incorrectly so that InternetExplorerDriver cannot be found.
I've found my mistake: To open internet explorer the driver should be either :ie or :internet_explorer.

Does the -app command line option work properly in Firefox 4?

I have written some software that makes use of the -app command line option in Firefox to launch XUL applications in Firefox's embedded copy of XULRunner. This all worked fine in Firefox 3.x, however when I try with Firefox 4, Firefox either crashes or does nothing (depending on if it is on Mac or Windows).
I have tried a number of other command line options and many of them seem to be variously broken. (such as -v to print the version information, which crashes on OSX)
Does anyone know if there are already registered bugs about this? Was the removal of -app intentional or was it an oversight? Is there any way to work around this problem?
The -app is maintained in firefox 4 and should work.
I do not know if there is a bug for windows and mac os, but I'm using it on linux for several apps, and it works well (my firefox version is Mozilla Firefox 4.0.1)
Just wanted to bump this - as on Firefox 7, -app does not seem to be there:
$ uname -s -r
Linux 2.6.38-11-generic
$ firefox --version
Mozilla Firefox 7.0.1
$ firefox --help
Usage: firefox [ options ... ] [URL]
where options include:
X11 options
--display=DISPLAY X display to use
--sync Make X calls synchronous
--g-fatal-warnings Make all warnings fatal
Firefox options
-h or -help Print this message.
-v or -version Print Firefox version.
-P <profile> Start with <profile>.
-migration Start with migration wizard.
-ProfileManager Start with ProfileManager.
-no-remote Open new instance, not a new window in running instance.
-UILocale <locale> Start with <locale> resources as UI Locale.
-safe-mode Disables extensions and themes for this session.
-jsconsole Open the Error console.
-browser Open a browser window.
-new-window <url> Open <url> in a new window.
-new-tab <url> Open <url> in a new tab.
-preferences Open Preferences dialog.
-search <term> Search <term> with your default search engine.
-private Enable private browsing mode.
-private-toggle Toggle private browsing mode.
-setDefaultBrowser Set this app as the default browser.
-g or --debug Start within debugger
-d or --debugger Specify debugger to start with (eg, gdb or valgrind)
-a or --debugger-args Specify arguments for debugger
I too would love to know when and why it was removed, but I simply cannot find any info online (see also Single-file app with xulrunner - possible?) ...
PS: Just filed a bug here: Bug #880596 in firefox (Ubuntu): “Option '-app' missing from Firefox above version 3” - I thought it would be automatically copied to mozilla's bugzilla (seeing bugs like Bug #207454), but unfortunately, it wasn't so... - bugzilla bug needs to be copied and added manually, it's there now...
I also experienced problems using the -app switch. I'm using Firefox 10, but I have an idea this problem goes right back to FF 4.
The firefox binary, when run with the -help option, does not show list the -app option, which caused me much confusion, but I believe its still there.
The problem for me, instead, was to do with this change in Firefox 4, requiring a chrome manifest file in the application root. Since FF 4, only a single (root) chrome manifest is read, so you must create one with the following line, (or lines, if you want to have multiple manifests).
manifest chrome/chrome.manifest
Then launch the application the usual way
firefox -app path/to/application.ini -jsconsole
(For debugging use the -jsconsole option).
Another note, (you didn't mention having tried this, but I did and it was wrong) -- don't use the -no-remote option. I tried this with the intent of starting a new process for my XUL application separate from already running firefox instances. However, the -app option will create a new process for your application even if firefox instances are already running, so there is no need.
See also this question for more info about the chrome manifest issue.

Resources