I have some test cases to validate whether the user details are appearing when applications like (SQL Server, Bitbucket, RDC, PuTTY etc. ) are launched. I want to understand if this scenario can be automated through PowerShell.
https://wasp.codeplex.com
WASP is a PowerShell snapin for Windows Automation tasks like selecting windows and controls and sending mouse and keyboard events. We have automation cmdlets like Select-Window, Select-Control, Send-Keys, Send-Click, Get-WindowPosition, Set-WindowPosition, Set-WindowActive, Remove-Window ... etc.
Our goal is to enable you to accomplish most Windows GUI Automation scripting from inside PowerShell, without resorting to specialized (and expensive) scripting tools.
Just to be clear, don't expect any "click to record" functionality ... but do expect to be able to automatically tile windows, send mouse clicks and keystrokes, and in general, automate those tasks that you would normally not be able to do from a console.
Related
I am trying to automate a web process using selenium.
The process clicks an "upload image" button and then sends the file name to a Windows File Explorer Window.
My solution as of now is to use selenium to click the "upload image" button and then to use a VBscript, via the sendKeys command, to send the file name to the active windows file explorer window.
As others have noted this causes some issues, foremost of which is that accidently focusing on another window sends the keys to it instead of file explorer.
I'm trying to make this process less "hacky".
I know MS Edge uses a Windows Utilities subprocess to open the file explorer window.
As of now, I can get the Id of this subprocess, but in a round about way, namely, by finding the most recently created subprocess managed by the browser. Obviously, this is a far cry from automation.
Using windows PowerShell, I've I have not managed to locate any information about this subprocess that could help with my automation task. For example, I could not get any unique identifying characteristics of the subprocess other than its process Id and I can't access its standard input. So far, all I can do is kill the sub process.
What I'm looking for is a rough outline (no code, just an architectural overview) of what it would take to do in PowerShell, what MS edge does after invoking the Windows Utility subprocess to upload a file to a website.
If someone has any suggestions on books I can read, I'd appreciate that as well.
Just looking for someone to point me in the right direction, really.
I first need to offer the disclaimer that I am barely a novice when it comes to scripting or coding, so I might be doing this all wrong in the first place. I'm running into an issue with a script I had written in powershell a while ago that is used on several hundred computers in my company daily to automate starting a certain app that everyone uses. So far everyone else hasn't had an issue except one machine.
Normally when I run the script, it starts the services and cli for the program which opens in a new window. Then the script, still open behind that, sends all of the key commands to that cli window, pauses for a brief line of user input after which it closes that cli window, does a few other clean up tasks and closes out itself.
The only difference on this one machine that's not working is the script won't pass the keystrokes to the cli window. If I put them in manually including the normal user input, it finishes the rest of the script just fine, but the cli window is just not receiving the keystroke input from the main script.
The only part of the script that send the keystrokes to the cli window is a few lines of this:
[System.Windows.Forms.SendKeys]::SendWait("Text{Enter}")
I have tried using the sleep command before and in between the key commands to make sure it's not going through the keystrokes to early. I've checked and windows had gone through an Update two days ago, but we would've heard about this issue right then if that was it. I'm at a loss for what the issue could be and would apreciate and help, tips, or direction to help figure this one out.
Is the console window the active window when the keys are sent? The documentation for the class you are calling indicates that it sends the keys to the active window. Not only that, but the documentation also seems to indicate that there are some issues that developers have run into when using that class to sends keys. I would try using the autoit powershell module instead. Autoit is its own scripting language which specializes in automating windows processes and being capable of automating interactions with windows forms, but also comes bundled with its own powershell module that I think is exactly what you need, so I would download the portable "zip" package, extract the powershell module from "Autoitx", and that should help you accomplish what you need
PowerShell automation especially when using SendKeys can / is glitchy due to many varying reasons. Can you use SendKeys sure, but you have to know the environment it will be run in and the needed performance details. Hence your futzing/guessing with Sleep.
There are purpose-built tools to help.
Auto HotKey
'PowerShell auto hotkey'
or the UIAutomation tool
'PowerShell automating other applications'
I'm currently developing an automation script that gets information from an ERP software. I chose AutoHotkey because it's what the company uses for it's automation jobs.
However i got stuck trying to select an item from a SysListView32 control, which isn't the same as a ListView control apparently. Currently i'm able to send {Down} key strokes multiple times until i find the specific control, however i'd like to find a more elegant way like
Control, ChooseString, "String", WinName
Do you know if AHK is capable of such? Or do you know if there are other ways that are similar?
This is for a Windows environment: Windows 7-10 / Server 2008/2012.
I want to create a script which will automate login at a URL, navigate to a another page, and then submit a form on that page.
Open Internet Explorer, if not already opened
Login to www.example.com/login (takes me to www.example.com/home)
Once logged in, go to www.example.com/submit-form-data
Enter values for fields and submit the form via button click
At first, I thought maybe I could use something like iMacro, a greasemonkey alternative, or even bookmarklets. But that'd all still require some user intervention. If there is a macro program which can replay all the steps, perhaps I'd be open to that. Otherwise, I think I may need to employ some kind of PowerShell or Curl-like program for Windows to handle UI automation.
At least with PowerShell, I don't think submitting a form should be too bad. If that's all I had to do, I wouldn't need any help. The problem is how do I log into a site, then navigate to a specific URL, on top of submitting a form, all in the same script?
I don't have to use PowerShell. I'd be open to alternatives to Curl on Windows, whatever those might be.
Thank you for your help in advance.
If your goal is to drive Internet Explorer, the most painless and robust way to accomplish this is probably to use Selenium WebDriver.
Many folks successfully use it on Windows via the Selenium C# bindings (although my favorite way to use Selenium on Windows is via the Selenium Python bindings).
If you're keen on using PowerShell, it should be possible to use Selenium from PS, although there are no official PS bindings from what I can tell.
Anyone know any softwares that can simulate human interaction on desktop browser specifically by clicking or entering some data and run some report and print automatically obviously with some programming behind this. Main, it will be used for reducing business process steps on human interaction day to day activity (possibly testing purpose in the future).
I am appreciated your comment or input.
Thanks
I tried a few different automation tools myself when trying to automate desktop software, one is AutoIt which is one of the most complete in my opinion. It helps to automate small tasks, ie: select a window and press a button to do the rest. It even has a macro recorder to get you started.
Telerik WebUI Test Studio
Watir
Selenium
...to name a few
To keep up with the namedropping, here's 2 APIs for Java:
Robot
Abbot (Built on top Robot)