PDF.js / PDFViewer should Trigger "Always Ask" Window - not SaveAs - pdf

I´ve got reports from some Users which were used to the Firefox "Always Ask" Window or "how to handle the download" Question, when klicking the "Save" button in the in-Browser PDF.js viewer.
Screenshot of PDF.js Plugin with marked SaveAs Button
This does not seem to work now, I am not sure if it happened after an update or something broke.
Anyone know the solution how to alter the setting? The usual Way in Firefox doesnt affect this, even the right setting is active, If I want to download a regular PDF by link, I get the correct "Always Ask" Window, but not inside PDF.Js.
If You ask Yourself why I am asking this if its set on "Always Ask" Anyway - There are certain applications which seem to force the appearance of an embedded PDF.Js viewer regardless from the setting - from here it is desirable, if the user could then decide what happens if clicked on the Save Button.

Related

How to identify Adobe flash player pop-up window using selenium for validation?

Is there a way selenium can identify and validate a Adobe flash player pop-up window?
say, you visit this site (http://sports.coral.co.uk/#) and click on "Coral Radio" submenu under Sports Menu. It opens a Adobe pop-up window. I can validate the presence of a pop-up window opening and close it, but I want to know if there is a way to assert on some content of that window? at least the title of the page before I close it?
Thanks for responding if anyone knows how to deal with this scenario.
To switch to a popup window, you need to use driver.getWindowHandles() and iterate through them. Then you can use driver.getTitle();
I've never found a way to get any content from Flash. I've heard something about automatic screenshots in headless mode, but then you have to check it manually probably again.

How can I stop Adobe Reader from asking "Save As" when saving a PDF form (i.e. allow just "Save")?

Does anyone know how to call Adobe Reader from the command line to open a pre-populated Adobe Form (with Extensions enabled) e.g MRBIGSORDER0001.PDF, allow the user to alter it and then do a save and exit?
At present when the populated form is opened for updating, hitting Save or the Save button on the toolbar prompts the user with "Save As", which is causing them to create multiple versions.
This issues appears to be related to new Security / Sandbox settings from Adobe Reader X onwards.
--
It is not clear exactly how to stop this from happening on a fine "level" but going to:
Edit --> Preferences --> Security (Enhanced)
Turning off "[ ] Enable Protected Mode at Startup" certianly stops this odd behavior cold.
I am looking into "Priveledged Locations" settings to see if I can fine tune this.
cheers,
JonHD
Make sure you are not using the Preview pane in the windows View. If you just use the Navigation pane and not preview or details pane then you should be able to just save.
It's like windows is holding the file open and so it is an active file and you can't just do a save you have to do a save as.
I think it must be a bug with the windows update
If you want end-users to be able to save a document that has been filled out, you need to Reader-enable the form.
Reader-enabling can only be done with Adobe software as the concept consists of digitally signing the document using a private key owned by Adobe. This digital signature unlocks functionality in Adobe Reader that is otherwise only available in Adobe Acrobat.
So, the solution is:
Make sure that the original form is reader-enabled (use Adobe Acrobat to do this),
Do not break the reader-enabling when pre-filling the form,
Thanks to the two previous steps, the "Save" button will work in your current set-up.

How to get Selenium to respond to Chrome's site init popup?

I am trying out Selenium with ChromeDriver to automate some audio/video tests.
But When I fireup the Chrome Browser with my app it asks me the question http:... wants to use your camera and microphone Allow Deny Options I want to click on Allow and proceed with the scripting on the site. But I cannot proceed without selecting Allow. Unfortunately Chrome pops up this question in a sort of Non-DOM format that I am not able to do a driver.findElement the obvious way and respond with a "click" on the "Allow" option. Has anyone of you encountered this situation and what is the best way to deal with this ?
Cheers !
-- Brian
See this answer (print dialog) or this answer ("Run As..." dialog).
Different dialogs, but the reason (in short, WebDriver can't handle these dialogs) and possible solutions are absolutely the same:
The Robot class, it allows you to "press" programatically anything on the keyboard (or clicking blindly) and therefore getting rid of the dialog by, say, pressing Enter or Esc. However, as told above, any advanced interaction is dependant on OS / language / printer.
// press Escape programatically - the print dialog must have focus, obviously
Robot r = new Robot();
r.keyPress(KeyEvent.VK_ESCAPE);
r.keyRelease(KeyEvent.VK_ESCAPE);
You can, of course, type anything via this class, too.
AutoIt. It's a Windows program useful for handling any system-level automation. Same dependancy as above.
Note that (as far as I know) you can't really check whether the dialog showed up or not, so you won't be able to catch a possible error if it runs on a computer without a camera...
If you're using a ChromeDriver you can get to any 'native' popups using
Alert popup = webDriver.switchTo().alert();
// here you can examine the text within the alert using popup.getText();
popup.accept();

Squeak System Browser Questions

I am using (a school modified version of) the "Squeak By Example" (SBE) image for a OOP/OOD class. However, my System Browser is missing a few features that appear in SBE. I assume there are some configuration options that can get them back for me, but I can't find them yet.
My questions are:
1) How do I get the buttons back? In the bottom pane there should be a bunch of button (browse, senders, implementors, versions, ..., source). My buttons are missing.
2) How do I get the small workspace area above the buttons to appear? There is supposed to be an area that I can type in, below the top panes, and above the buttons, but it doesn't appear.
Thanks in advance!
Robert
Edit - I did fool around in the Preferences Browser and tried a lot of settings. I managed to make the buttons come back and then later got that small (unknown name) workspace pane back, but I have no idea how. I have tried to systematically turn stuff off again to find out what setting(s) controlled what, but I was unable to determine what controlled either problem. So even though I have it working, I would like some squeak/smalltalk knowledgeable person to let me know how to control these as it might help me learn...
"In the bottom pane there should be a bunch of button (browse, senders, implementors, versions, ..., source). " -- switch on the optionalButtons preference in the preferences browser.
The "area that I can type in, below the top panes, and above the buttons, but it doesn't appear" sounds like the annotation pane - this gives you summary information about the method you're currently viewing, and it's controlled by the annotationPanes preference. Alternatively you may be referring to the Mercury Panel which is used for fast navigation to other classes and methods; this is (of course :-) controlled by the mercuryPanel preference.
If you've been messing around, you may also find that you now have an incorrect system browser selected. Squeak has a choice of browsers which can act as the System Browser. You can choose between them by clicking the menu button on the System Browser and selecting "Choose new default Browser". Open a new browser window to see what effect this has had.
You may also want to try a Pharo image which has everything configured the way you want by default.
Do you have access to the Preferences Browser? It should be in the main system menu. You can alter all sorts of things via this browser, including which buttons appear in teh system browser?

How can I navigate to different webpages in the same MSIE window in VB.NET

I have code that opens a new window but I want to be able to edit the same one.
System.Diagnostics.Process.Start("iexplore.exe", "http://www.live.com")
I'm not sure exactly but a good pointer to start off might be to get the handle of the window you're interested in:
http://www.pocketpcdn.com/articles/dotnetcf_hwnd.html
And then separately investigate what interop messages you can send to IE to change the URL in tab X
In order of increasing difficulty and increased control/power:
Send input text to your IE process. Alt-D to focus on the navigation bar, then the URL, then ENTER.
Use MSAA to find the navigation bar and send it text, as above.
Use MSAA to get IHTMLDocument access to the browser, and then programmatically drive the browser with that, and the related interfaces.
I don't know your exact scenario, but if you can host your own instance of MSHTML, or a WebBrowser control, it will make it a lot easier to get the interfaces and do the manipulations mentioned in #3 above; doing that stuff cross-process is fraught with peril.
I just did a web search and turned up a WatiN tool that apparently wraps a lot of this work; perhaps it would be useful for you.
If you are using 2008 there is a feature where you could create a second form and then add a Webbrowser control
the page could then be called by
myForm.show
The page could then be changed with the
Webbrowser1.Url = New Uri("http://www.google.com")
Use the following code:
System.Diagnostics.Process.Start("http://www.live.com")
That is: do not invoke iexplore.exe directly – just let the system figure out which default browser to open.
This may yield two behaviours:
Either it opens a new tab in an existing Internet Explorer window,
or it creates a new window.
The important point is that this depends on a preference that can be controlled within the Internet Explorer application. If a new window opens, then this is the setting chosen by the user – do not try to override it: overriding the user’s preferences is considered bad manners.
If the users don’t want a new window opened, they can simply change that in their Internet Explorer preferences.