C# code for automating a website - c#-4.0

All I want is to record the actions I perform in a website and have to get the code generated for the same in c#.To make it clear,I juss want to run the code so that the manual activity is performed automatically.Any help would be great.Thanks a lot.

Visual Studio has web test recording, it actually can generate code for you. This will record integration between browser and server. So if you rerun, server will think that you are doing something. This option is not browser automation.
WatiN is another option. This time, it is browser automation tool. It has recording tool too.
Third option is Selenium, very similar to WatiN. There are many tools to record Selenium scripts. Most supported one is Selenium IDE.
All tools, are quite easy to work with, and you can find good tutorials on the respective sites.
My best guess, of your needs is that you need #2 or #3. It looks like #3 is more active/mature tool, but I used both with success, so no problem to choose #2.
If you will go with #1, check what edition of Visual Studio you use. I am afraid, Web Testing could be available only in top editions, like Ultimate.

Related

Better way to test multiple websites through automation

I am trying to find a better automation tool to perform the websites testing automatically to identify the bugs using various mobile devices and browsers.
Tried with various no code automation tools and Browserstack and Lambdatest as well. but not able to acheive it perform automatically.
Selenium seems to be the most popular option. However, I suggest Playwright. It has unique features to be able to open new pages, new tabs, new browsers and new windows with its Browser, BrowserContext and Page concept.

adminLTE and VBscripts?

My goal is to use adminLTE (adminLTE) interface in a corporate setting which allows for VBA scripts to run to automate task which my non-tech savy team can accomplish much quicker than by doing them by hand. (pre-filling emails, providing inventory information, creating and printing forms automatically, integrating with stamps.com, reference and display a lot of excel data). From my understanding, the execution of VBA scripts in a web browser is not allowed.
What are my options for accomplishing my goal?
Do this in an HTA file?
Am I wrong about web browser executions of VB scripts?
Do I need to build an application in Visual Studio?
I have a team of three which need to access this and share data, so it's not like an entire enterprise spread across the nation or anything like that. Thanks.
Any and all thoughts are welcome.
This question is pretty broad - it's the same as asing "what are my options for executing an arbitrary EXE on an end user's computer from a browser." The whole point of browser based applications is to prevent this from happening for security reasons.
If your goal is to deploy VBA scripts to everyone in your organization - that's actually pretty easy - just create an automatically updating Excel addin. This approach is very common and easy to do (more info if needed).
To answer your questions:
Too broad
Yes you can do this in a HTA file but I don't recommend it and I don't think it does what you want.
You cannot run VBA within a browser in the traditional sense. An HTA from what I understand is essentially a desktop app that is written using HTML i.e. you couldn't deploy an HTA to example.com.
You can build a ASP.NET web app in Visual Studio and have your front end (e.g. Admin LTE) call an end point on the backend which then calls an EXE but that would be an EXE on the server and not the client.

Using external VS2012 premium solution to create CUIT without source code

Microsoft Coded UI Test (CUIT). Can I create an independent (external) Visual Studio 2012 Premium or Ultimate solution in C# to record on my application UI without the application's source code? This solution can reference the application's assemblies. The CUIT API does not seem to help. It is not desirable to use Microsoft guidelines in doing CUIT, as it creates and inserts a test project into the application's solution. The development team does not want this test project, created by the QA team, to be part of their source code to check into their source control.
Coded UI testing with Visual Studio is about testing the user interface of an application. Coded UI does not care how the application was constructed (but see Note below). Coded UI test projects do not need to be in the same solution as the application. Coded UI can be used to test websites and web applications (via a web browser) where there is no Visual Studio solution available for the application. Coded UI can also be used as an automation tool, to automate routine operations that use several programs and websites to perform some action. For such automation there would be no single solution file that should have the Coded UI project.
My understanding of Microsoft's Coded UI guidelines is that sometimes it is good to have application and test in the same solution, just to keep them together so as to encourage testers and developers to use the test and keep them up to date. But there is nothing to force such togetherness.
I do not understand the impact of this sentence in the original question: "This solution can reference the application's assemblies."
Note: Coded UI needs the application under test to expose some of its user interface properties via the MSAA or UIA mechanisms. This is done for you with many types of software. See the "Platform Support" section of the "Content Index for Coded UI Test" at http://blogs.msdn.com/b/mathew_aniyan/archive/2010/02/11/content-index-for-coded-ui-test.aspx .
Added 2013-05-02:
The clarification, within the comment, about wanting to link a Coded UI test to the DLLs of an application suggests there may be some confusion between what Coded UI tests are for and what unit tests are for.
Coded UI accesses the user interface of an application much like a screen reader for the visually impaired would. It also moves the mouse pointer, clicks buttons or links and enters text much like the software for people who cannot use a normal keyboard or mouse. Coded UI does not access the code directly so it does not need to reference any DLLs of the application. Before testing your application, I suggest you experiment with writing Coded UI tests to drive the Windows Calculator or to fill in forms on web pages. There are many videos and tutorials on the internet that demonstrate how to use Coded UI. Once you have some understanding of what Coded UI does and how to use it, you should be in a much better position to test your application.

Difference between CodedUI and UISpy

What is the difference between CodedUI and UISpy? Does both use same mechanism?
I need to implement support for UISPY in my own custom grid control[WinForms] to recognize each cell as like in the MS DataGridView. currently UISPY recognizes my entire control but not individual cell.
Any help would be highly appreciated
I'm not sure how UISpy works but CodedUI uses the UI Automation framework to access the UI components in an app.
Regardless, you might want to look at using something like HawkEye or WinForms Spy as a starting point for doing what you need.
The UI Spy tool is obsolete and no longer available. Developers should use other tools such as Inspect.exe that are available in the Windows Software Development Kit (SDK).

How do I get started making Web sites with Delphi Prism?

I'm new to Delphi Prism 2011. Where can I find step by step instructions for writing and testing a basic Hello,world type website? I need to write, run and debug a simple website to see how the IDE works and to be sure that the installation including the link with Microsoft IIS is correct. An alternate tutorial giving the same information would also be fine. Thank you.

Resources