I am working on application and using Firefox, in that i have PDF in on of the page. and i have below questions on that,
PDF is not getting opened in web page itself instead it is asking with link 'Tap here to activate plugin' (inside place where pdf will open). Once i click on that it will get open. But through selenium code i am not able to click on that(not able to identify element). i tried to use setPreference but Adobe Acrobat is not getting activated.
IF the PDF opens then i have to mouse over on that and perform action like print, zoom-in and zoom-out on Adobe Acrobat DC toolbar and validate functionality.
Could you please help me to resolve these two issues screen shots are attached.
Thanks
Related
enter image description hereHi,Iam new to selenium and java testing. Iam trying to right click on google.com about link and open the link in new window. Up to right click my code works fine. When I send down-arrow nothing happens in the browser. Can anyone tell what's wrong with the code. I have tried it in all different browsers.
I am trying to open in Webview webpages in same quality as it apears in normal browser. It is ok in most cases, but found one "special" url. Urls loads ok, but then after like 2 secons whole pageview is white with picture of play icon in circle. I can not click on it, just nothing. If I open this website in chrome and other browsers everything is just fine. Im not sure if it is not some kind of javascript, but JS is allowed in Webview.
Website is : https://www.auto.cz/volkswagen-polo-gti-zmena-jako-remen-87481
Image that appears is: https://ibb.co/yh7XPpJ
I have tried a lot of Webview settings but nothing helps. I thing it is causing small javascript ad which will pops-up in bottomside of page when url is opened in phone.
WebSettings wsett = webviewVariable.getSettings();
wsett.setJavaScriptEnabled(true);
wsett.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
wsett.setDomStorageEnabled(true);
wsett.setDatabaseEnabled(true);
wsett.setMinimumFontSize(1);
wsett.setMinimumLogicalFontSize(1);
wsett.setBuiltInZoomControls(true);
wsett.setDisplayZoomControls(false);
wsett.setAppCacheEnabled(true);
webviewVariable.loadUrl(url);
I would like to know what settings is missing.
I'm experiencing a strange issue with the SWT browser widget.
I developed a multipage application using the "transition composite" widget from opal widgets.
In my last window I need to display a pdf.
I've been looking for free open source solutions on the web, and the only one I could fine was IcePdf but the renderization of the page was not great.
Then I found out I could use the browser widget to diplay a pdf.
I created a new project with the following code :
shell = new Shell();
shell.setSize(l, h);
Browser browser = new Browser(shell, SWT.NONE);
browser.setBounds(xb, yb, lb, hb);
browser.setUrl("file://" + pdfPath);
and it worked great.
But then if I run the same code in my actual application, it opens the pdf into adobe reader and not into the application itself.
Has anybody else noticed that issue before? And if yes how can I solve it?
Thanks in advice,
Stefano Franchini
I think there is an internet explorer or adobe reader setting which needs to be changed.
This might help:
If you want the browser to open PDF files in a separate Acrobat window, configure the browser to use Acrobat or Adobe Reader as a helper application. Then, when you select a PDF file in Internet Explorer, the browser will open the PDF file in an Acrobat window instead of the browser window.
To configure the browser to use Acrobat or Adobe Reader to open PDF files:
Quit Internet Explorer.
Start Acrobat or Adobe Reader.
Choose "Edit" > "Preferences."
Select Internet in the list on the left.
Deselect "Display PDF" in Browser, and click "OK."
Restart Internet Explorer.
Note: The next time you select a link to a PDF file, the browser may prompt you to open or save the file. If you choose to open the file, the browser opens the file in the helper application that you specified. If you choose to save the file, the browser downloads the file to the hard disk.
https://helpdesk.egnyte.com/hc/en-us/articles/201637224-How-Do-I-Open-PDF-Files-in-Adobe-and-Not-Internet-Explorer-
A different IE setting resolved this for me when running Eclipse 2019-03 and OpenJDK 11 (64-bit) on Windows 7:
Open Internet Explorer
Settings>>Manage add-ons>>Toolbars and Extensions..
Find the menu under Show in the lower-left, change to All add-ons
Find Adobe PDF Reader under the Adobe Inc. section, near the top of the right-hand pane
Change the Status from Disabled to Enabled
Hit Close button
Then try running your SWT Browser instance again with the browser.setURL() as the absolute path of the PDF file to be shown. Don't forget to call browser.update() after setting the URL/path so the SWT component is re-rendered.
(I know, it's been years on this question but I just ran into it and figured out a new solution which I could not find elsewhere on SO, so wanted to capture this in the hopes of helping someone else who might come across this issue in their work).
currently we scrap the data from Websites using Web driver (Selenium)with Java, during that Scrapping we need to do some download process (i.e XML file Download), let me know how will handle the Browser Popup (save As Dialog) using Java
<a href="javascript:downloadXML()">
<img width="40" height="20" border="0" name="imag34" alt="Download" src="/pair/img/tabs/downloadxml.gif">
</a>
We are using the following code to click the above image
driver.findElement(By.xpath("(//img[#alt='Download'])[3]")).click();
After clicking that image, it will open a "Save as.." popup. How do we go to that popup and do testing on that?
This download popup is basically a window.open Javascript call with the URL of the XML file.
So this seems to be the relevant link :
How to switch to the new browser window, which opens after click on the button?
I've just solved this problem using the Robot class from Java. The Robot class allow you to simulate keybord press, in so doing you can work with TABs and Enters in order to execute the download.
This is actually a windows pop up and firebug will not able to detect this.If you are using windows OS then you can use AutoIT tool this will solve your problem.
Requirement is to download the Excel file from IE9 browser. I could able to click the Download button using Web driver in Java by which new window is displayed as shown below:
When I am trying to view the attributes of save button in IE developer tool, tool could not recognize them. Please help where is the problem with this window or how to resolve this issue.