I am new to automation and trying to do testing with multiple browsers. What I have is working in Chrome, but Firefox has been a bit more of an issue. I am testing logging in a website and going to a page that can use my location information to get weather data. As soon as I log in, I get a Firefox request for permission to get location. I have been trying unsuccessfully to create a separate Firefox profile that I access during testing that will allow location and save it. If I click save during testing and I don’t click to remember on log in, it will ask again when I go to the weather page and click a “Get Current” button for local date and weather data. My first image is the message I get on login
Next image is my profile dictionary in Web UI Desired Capabilities in Project Settings
One thing to try, that I just recently noticed. The following does not work:
WebDriver driver = new FirefoxDriver(...);
DriverFactory.changeWebDriver(driver);
WebUI.openBrowser(...);
What this will do is:
1.) new FirefoxDriver(...) will open a new browser instance and driver, with your custom capabilities/options.
2.) DriverFactory.changeWebDriver(driver) will correctly give KS a reference to your custom driver.
3.) WebUI.openBrowser(...) <- this is the problem. This will close your custom browser/driver, and open a new one, without your custom settings.
I’m not exactly sure of your order of operations, but it looks like this may be causing you problems. If instead of calling WebUI.openBrowser(...) you call:
WebUI.navigateToUrl(...)
… you’ll notice that your custom browser/driver remains active, and KS uses that instead.
@Brandon_Hein Thank you for the response. I am coming back to this after being on another project. I went through and do not seem to have openBrowser and do have navigateToUrl, but I still seem to have the location access question every time I run in Firefox. Wasn’t sure if you knew of any other work around to that it save the permission to have access to my location?
@kazurayam I am actually working on it in our Dev environment behind our company firewall so you will not be able to access it. Is there a way to set profile preferences with Katalon rather than creating a firefox driver?
Browsers (FF, Chrome, …) have so many preferences/properties/desired capabilities to solve so many customisation requirements that there is no comprehensive resource that tells you for-what and how. All we can do is to make Google-searchs a lot for know-how fragments, and try them yourself against your Application Under Test. That is the reason why I asked you if your AUT is accessible for me. Unfortunately your AUT is not public. Ok, then. Please help yourself.
@kazurayam Thank you for all your assistance and patience with me as I am new to all this automation work and working with software in general. Even if I provided my URL it wouldn’t work outside of my company. I will keep working on this on my end and reach out if I have any more issues or reach a solution. Thank you again.