Alternative to AutoIt that can interact with browser and desktop windows? - selenium

I used AutoIT for certain projects where I need to get some info from a text file, then from an Excel file, use it in a web browser, get some info from there, and then use that info in a Oracle project and repeat for n entries. I'm looking for a way to do this with C#, or at least, a better way and found Selenium and Winium, but I can't find enough info about them working together and being able to open Excel and textfiles and such.
Any recommendation on what to use for these scenario? I don't really know much about automation and I'm looking for some guidence in best practices and recommended software.

First you need to assess the coverage of automation that you will be doing. Seems like (for me) is a business process automation which RPA can provide. If majority of the automated tasks are not browser related, then selenium is not the best solution for this.
You can check with UiPath, Automation Anywhere, Blueprism etc.
The tools covers not just browser but anything you can see from your screen and can be executed unattended.
You may check this one out, https://www.uipath.com/rpa/robotic-process-automation

Related

Selenium with Robot

I am automating the GUI using Robot framework with selinium2Library. I am using selenium IDE and I don't find any record and play option for the Robot framework.
Is it possible for record and play back option for the test cases with Robot framework using selenium2Libbrary instead of writing test cases manually?. Appreciate some early response on this one.
Looks like you might got in confusion because of the work selenium which is different when you use it in RobotFramework.
I believe that you have to write the test cases, and you may Pycharm IDE where you get the context help for the in built as well for the user written keywords when the resources are imported.
However, I remember reading in a thread, but could not trace it. Here you can find article on how you can use Selenium IDE to record, but haven't tried myself. You may try it and see how it goes for you.
But I strongly believe that if you write the test, you can organize them into different reusable keywords than depending on the recording the stuff. Good luck.

Automation scripts: autoitscript vs ptfbpro

I try to use this 2 projects for primitive gui testing automation:
http://www.ptfbpro.com/
http://www.autoitscript.com/
And I can't make my choice.
Can somebody explain me: why(in 2 or 3 lines) he use one of them(or other please specify)?
I use AutoIt...
because it's free, well documented (not only) from inside of the Scite Editor and you can easily compile your script into a small executable or even create a complete GUI and there is a very good community in the forums and around here. And its Basic-Like Syntax is really easy to understand, there are functions and even a foreach-syntax, dynamic arrays and lots of additional functions from other users... There's good integration with other programming languages and from the use of so many WinAPI functions you lack of very little possibilities. It can automate IE usage without even displaying a browser window and send network packages, you can send Keystrokes like a user sitting in front of your screen and there's the AU3Record Tool which allows you to just record a Macro and replay it or save it as a script and then you can easily optimize it and edit it for your needs. Or use the AutoIt Window Info tool to see all the possible handlings for your application, you can interact with any kind of program output/display according to different algorithms you may invent.
Enough facts? ;-)
Go with Autoit3. It 's a lot more reliable, and you have a complete script language. Ptfbpro is only a tool (not free), nothing more. AUtoit3 has a lot of contributors that can help you in your process, Ptfbpro is dead.
If you want a script taht really do what you want, just go for AutoIt. Ptfbpro can't be used as a professional tool.
Autoit3 as well. You really can't beat it for being free and so easy to use.

A simple text based full web-page regression testing

My duty is to pick up and continue developing PHP website for a small sized business client. Project has no testing code. I want to quickly establish at least very basic regression testing for the backend of the site.
I need to test the full contents of the web page char to char. Must see the diff of failed tests.
I need to be able to set up cookies and GET/POST data.
Once every few days I am updating the local database from production database. I would like to then have an overview of failed tests and very quickly update my test suits so that everything is passing again.
Is using WatiN or Selenium a good idea? My local environment is Linux.
About Selenium (and only Selenium as I don't know WatiN) - it can only do what you can do in your broswer. It can click, type in fields, submit forms, take screenshots (that's a very good one), set up cookies (so yes to this one). You can always set up GET data through the URL. But I am not aware of any technique in Selenium that would allow you to set up POST data in any other way than navigating in a browser. Also, because the tests are in your browser, they are not particularly fast. E.g, on our product, a single thorough test with ~250 steps takes about 10 minutes on my computer to complete. Of course, you can always divide that between many computers using Selenium Grid. It's just more work.
To conclude it - I'd say yes, Selenium is good for your needs as there are so many ways to write a good test in it that everyone finds his style. It is good for quick checks, functionality affirmations, but also for full-scale tests etc. But if you want to do some really advanced stuff, then that's a job for a long time. Selenium offers so much functionality in so many different ways that it is definitely a full-time job to understand them and know how to use them.
Try Selenium-IDE for 20 minutes. It is just an addon for Firefox that can record your actions and then replay them. If you like what you see, go for it. If no, hire someone who will.
I'm not sure if I am too late here, but in regards to WatiN it is only IE based, so if you plan to use any other browser you are better off with Selenium WebDriver (though WatiN has some Firefox support). From what I have found (I have used both WatiN and Selenium) Selenium can achieve more low level interactions (also see Selenium Grid), but really I think it is dependant on what you are looking to achieve and personal preference. If you have time to write your own wrapper to interact with WatiN/Selenium you will find the tests themselves are rather quick to run. Also, the beauty of Automation is that once these tests are written you can run them and walk away while they complete.

What's the best automation or scripting tool to automate repetitive tasks with applications?

I realize you can script Microsoft Office apps, but I'm looking for something more general that I can apply to other apps, such as Adobe Acrobat, web browsers and other apps with no scripting ability.
I've used AutoIt but it's a bit clunky, especially when trying to debug why a script fails or stalls. Also, getting the timing of actions, such as clicking a button, or selecting a menu item correctly can be a pain.
Are there build tools that could be used for this purpose?
I recommend AutoHotKey. Its syntax is not pretty, but most of the times you don't have to concoct your own scripts, because its community is so large and well organized. Even if you do, the documentation is extensive and good and the forums will answer your questions quickly. The developer is active and responsive, which means that bugs get fixed quickly, and new features are being considered and added.
Since I began using AHK I don't imagine doing without it - it allows to make life on Windows simpler in so many ways.
You can also employ the COM interface from Python and other scripting languages. It is more complex, but you get to use a more powerful language.
I love AutoHotkey (small k...) too, but beside its odd syntax, it has the same lack of debugging tools...
Basically, that's "show msgbox alerts, send strings to file or debugview, trace". Which is OK for most cases, since you rarely write long and complex applications with these tools.
In both tools, and probably all macro softwares, "timing of actions" will be hard to get anyway, because events are asynchronous: most of the time, you don't wait a given time, but you wait for a window to appear. Hoping it is the right one!
There are other automation tools, like Ranorex (I didn't tested it), you can even use some scripting language (Lua, Python) with a library to send messages (WM_XXX) and another to call WinAPI... But tools like AutoIt and AutoHotkey have the advantage of having been extensively tested, so they can handle a large number of behaviors/issues (like waiting for clipboard data to be available, etc.).
Might be a bit much for your needs but AutoMate is very robust and easy to use. Doesn't require any scripting skills as most tasks can be constructed via drag and drop http://www.networkautomation.com/sales/scripting/

Tools for automating mouse and keyboard events sent to a windows application

What tools are useful for automating clicking through a windows form application? Is this even useful? I see the testers at my company doing this a great deal and it seems like a waste of time.
Check out https://github.com/TestStack/White and http://nunitforms.sourceforge.net/. We've used the White project with success.
Though they're mostly targeted at automating administration tasks or shortcuts for users, Autohotkey and AutoIT let you automate nearly anything you want as far as mouse/keyboard interaction.
Some of the mouse stuff can get tricky when the only way to really tell it what you want to click is an X,Y coordinate, but for automating entirely arbitrary tasks on a Windows machine, it does the trick.
Like I said, they're not necessarily intended for testing purposes, so they're not instrumented for unit test conventions. However, I use them all of the time to automate stuff that isn't testing related.
You can do it programmatically via the Microsoft UI Automation API. There's an MSDN Magazine article about it.
Integrates well with unit test frameworks. A better option than the coordinate-based script runners because you don't have to rewrite scripts when layouts change.
There's a couple out there. They all hook into the windows API to log item clicks, and then reproduce them to test.
We're now mostly web based (using WatiN), but we used to use Mercury Quicktest.
Don't use Quicktest, it's awful for a tremendously long list of reasons.
This is what i was looking for.
Check out http://www.codeplex.com/white and http://nunitforms.sourceforge.net/. We've used the White project with success.