Questions tagged [automation]
Automation is the process of having a computer do a repetitive task or a task that requires great precision or multiple steps, without requiring human intervention.
23,912
questions
600
votes
8
answers
961k
views
How can I pass an argument to a PowerShell script?
There's a PowerShell script named itunesForward.ps1 that makes iTunes fast forward 30 seconds:
$iTunes = New-Object -ComObject iTunes.Application
if ($iTunes.playerstate -eq 1)
{
$iTunes....
464
votes
14
answers
242k
views
OS X Bash, 'watch' command
I'm looking for the best way to duplicate the Linux 'watch' command on Mac OS X. I'd like to run a command every few seconds to pattern match on the contents of an output file using 'tail' and 'sed'.
...
365
votes
3
answers
360k
views
Running script upon login in mac OS X [closed]
I am wondering if anyone is able to help me out with getting a shell (.sh) program to automatically run whenever I log in to my account on my computer. I am running Mac OS X 10.6.7.
I have a file &...
347
votes
30
answers
1.0m
views
Typing the Enter/Return key in Selenium
I'm looking for a quick way to type the Enter or Return key in Selenium.
Unfortunately, the form I'm trying to test (not my own code, so I can't modify) doesn't have a Submit button. When working with ...
224
votes
14
answers
78k
views
How can you automatically remove trailing whitespace in vim
I am getting 'trailing whitespace' errors trying to commit some files in Git.
I want to remove these trailing whitespace characters automatically right before I save Python files.
Can you configure ...
201
votes
12
answers
248k
views
How to remove unused imports in Intellij IDEA on commit?
Is there a way to remove unused imports in Intellij IDEA on commit?
It is not very optimal to do it manually, CTRL + ALT + O helps but it's still manual.
188
votes
18
answers
215k
views
R command for setting working directory to source file location in Rstudio
I am working out some tutorials in R. Each R code is contained in a specific folder. There are data files and other files in there. I want to open the .r file and source it such that I do not have to ...
169
votes
6
answers
248k
views
Have bash script answer interactive prompts [duplicate]
Is it possible to have a bash script automatically handle prompts that would normally be presented to the user with default actions? Currently I am using a bash script to call an in-house tool that ...
167
votes
31
answers
141k
views
Auto-reload browser when I save changes to html file, in Chrome?
I'm editing an HTML file in Vim and I want the browser to refresh whenever the file underneath changes.
Is there a plugin for Google Chrome that will listen for changes to the file and auto refresh ...
164
votes
14
answers
33k
views
NAnt or MSBuild, which one to choose and when?
I am aware there are other NAnt and MSBuild related questions on Stack Overflow, but I could not find a direct comparison between the two and so here is the question.
When should one choose NAnt ...
157
votes
22
answers
281k
views
CRON job to run on the last day of the month
I need to create a CRON job that will run on the last day of every month.
I will create it using cPanel.
Any help is appreciated.
Thanks
152
votes
5
answers
64k
views
Casperjs/PhantomJs vs Selenium
We are using Selenium to automate our UI testing. Recently we have seen majority of our users using Chrome. So we wanted to know - pros and cons of using PhantomJS vs Selenium:
Is there any real ...
149
votes
15
answers
48k
views
WatiN or Selenium? [closed]
I'm going to start coding some automated tests of our presentation soon. It seems that everyone recommends WatiN and Selenium. Which do you prefer for automated testing of ASP.NET web forms? Which of ...
144
votes
14
answers
397k
views
How to copy a file to a remote server in Python using SCP or SSH?
I have a text file on my local machine that is generated by a daily Python script run in cron.
I would like to add a bit of code to have that file sent securely to my server over SSH.
129
votes
11
answers
233k
views
Matlab: Running an m-file from command-line
Suppose that;
I have an m-file at location:
C:\M1\M2\M3\mfile.m
And exe file of the matlab is at this location:
C:\E1\E2\E3\matlab.exe
I want to run this m-file with Matlab, from command-line, for ...
126
votes
11
answers
76k
views
How do you automate Javascript minification for your Java web applications?
I'm interested in hearing how you prefer to automate Javascript minification for your Java web apps. Here are a few aspects I'm particularly interested in:
How does it integrate? Is it part of your ...
114
votes
14
answers
103k
views
How can I automate the "generate scripts" task in SQL Server Management Studio 2008?
I'd like to automate the script generation in SQL Server Management Studio 2008.
Right now what I do is :
Right click on my database, Tasks, "Generate Scripts..."
manually select all the export ...
110
votes
6
answers
226k
views
How to use ADB to send touch events to device using sendevent command?
I am trying to send touch events to a device using AndroidDebugBridge, so that I can do some basic automation for UI tests. I have followed the discussion in LINK. I am able to use sendevent to ...
110
votes
7
answers
97k
views
Choosing a Windows automation scripting language. AutoIt vs Autohotkey [closed]
I need to choose a Windows automation scripting language. Which one do you recommend; AutoIt, AutoHotkey, or an other?
I have read "An AutoIt / AutoHotkey comparison". Interesting history, but ...
108
votes
7
answers
412k
views
How can I login to a website with Python?
How can I do it?
I was trying to enter some specified link (with urllib), but to do it, I need to log in.
I have this source from the site:
<form id="login-form" action="auth/login" method="post"...
106
votes
14
answers
202k
views
Microsoft.Office.Core Reference Missing
Using the example provided in codeproject I am struggling to work out where I can find the reference to the library Microsoft.Office.Core.
I am getting the error "The referenced component 'Microsoft....
105
votes
6
answers
83k
views
Non-interactive method for dpkg-reconfigure tzdata [closed]
When I first setup an Ubuntu server, I make sure I aptitude install tzdata, then dpkg-reconfigure tzdata so that I set my timezone properly.
I am trying to automate my server setup with a script, and ...
99
votes
5
answers
546k
views
automatically execute an Excel macro on a cell change
How can I automatically execute an Excel macro each time a value in a particular cell changes?
Right now, my working code is:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(...
95
votes
3
answers
120k
views
What are the best ways to automate a GDB debugging session?
Does GDB have a built in scripting mechanism, should I code up an expect script, or is there an even better solution out there?
I'll be sending the same sequence of commands every time and I'll be ...
93
votes
13
answers
349k
views
Automating telnet session using Bash scripts
I am working on automating some telnet related tasks, using Bash scripts.
Once automated, there will be no interaction of the user with telnet (that is, the script will be totally automated).
The ...
89
votes
10
answers
141k
views
Automated testing for REST Api [closed]
I would like to write an automated testing suite for a REST API. As we complete new services, we'd like to check to make sure all the previously created services are working as expected. Any ...
84
votes
15
answers
38k
views
Automatically create an admin user when running Django's ./manage.py syncdb
My project is in early development. I frequently delete the database and run manage.py syncdb to set up my app from scratch.
Unfortunately, this always pops up:
You just installed Django's auth ...
83
votes
13
answers
34k
views
How to automate development environment setup? [closed]
Every time a new developer joins the team or the computer a developer is using changes, the developer needs to do lots of work to setup the local development environment to make the current project ...
81
votes
2
answers
47k
views
What is Grunt for?
I'm trying to get into Grunt, which I am new to, but I do not understand its utility.
I understand that it is a taskrunner. I understand that it can be used to do things like bundle, uglify, jshint, ...
80
votes
11
answers
47k
views
PHP number: decimal point visible only if needed
I'd like to know if exists some function to automatically format a number by it's decimal, so if I have:
<?php
// $sql_result["col_number"] == 1,455.75
number_format ($sql_result["...
78
votes
14
answers
226k
views
.doc to pdf using python
I'am tasked with converting tons of .doc files to .pdf. And the only way my supervisor wants me to do this is through MSWord 2010. I know I should be able to automate this with python COM automation. ...
76
votes
27
answers
409k
views
Switch tabs using Selenium WebDriver with Java
Using Selenium WebDriver with Java.
I am trying to automate a functionality where I have to open a new tab do some operations there and come back to previous tab (Parent).
I used switch handle but it'...
75
votes
4
answers
74k
views
What is test harness?
I am facing some difficulties in understanding test harness and related common terms like test case, test scripts in automation testing.
So this is what I got so far:
Automation testing is the use of ...
72
votes
4
answers
25k
views
Don't make me manually abort a LaTeX compile when there's an error
As suggested here, latexmk is a handy way to continually compile your document whenever the source changes. But often when you're working on a document you'll end up with errors and then latex will ...
71
votes
9
answers
269k
views
Automating running command on Linux from Windows using PuTTY
I have a scenario where I need to run a linux shell command frequently (with different filenames) from windows. I am using PuTTY and WinSCP to do that (requires login name and password). The file is ...
70
votes
14
answers
71k
views
headless internet browser? [closed]
I would like to do the following. Log into a website, click a couple of specific links, then click a download link. I'd like to run this as either a scheduled task on windows or cron job on Linux. I'm ...
68
votes
8
answers
40k
views
Dead code detection in legacy C/C++ project [closed]
How would you go about dead code detection in C/C++ code? I have a pretty large code base to work with and at least 10-15% is dead code. Is there any Unix based tool to identify this areas? Some ...
67
votes
7
answers
62k
views
How to version build artifacts using GitHub Actions?
My use case is I want to have a unique version number for artifacts per each build/run. With current tools like CircleCI, Travis, etc. there is a build number available which is basically a counter ...
65
votes
8
answers
25k
views
How do I know if PDF pages are color or black-and-white?
Given a set of PDF files among which some pages are color and the remaining are black & white, is there any program to find out among the given pages which are color and which are black & ...
64
votes
5
answers
65k
views
Puppeteer wait for all images to load then take screenshot
I am using Puppeteer to try to take a screenshot of a website after all images have loaded but can't get it to work.
Here is the code I've got so far, I am using https://www.digg.com as the example ...
64
votes
7
answers
56k
views
How to automate documentation of a REST API (Jersey Implementation) [closed]
I have written a pretty extensive REST API using Java Jersey (and JAXB). I have also written the documentation using a Wiki, but its been a totally manual process, which is very error-prone, ...
62
votes
14
answers
26k
views
Automated unit testing with JavaScript
I'm trying to incorporate some JavaScript unit testing into my automated build process. Currently JSUnit works well with JUnit, but it seems to be abandonware and lacks good support for Ajax, ...
61
votes
3
answers
47k
views
Install Docker Toolbox on a Mac via command line
I am trying to automate setting up a developer environment on Mac. Part of that setup is installing the Docker Toolbox. I cannot find any documentation on how do to this via command line. How can I ...
58
votes
6
answers
31k
views
Automatically (or more easily) reconnect to a screen session after network interruption
ADDED: This question is now, I believe, subsumed by this one:
Using GNU Screen completely transparently and automatically
See also this related question:
https://superuser.com/questions/147873/ssh-...
57
votes
3
answers
36k
views
Human-like mouse movements via Selenium
The Story:
One of the approaches to solve captchas, like Google ReCaptcha, is to try to imitate the human mouse actions: movements, hovering and clicks.
Some users reported that making mouse moves ...
56
votes
5
answers
119k
views
How to Automatically Start a Download in PHP?
What code do you need to add in PHP to automatically have the browser download a file to the local machine when a link is visited?
I am specifically thinking of functionality similar to that of ...
55
votes
6
answers
30k
views
How to programmatically fill input elements built with React?
I'm tasked with crawling website built with React. I'm trying to fill in input fields and submitting the form using javascript injects to the page (either selenium or webview in mobile). This works ...
54
votes
12
answers
63k
views
Why is Cypress saying my element is detached after just running a get command?
Objective:
I want to click on a particular element on the page using an accessibility selector with cypress
Code
cy.findAllByRole('rowheader').eq(2).click();
Error
Timed out retrying: cy.click() ...
53
votes
8
answers
193k
views
Is it possible to modify a registry entry via a .bat/.cmd script?
Is it possible to modify a registry value (whether string or DWORD) via a .bat/.cmd script?
53
votes
5
answers
30k
views
Auto yes to the License Agreement on sudo apt-get -y install oracle-java7-installer [closed]
The Oracle Java package for Ubuntu interactively asks about the License Agreement. So I have to say 'OK' and then 'yes' every time, but I'd like to automate it. What I do is this:
sudo add-apt-...