Click on web browser - vb.net

I want to programatically click on WebBrowser1's web page.
I tried: WebBrowser1.Document.Click(), it doesn't work.

You cannot click the document itself, however you can access the body via WebBrowser.Document.Body and then call InvokeMember() on that:
WebBrowser1.Document.Body.InvokeMember("click")

Related

When writing end to end selenium tests, should I navigate to a page or just open the URL?

Say I need to submit a form on the 'Classes' page. I am testing the 'enroll into class' feature. Do I navigate to the page by clicking on the menu bar, or do I just directly open the URL of the page?
It depends on the scenario you need to test.
As an autoimation engineer you need to work according to the documentation.
If no scenario defined you can choose easiest way to do that.
Incase clicking on the menu bar is the part of your #Test, you have to access the base page and navigate to the desired page by invoking click() on the menu bar.
Else you can directly open the URL of the page.

The default out-of-the box template for Blazor doesn't work on mobile

If I create a new Blazor application (Server-side or WASM), the default template that is provided with the Counter and Fetch Data menu items doesn't work properly on a mobile device. It run's ok on a desktop browser. Is there something setup incorrectly?
On the mobile, the menu never opens. The hamburger Menu button cannot be tapped. Apart from that, if you manage to navigate by URL to another page, the page keep loading without giving any error.

Showing file selection UI : Integrating Dropbox with OAuth 2

I am trying to create a web page which will allow my user to upload a file to my S3 storage. For choosing the file user can use Google Drive, Dropbox and also local system. Am facing issues while implementing the Dropbox part of this.
Am using this technique for integration(using core API and OAuth 2).
First when user chooses Dropbox i am opening an HTML page in an IFrame. Here I have an authorize button which will open the authorize endpoint mentioned in the above link. This link shows me X-FRAME-Options error inside the Iframe so i had to open this link as a popup to work.
Is there a way around this? I'd like the authorize URL to open in the same iframe by using location.href.
Also when i open it as a popup, after the user logs in successfully the redirect_uri which i pass i getting opened in the popup. I had to do some unconventional setInterval coding to go around this. Can someone suggest a solution for this as well?
I also tried using CSRF tokens as mentioned in Smarx's blog but this also gives me the same error.
EDIT :
#smarx i tried using dropbox.js and it works fine. Stuck at one place
I used the OAuth popup driver and have a button which says sign-in.
First on load i create the client and then the popup driver as below
client = new Dropbox.Client({ key: client_id });
client.authDriver(new Dropbox.AuthDriver.Popup({
receiverUrl: "http://localhost/uploadCare/dbcallback.html"
});
);
And in the call back html i am writing
Dropbox.AuthDriver.Popup.oauthReceiver()
as mentioned in the docs.
But this does not take me back to the original page and show me the list of files.
I particularly did not understand this part of the explanation
"To use the popup driver, create a page on your site that contains the receiver code, change the code to reflect the location of dropbox.js on your site, and point the Dropbox.AuthDriver.Popup constructor to it."
Could you please help me out here.
You definitely can't put dropbox.com into an iframe, for security reasons (e.g. clickjacking).
A few suggestions:
Can you just use the Chooser for your use case? That would certainly be easier for you and your users.
If you can't use the Chooser, is there a reason you're not using dropbox.js? It has a popup auth driver that will pretty much just take care of all this for you. The redirect will definitely happen in the same window as auth, so communication between the windows (usually via localStorage) is generally necessary. This is already done in dropbox.js.

Login to Google from iFrame

I have seen that it is not possible to display any Google page from an iframe. An error message is displayed: cannot display, open in a new window.
I need to login to Google (OpenId authentication) from an iFrame in Joomla (cannot change this). Is there a workaround for this? I thought I could open the authentication page in a new window, and then try to kill that window and reload the original one, but I am not sure I can do that.
Thanks
Well you can just get the form (html code) and put it in your iframe but this will get very messy, for example, there maybe certain JS files that you need to include as well.
Redirecting to Google is best way to implement it.As Using IFrame Sometime does not allowed by some Companies Due to Security.

using selenium-rc can i load a page, click a bookmarklet, and fill up the in-page loaded form?

Is there anyway by which I can automate the following steps
in Selenium-rc
open a page
click on bookmarklet in browser toolbar
fill up data in the form loaded into the page by said bookmarklet.
If the bookmarklet is not accessible as it is part of the browser/bookmark toolbar,
is there a way in which I can inject the javascript into the page and have it execute?
You are 99% there! You're right, you can't actually click the bookmarklet, but you can inject the same JavaScript in to the page. Simply use the getEval() command to evaluate the JavaScript.