I have a "download file" button component in Blazor that when clicked, it calls an endpoint that returns a FileStream. The FileStream is then downloaded to the browser via JSInterop.
All of this works great. But if it's a big file, there's no clear indication or feedback that clicking the button has done anything. I assume that because my button is a call-to-action rather than a hyperlink, the browser has no native way of knowing to display the "Waiting..." animation like when clicking on a hyperlink.
Is my only choice to implement a custom spinner animation?
Related
I am trying to handle a Print Dialog in Chrome. But, Selenium is not able to interacts with it. Is it possible that I click on the Print Hyperlink, instead of opening the new tab with Print Dialog box, it Saves the next page content as PDF with required settings?
Or if I can somehow interact with the Print Dialog in Selenium or C# ?enter image description here
You can use Action class in selenium to send keys to browser. If you want to cancel then send "Esc" else send "Enter" to save. After pressing save, save as dialog will appear which you can handle using AutoIt.
[edit] It is a requirement that the webpage spawn and open in IE and allow user manual interaction after the programmatic actions have completed.[/edit]
I've seen a lot of code examples online about opening webpages or filling in webpage textboxes and getting a return value without ever opening them visibly.
I would like to open a webpage in IE, fill in a few textbox buttons
and then click the submit button and view the results visibly.
I am able to do this with a dll called Selenium, but I do not want to use a 3rd party application and it seems that WebBrowser() should be able to do this?
I can post my failed code examples if that would help.
Thanks.
Maybe this qould fit better as a comment, but I don't have enoigh reputation.
Do you know how HTTP-Forms work?
It would probably be easier to send a HTTP-Request to the target of the form you want to fill, including the parameters you would like to fill into the form.
So you don't need any WebBrowser or similar, just a simple HttpWebRequest object, where you specity the target, the method (very likely POST) and the data you'd like to send.
You can use the webbrowser control in Winforms. It is possible to access every DOM object of the website using the control. No need to open the IE externally.
You just need to specify the webbrowser URL as your link.
Then, fill the textboxes with code,
BrowserID.Document.GetElementById("TextboxID").SetAttribute("Value", "NewVaue")
Also, you can click on the button using InvokeMember("click").
There are lots of stuff using WebBrowser. You can learn it here.
I am maintaining a website written in C# with ASP.NET. At the bottom of a page is an iframe. When a user clicks a button, the source for that iframe is set with Javascript to a page on the server.
showLoadWidget();
document.getElementById("downloadFrame").src='SdrTrendDownload.aspx';
return false;
That page generates a file and allows the user to download it. Once the download file box pops up, I want to call hideLoadWidget() so the 'Loading Data...' overlay goes away. How do I detect when the download file box pops up?
You can't detect that in addition this get more complicated depending on their security setting for the zone detected for your site
I will suggest that you just wrap the call inside updatepanel and use the partial postback to trigger the download prompt and progress template for displaying the loading widget. Let .net and the browser deal with it.
You can't, much less the browsers (like Chrome) who actually don't pop open a download file dialog. What you should probably do is simply attach to the 'ready' or 'loaded' event on the page and hide the widget when that event occurs.
Tejs is correct. IE 9 doesn't do a modal dialog anymore either. What you can do is set up a download progress watcher and programmatically hide the overlay once the watcher sees data is being sent to the client.
Can you use a hidden HTML form element reporting a DOM event such as onload or onfocus? I set some of these hidden fields in formmail.php from tectite.com, which sends email from a page to a mailbox on the server.
Well, I don't think you can do that. "The Download File Box" is a browser feature. What you should do is call the hideLoadWidget() right after you call the download.
I have a web browser control in a C# app that upon page completed it inserts a script into the document.
The script is to change a combo box value for automation.
The thing is when the script is executed the normal behavour of the original site is not working. It is meant to load some results via AJAX.
Though if I click and change the combo box using the mouse it does work.
The script is like this
$("#orderBySelect").val('prfs'); $("#orderBySelect").click();
Though I have tried the change event also as well as a combination of other events including the click event on the selected option.
Any idea why this would be?
If "orderBySelect" is an ASP.NET UserControl (i.e. it has runat="server"), ASP.NET will silently modify that ID (by prefixing a string to it) when it flushes the HTML to your browser.
Generally I work around that by using this instead:
$('[id$="orderBySelect"]')
which basically says "the element with an ID that ends with "orderBySelect".
I'm using WatiN testing Tool I've a scenario where i need to upload a file through the popup window i'm writing scripts in c#.net. when i click on a radio button a popup appears where i need to upload the file and click on the Upload button.Please suggest me some solution.
thankingyou
Asked and answered here Watin - how to test site with popup pages