I have created a centos vm. Installed maven, firefox on it and placed selenium automation code to test my web application on it. The only issue is my automation code works on a specific profile where I need to enable the 'Open new windows in a new tab instead' firefox setting.
How can I create a custom firefox profile including this setting on a vm ?
I did a ssh on my vm and then did
firefox -CreateProfile Selenium
I cant find on which location this profile is created. Also I still could not figure out how to add custom settings, as the above just creates a profile I guess.
Here is a description on how to create (and move and remove) Firefox profiles using the built-in Profile Manager. On linux it is usually located in $HOME/.mozilla/firefox/. Profile names are mapped to directories in profiles.ini
A custom profile can be used both programmatically (using FirefoxProfile, FirefoxOptions, FirefoxDriver) or by command line parameter.
Related
I've been working for few months with QTP (UFT One 15.0.2), and today it has stopped recording (when I do the actions no lines are written in the script and no objects are added to the objects repository) and recognizing objects with the spy feature.
I am using the WEB add-in, and as I've been working for months with Mozilla Firefox I have checked that the WebExtension.xpi is well added to the browser.
I've tried to open mozilla before and after UFT One, I've also restarted my computer, I've checked the size of the screen browser is 100% and that in the Record and Run Settings the option " Record and run on any open browser" is checked for Web.
This situation usually occurs because the company's IT department has changed the related policy, causing the UFT Firefox extension to fail to run normally.
You can check if the HP.UFT.Firefox.NativeMessagingHost running in Windows task manager after openning Firefox while the extension is enabled, and check if the Micro Focus UFT Agent content script loaded in Firefox debugger's Sources tab(note: you need to check the "Enable browser chrome and add-on debugging toolboxes" in Web Developer Tools' Setting firstly).
If one of these things does not exist, you should check the policy change with your IT: did they block the related thing running?
If they all exist, you can open a CPE case to UFT One support. They will help you to do the further investigation.
I have checked that I had the same problem with chrome browser, so not an Extension problem.
Finally I have decided to uninstall and reinstall UFT One, but while uninstalling an error appeared and UFT persisted on the system.
After two trys I have launched UFT One and it has started working again.
I am not sure how long it will work.
I want to install an browser extension before my tests starts. I read on the documentation here that I should create a prerun executable to do this for me. However I am not sure how to this. I have no experience with creating executables
Using the pre-run will only upload the extension onto the SauceLabs Virtual Machine, it won't install it onto the respective browser.
If you want the extension to be installed on the browsers, you may want to consider setting a custom Firefox profile or Chrome options.
Here is a simple Java Example for setting a firefox profile (make sure to use the full path otherwise you will likely get an error):
FirefoxProfile profile = new FirefoxProfile();
profile.addExtension(new File(<PATH TO EXTENSION>));
caps.setCapability(FirefoxDriver.PROFILE, profile);
I have developed a Console App using VS2015 which uses Selenium WebDriver to test some websites.
I now want to install this app onto a server and run it there.
I have already installed the app on the server, but when I try to run it, I get an error saying that "Firefox binary couldn't be found in PATH or default". Firefox is installed in the default path C:\Program Files\Mozilla.
Have you got any suggestions on this? Do I need to install any part of Selenium on the server? (Selenium Standalone Server for example)
The server is running Windows Server 2012 R2
Looks like it's unable to find the Firefox binary on its own. So you have to specify the binary of Firefox explicitly. Use the below code to find the Firefox binary
FirefoxBinary binary = new FirefoxBinary(new File("path/to/binary"));
FirefoxProfile profile = new FirefoxProfile();
WebDriver driver = new FirefoxDriver(binary, profile);
What I would recommend is for you to be using Firefox binary in your test suites and call the path of the executable from a properties file so that you don't have to compile all of your test cases again.
The issue was actually caused by the environment variable %PATH%. The variable didn't contain the path for Firefox default installation, which is
C:\Program Files\Mozilla Firefox
To fix the problem, I simply added that path to the environment variable %PATH% (you can find it by clicking Start, typing "environment variables", and clicking on "Environment Variables..." button on the bottom right of the System Properties tab that open when you look for "environment variables" in the Start menu.
That solved the issue.
Thank you Khaja for you answer anyways.
I'm trying to open google chrome mac with disabled security with the command line
open -a Google\ Chrome --args --disable-web-security
However it keeps opening up parallels windows chrome instead - how do I remove the parallels binding for chrome so that it doesn't open from mac terminal?
Use the full path to the application:
open -a /Applications/Google\ Chrome --args --disable-web-security
Parallels creates folders in ~/Applications for each virtual machine. These folders contain aliases for applications on the virtual machine. My guess is that the command "open -a" is searching the folder ~/Applications before searching the folder /Applications. This is probably desired behavior in many cases - open would find the application installed for the user before finding the application installed system-wide. However, it's causing some confusion in this case.
I couldn't find documentation explaining which path "open" is actually searching, so this is just a guess. However, specifying the full path to the application works for me.
I had this issue while trying to launch the Chrome debugging tools from React Native. Because React was launching the app I couldn't adjust the command it issues as described in the accepted answer.
I fixed it by changing the bundle name in the Parallels application package so it was different than the Mac Chrome version. To do this find the application package for Chrome in Parallels - I found mine in ~/Applications (Parallels).
Right-click on the Chrome application in Finder and select Show Package Contents. Under the Contents folder you should find a Info.plist file. Open this in a text editor and modify the string value for the CFBundleName key to something else (I used "Google Chrome Win").
Save the file and the open command should launch the Mac version of Chrome as expected from then on.
I'm running selenium-rc 1.0.3 on a Mac OS X & Windows 7 and both seem to be giving my the annoying accept cert error in firefox. In reading the docs they say I should be able to just use the *firefox run mode and rc should take care of it for me via a proxy or something, but this appears to not work. The only solution that I was able to find on the internet was to create a skeleton profile and pass the path into the rc startup, but thats not a real option. As that doesn't solve problems of testing in IE/Chrome/Safari. Does any know of any other solution that will work.
Selenium-RC docs on HTTPS - http://seleniumhq.org/docs/05_selenium_rc.html#handling-https-and-security-popups
I have tried the solution given by this article (Thanks elliot) and it works well for me! Basically
1. Create a firefox profile:
a. Starting your firefox -ProfileManager (or firefox -P) in cmd.exe (make sure the firefox installation folder path is in your path environment variable, by default it should be just created when you installed firefox) and create a new profile.
b. Select this new profile to browse to the HTTPS URL and accept the self-signed certificate when prompted.
c. Go to the Firefox profile directory.
d. Delete everything in the directory except for the cert_override.txt and cert8.db files.
2. Run your selenium RC server using this profile:
such as java -jar selenium-server.jar -firefoxProfileTemplate c:/Firefox_Profile
If this is an issue with self-signed certificates, you could try using the RCE plugin for Firefox in a custom profile: http://sejq.blogspot.com/2009/01/remember-certificate-exception.html
Internet Explorer's warnings can be disabled through the advanced settings (specifics depend on the version of IE). Worth Googling around for a solution.
For Google Chrome I believe this is an unresolved issue related to: http://code.google.com/p/chromium/issues/detail?id=2010&can=5&colspec=ID%20Stars%20Pri%20Area%20Feature%20Type%20Status%20Summary%20Modified%20Owner%20Mstone%20OS