Automated Web Interaction without Selenium / ChromeDriver - c#

The goal is to provide a lightweight application (probably .NET) that will provide very limited functionality to interact with a specific web application in our organization (it's Workday, if that helps.)
We have so far done this successfully using Selenium -- requiring each user to have Chrome installed and - importantly - to have the version of chromedriver.exe that is compatible with their Chromium version. Most of the application consists of chromedriver.FindElementByXPath(x).Click and chromedriver.FindElementByXPath(x).SendKeys(t) statements.
However, it's becoming cumbersome to ensure that the right chromedriver is installed for all the users, and we'd like this application to be agnostic about the browser (or at least, support any installation of Chrome, Edge, Firefox on the user's device.)
So the simple question is -- can we execute simple activities against the site (clicking some of the button tiles and sendkeys to populate textboxes) without Selenium?
I'm looking into possibly using Microsoft UI Automation or something that can simply handle clicks and text entry through GETs and POSTs (and no, using an API is probably not an option.)

Don't work too hard studying the link you provided. Why? Because the question is not asking to automate anything but a browser app. Unless of course your app embeds a browser... Automating desktop applications is difficult but can be done.
I'd look deeply into Microsoft's Playwright. It's a Selenium free product for browser automation. It's current team of engineers are the best in the industry, many of them were on the Puppeteer project at Google. Apart from Cypress, Playwright appears to be best in class now. The problem with Cypress is that you have to run it in a pseudo IDE based in a dedicated browser.

Related

Run local web application but restrict access to resources

I'll try to keep this coherent and to the point, been coding all day and a little fried right now. I know doing this is also entirely possible, I'm just not entirely how to do it directly.
The idea is I'm working on a program I'd like to make commercial and sell in the future. Currently it's been holding up to testing processes and everything looks good, but now that I'm starting the improve the program's GUI, I'm hitting limitations using Windows Forms (EI, tab control tops not being easily recolor-able, etc, etc), and had a thought... That I could make the GUI look infinitly better if I could import the program into a web page. Using a dot net project makes that relatively easy since I can copy the C# code over and after a bit of tweaking, it should be fairly straight forward to get everything running and then I just need to rewire everything to the web page GUI.
To handle launching the web page, I was contemplating making a program that creates a "harness" (Small graphic program that just runs a command prompt line to initialize the web service and provides a link to the web page being hosted on the local service. This approach works, but the big issue I'm hitting while probing this route is that the "Release" folder generated on the web application isn't fully self contained and in addition to this all resources are visible. (Hard to sell a product if the first person you sell it to can just distribute the source code around)
So ideally at this point, I'm looking to see if anyone can guide me in the right direct. I'm not sure how to go about creating a program that runs an app inside a local browser AND hides/otherwise makes all the code / resources (images, etc) unviewable/inaccessible to anything outside the program.
Sorry if this is a bit rambly, not entirely sure how to actually ask/find what I'm looking for. (There maybe a name for the thing I'm looking for and I've just never heard of it before.)
I would recommend you to use WPF windows presentation foundation, you can make much more user friendly and intuitive interfaces in WPF comparing to windows form.
Developing and trying to sell a desktop program as a website is never recommended, the website is meant to be hosted on a server and let the clients access all of its functionalities within the browser. So I would suggest you to go and search for WPF.
You also mentioned that you are struggling to improve the windows form User interface design and are struggling to design attractive GUI. Well this is not true you can make amazing GUIs with windows form. take a look at this link https://www.youtube.com/watch?v=K9Ps66GoD-k this will greatly help you to improve the existing windows form application design you already have developed.

Utiltizing SVN commands from a custom interface

I'm looking to automate the GUI available for TortoiseSVN. Rather than using the one provided and manually inputting the urls, I would like to save off various urls that I switch to on a daily basis and at the click of a button switch my working copy to one of my choosing.
TortioseSVN's 'TortioseProc.exe Switch' command does not support the /url parameter until a future release (1.8), this prevents me from being able to embed these easily within an anchor tag (supported by Tortiose) somewhere on our intranet.
Using the standard svn CLI thats compatible with the 1.7 build I'm able to perform switches and automatically close the command line, however I don't know of a way to perform these from a web interface and as I'm not familiar with desktop development I don't know of a plausible desktop solution.
I'm coming to you StackOverflow in hopes you know of a lightweight desktop alternative that wouldn't require much setup on the users side or better yet (web developer by trade) a web solution.
I want to clarify, I'm not looking for actual code but a library or language that will allow me to meet these requirements as I'm hoping to open this solution up to more developers at my workplace and would rather something that allows easy adoption (not a messy setup).
Thanks!
From a Windows/.NET application (whether it be ASP.NET within IIS, or a standalone application), your best way to go is SharpSVN.
Second place would be to write a wrapper around the command-line client.

Windows application using Silverlight

I want to develop a windows based application in silverlight. I went through many articles and every where I found that "Silverlight is for web based application". I don't know whether I am wrong or right, as my superiors told me that in Silverlight5 we can develop Windows based application. Can any body help me to give a clue for how to start. Any help would be highly appreciated.
Thanks in advance
If you mean a Windows based application which can connect with internet you go for Out of Browser application which silverlight supports but if you want simple plain desktop application, there is no point in using Silverlight, WPF would be the right choice in that case.
Look at this article for building an out of browser app using Silverlight.
Silverlight specializes in building rich UI based Web applications and WPF is best for making UI rich applications for Desktop.
You can run silverlight apps "Out Of Browser", its just a setting in the config. Here's a video with more info: http://www.silverlight.net/learn/videos/all/out-of-browser-experiences/
silverlight is a web-based technology that runs on the client machine. it is, basically, Microsoft's version of Flash.
Now, that being said, you CAN write silverlight apps that run out of the browser. but, they are not "really" windows apps. silverlight is a sub-set of WPF. However, you can also make WPF apps that run in a browser. Confused yet?
The bottom line is that WPF is for desktop apps and is full-featured with access to the machine resources.
while silverlight is a light-weight version of WPF that is intended to be run in a browser, similar to flash. it does not have all the features of a full desktop application due to security model and that sort of thing.
Both have elements that cross into the domain of the other.
Like all good things, the answer is "it depends on what you're trying to do". If you want an application that can run inside the browser, outside the browser, plus on Windows and Mac then Silverlight is the answer. You also get for free/are restricted by a security sandbox; you can get around this sandbox by requiring additional permissions from the user. If you're trying to do something that requires multiple monitor support, access to COM objects, stroke/pen/stylus input, 3D hardware acceleration, or access to a large local file store then WPF is probably the better answer. Silverlight out of browser applications also have a nice "phone home" feature that will automatically download updates; WPF requires you to roll this by hand.
Some folks have mention XBAPs (running WPF inside of a browser). Stay away from this error prone steaming pile of stuff. It's good for demoware, but is not something which you'd want to support.
You heard right.
This is called "out of browser":
Silverlight-based applications typically run within Web pages, but you can enable users to install them from the Web and run them outside the browser.

Building an Internet Explorer Extension/Add-On?

I would like to build a browser extension for IE 7/8. I would like to do it using .NET. Do you know of any resources or tutorials that I could reference to do this? I haven't found much.
Thanks!
JP,
One of the main issues that makes IE extensions hard to develop is the need to develop with C, or .NET.
On the other side, FF and Chrome use (to some extent) JS, which is easier, and has a much lower entrance barrier (How many C "web developers" do you know?).
This is one of the issues / obstacle Crossrider is here to solve.
You can create your first IE plugin within minutes. It will save you a lot of research and development time, and you can write your code with Javascript.
On top of that, if you plan this plugin/extension to also work for browsers other than IE then you can develop a cross browser extension once, using an extensive unified API, and we will make it work for Chrome and Firefox.
Chrome and Firefox each one gets a a native extension file (CRX and XPI respectively) while IE a special EXE engine to run your app.
(Disclaimer: I'm a co-founder of Crossrider)
The same question that was asked two years later has the necessary answer. Everyone should refer to this question now:
How to get started with developing Internet Explorer extensions?

Is it possible to Embed Gecko or Webkit in a Windows Form just like a WebView?

I'd love to know if there is such a thing as a Gecko.NET ;) I mean, just like we can embed a WebView and that is an "instance" of IE7 inside any Windows Forms application (and tell it to navigateto(fancy_url);). I'd love to use Firefox or WebKit.
Anybody tried this?
UPDATE: Please bear in mind that although it is possible to embed Gecko using the mentioned controls, it is still impossible to print while using Gecko.
UPDATE March 2010: It’s still not possible to print natively using GeckoFX, however a couple of methods exist that may be enough, depending upon what you’re trying to do.
See: http://geckofx.org/viewtopic.php?id=796 for more information.
UPDATE October 2013: I am no longer doing Windows development so I have no interest in this, but seems like the development of Gecko can be found here: https://bitbucket.org/geckofx and it seems to be recently updated. Leaving this here for future Windows devs ;)
UPDATE January 2017: I have gotten an email from a company called TeamDev. They created a Chromium-based .NET browser component called "DotNetBrowser" which can be used to display modern web pages in Windows Forms applications.
To quote the email directly:
Here are some details about the component, which might be helpful:
DotNetBrowser is based on Chromium, thus supporting HTML5, CSS3, JS and the latest web standards. The underlying Chromium version of the library is regularly updated.
The component is suitable for WPF as well as Windows Forms desktop applications, and works both for C# and VB.NET.
The library is licensed commercially, however free licences are provided for Open Source and academic projects.
Disclaimer: I have not used this DotNetBrowser for I no longer do Windows Development but may be worth checking if you're looking for a solution to this.
http://code.google.com/p/geckofx/
This is a nice .NET-wrapped version of Gecko
It certainly is possible. All you need to do is register the Mozilla ActiveX control (mozctlx.dll I believe), and you can drag it onto your form as any ActiveX control. The programming interface is similar (though not identical) to the IE one, and you can even use the Microsoft.MSHTML.dll managed library for control in some cases.
I believe this is packaged with Firefox. If not, you can get just the embeddable bits from Mozilla as well. Just do a Google search for Mozilla ActiveX control or Mozilla Embedding C# and that should take you down the right path.
GeckoFX is no longer being updated. The alternative is the MozNet XulRunner wrapper by Se7en Soft. MozNet has a ton of features that GeckoFX doesn't and is being actively updated and maintained.
I'd just like to point out, to all looking to embed Gecko into their applications, that the GeckoFX project appears to have been abandoned by its creators (Skybound Software). MozNET, while previously based on GeckoFX, sorta' picked up the ball and ran with it. It has the full ability to print, do print previews and allows you to set it all up via the native Windows print dialog, even - and a whole lot more.
OpenWebKitSharp is a wrapper arount the WebKit engine (nightly) and is very advanced. Take a look at here (OpenWebKitSharp section): http://code.google.com/p/open-webkit-sharp/
Update 2016:
BrowseEmAll.Gecko
A .Net component which can be used to integrate the Firefox engine into your .Net application. This is based on Geckofx but unlike the current version of Geckofx this will work with a normal release build of Firefox. To use Geckofx you will need to build Firefox yourself. Again commercial support is available but the component itself is fully open source.
(Full disclosure: I work for this company so take everything I say with a grain of salt)
#Martin: Yes, the Adam Locke version is outdated. But that's because a separate distribution is not necessary. It's built with the rest of the Mozilla codebase now.
If you download Prism (ie XulRunner), that will give you a base that you can customize to your needs, and this includes the most recent version of the control (in the \Prism\xulrunner directory, you'll find mozctlx.dll).
#Greg: Actually, it is an ActiveX control. Incidentally, all ActiveX controls are COM controls. ActiveX is built on COM.
As of October 30, 2011, there is new information to add since the time of the previous posts. Specifically, while Skybound stopped maintaining their version, there is at least one actively maintained, free, open-source fork available.
I'm using Hindle's fork at BitBucket, which, by virtue of his tool which parses XpCom idls and creates c# wrappers, is rapidly updated with support for each new version of Firefox/Gecko.
See this post for an overview of other choices.
Additionally, if you find yourself using Gtk instead of Windows.Forms, there is a tarball of webkit-sharp available that allows for easy embedding of WebViews into Gtk# applications.
I Belive "Gecko FX"[1] is the thing you need.
To Quote from the web site
"""
GeckoFX is a Windows Forms control written in clean, commented C# that embeds the Mozilla Gecko browser control in any Windows Forms Application. It also contains a simple class model providing access to the HTML and CSS DOM.
"""
1) I can't post a link as "new users aren't allowed to add hyperlinks" Search for "geckofx" on google code.

Categories

Resources