Page Not Loading in Firefox after Authentication - java

I have written Java code using Selenium Webdriver and AutoIt that opens a Firefox driver, navigates to a page that requires authentication via selection of a soft certificate, selects the appropriate certificate when the Certificate Selection window pops up, and clicks OK, at which point the page I'm accessing should load but instead it just loads a blank "New Tab"; a new tab isn't opened per se, just the current tab remains blank with the title of "New Tab".
If I perform this process manually (without having Selenium Webdriver open a Firefox driver and I just launch it myself) using the same exact Firefox profile, the page loads after authentication just fine. I should also note that the page loads successfully using driver instances of Internet Explorer and Chrome.
I am using Firefox v33.1, IE 10, and Chrome v38. Finally, I should note that this has nothing to do with my automated certificate selection process because even if I only have Selenium Webdriver open a Firefox driver and stop there and then I take the wheel and select the certificate myself and click OK, it still does the same thing.
I think Selenium Webdriver might have some annoying guard built into the Firefox drivers it instantiates that prevents it from loading pages requiring authentication. If this is the case, does anyone know how to possibly disable that?

Java needed to be set to "Always Activate" under the Firefox Add-ons -> Plugins. Before it was set to "Ask to Activate" but it never explicitly asked to activate after I selected the certificate, thus the page wouldn't load.

Related

How to switch my IE browser session to chrome browser session?

My 'sign in' is in IE browser and after sign in if i click on the links they get opened in chrome browser. How to switch my current browser from IE to chrome during the same Test case. If i create a instance of chrome driver, it opens a new browser altogether and if i use getWindowHandles to get chrome browser count, it gives one. It didn't recognize the chrome browser opened by the IE browser. Please guide me.
I thought opening a new instance of chrome driver would solve my problem but it doesn't let me go to the session created through IE browser chrome browser.
As far as I know, you cannot do it with Selenium as the driver instance, once created, remains with the same browser until quit.
Firstly, have you set you default browser on PC as IE browser? In that case, the new links may also get opened with IE browser so handling windows/tabs would work.

Camera usage notification at mozilla firefox

I'm writting an automatied test with using selenium dirver and geckoDriver for mozilla firefox v56. The application which I'm testing always ask user to allow the camera usage and always this notification is displayed:
The problem is that, the Mozilla browser session which is created by geckoDriver does not saved settings where I always allow this page to use the camera driver.
I'm talking about this solution: https://support.mozilla.org/en-US/kb/firefox-page-info-window
I cannot find any parameter in about::config page which which I can run firefox to never ask about this permission again. Can I ask for your help?

WebPage works if opened manualy. Returns "Window language could not be determined" if opened via Selenium

I am dealing with a small problem. I am working on automating few tasks in a web application,i can open the webpage,enter the login,click login,BUT then it starts to act strange. If i click on the login manualy it logs in without a problem.
But if i try to do it via selenium (JAVA jdk1.7.0_75,selenium-java-2.53.1,running on IEDriverServer_Win32_3.4.0) the page opens with error An error has occured.
java.lang.NullPointerException. and with "Window language could not be determined "
The page is on the intranet. I guess the application has a problem with the Webdriver (everything works if i try to automate the task using the VBS).
Dont you know any "workaround" for that?
(I can use only IE,because chrome no longer supports NPAPI so the application does not work in chrome)
InternetExplorerDriver driver = new InternetExplorerDriver();
driver.get("*the webpage*");
driver.findElementByName("userid").sendKeys("*login*");
driver.findElementByName("password").clear();
driver.findElementByName("password").sendKeys("*password*");
driver.findElementByName("ctr").sendKeys("*number*");
driver.findElementByName("menuType").click();
driver.findElementByLinkText("OK").click();
I think the problem is somewhere in the settings,because as i mentioned,if o open the browser manualy and login,it works,no errors and i get into the app.
But the webdriver "browser" has somehow different settings (i think) so it does not work. Problem is,that we have restricted access to the settings of browser,so i cant do much about that.
Thank you very much for any suggestions/answers/tips!!
Kind Regards,
Jerry Woodburn

Give focus to an externally launched browser in Selenium

I am opening a window based application in my desktop using Sikuli. After clicking on a button in that application, a browser is opened.
Can I get focus on that browser in Selenium? Can Webdriver detect an already opened browser?
The answer to that is no. In order for Selenium Webdriver to control a browser it must be instantiated as WebDriver object creating a session ID, etc..
One possible solution might be to somehow intercept the URL that is generated by the desktop application and use it to launch a Webdriver instance.

how to run selenium rc test case in Internet Explorer

My selenium RC java code is running successfully on firefox. Can anyone tell me how to run the same test case on internet explorer?
Change the browser start command string you pass to DefaultSelenium factory. It will be *iehta or *iexplore depending on your selenium version.
new DefaultSelenium("localhost", 4444, "*iexplore", "http://www.google.com/");
Check out the docs for more info.
--Sai
Just replace *firefox with *iexplore. The exact code will vary depending on what language you're writing your test in or how you're actually launching the browser.
see: http://seleniumhq.org/docs/05_selenium_rc.html#from-selenese-to-a-program and click the button for your particular language.
If you hit the Script error while running tests on IE with selenium RC, it might be because of not running the selenium server with Administrator privileges. I had the similar issue and could get it running with by running the selenium server as an Administrator
Very simple: Use "*iexplore" instead of "*firefox"
In order to work the scripts on IE do the following steps
1.Navigate to ToolsInternet OptionsSecurityTrusted Sites
2.Click on “Sites” button and add the Urls of the application you are testing in “Add this website to the zone:” and clicking on “Add” button.
3.Navigate to ToolsInternet OptionsSecurity and disable the checkbox “Enable Protected Mode (requires restarting Internet Explorer)” and click on “Apply” and click “Ok”.
a. Navigate to ToolsInternet OptionsSecurity
b. Add all the URL’s of your application in the “Address of websites to allow” and click on “Add” button.
Navigate to ToolsInternet OptionsAdvanced options. Scroll down to the Security section, and select Allow active content to run in files on my computer. This will get rid of the pesky toolbar alert, and allow JavaScript to run automatically.

Categories