EzDevInfo.com

automation interview questions

Top automation frequently asked interview questions

R command for setting working directory to source file location

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 change the working directory in Rstudio as shown below:

enter image description here

Is there a way to specify my working directory automatically in R.


Source: (StackOverflow)

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 advantage in terms of performance, e.g. time taken to execute the test cases?
  • When should one prefer PhantomJS over Selenium?

Source: (StackOverflow)

Advertisements

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.Office.Core' could not be found."

I only have office 2007 enterprise edition and outlook 2003 installed on this system. Could this be the cause of this? Otherwise which specific dll am I supposed to be referencing?


Source: (StackOverflow)

mercurial automatic push on every commit

Being very familiar with the subversion workflow and that fact that 99.9% of the time my computer is connected to the internet, I don't like doing 'hg ci' and 'hg push' separately.

I remember bzr had a 'checkout' command that would bind subsequent 'commit' commands to automatically commit directly to the server ('push').

Does mercurial have something similar to this?

PS: Writing a shell script or alias that runs 'hg ci $* && hg push' would be the last thing I'd do.


Source: (StackOverflow)

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, debugging, and timeouts.

Has anyone had any luck automating (with ANT) a unit testing library such as YUI test, JQuery's QUnit, or jQUnit (http://code.google.com/p/jqunit/)?

Note: I use a custom built AJAX library, so the problem with Dojo's DOH is that it requires you to use their own AJAX function calls and event handlers to work with any AJAX unit testing.


Source: (StackOverflow)

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 saving the output of each command to a file (most likely using GDB's built-in logging mechanism, unless someone has a better idea).


Source: (StackOverflow)

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 build tool, a servlet filter, a standalone program post-processing the WAR file, or something else?
  • Is it easy to enable and disable? It's very unfunny to try and debug a minified script, but it's also useful for a developer to be able to test that the minification doesn't break anything.
  • Does it work transparently, or does it have any side effects (apart from the ones inherent in minification) that I have to consider in my day-to-day work?
  • Which minifier does it use?
  • Does it lack any features that you can think of?
  • What do you like about it?
  • What don't you like about it?

This will mostly serve as a reference for my future projects (and hopefully other SOer's will find it informative, too), so all kinds of tools are interesting.

(Note that this is not a question about which minifier is best. We have plenty of those around already.)


Source: (StackOverflow)

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 over MSBuild? Which one is better for what? Is NAnt more suitable for home/open source projects and MSBuild for work projects? What is the experience with any of the two?


Source: (StackOverflow)

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 simulate touch on emulators, but unable to do the same on a device.

Like in above link the emulator seems to send out 6 events for each touch ( xcoord, ycoord, 2 for press,2 for release) and it was easy to use this information to sendevents, but a getevent for the touchscreen for a device seems to generate far too many events.

Has somebody managed to send touch from ADB to a device? Could you please share the solution.


Source: (StackOverflow)

How do I 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 python script run daily in cron. I would like to add a bit of code to have that file sent securely to my server over ssh. Help.


Source: (StackOverflow)

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 the page every time I save a change to the file? I know there's XRefresh for Firefox but I could not get XRefresh to run at all.

How hard would it be to write a script to do this myself?


Source: (StackOverflow)

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 panic and wait for user input before continuing. That can get very annoying, especially recently when I hacked up something to compile latex directly from an etherpad document, which saves continuously as you type.

Is there a setting for latex or latexmk to make it just abort with an error message if it can't compile? Or, if necessary, how would I set up some kind of Expect script to auto-dismiss LaTeX's complaints?

(I had thought pdflatex's option -halt-on-error would do the trick but apparently not.)

Bonus question: Skim on Mac OSX is a nice pdf viewer that autorefreshes when the pdf changes (unlike Preview), except that whenever there's a latex error it makes you reconfirm that you want autorefreshing. Texniscope doesn't have this problem, but I had to ditch Texniscope for other reasons. Is there a way to make Skim always autorefresh, or is there another viewer that gets this right?


ADDED: Mini-tutorial on latexmk based on the answer to this question:

  1. Get latexmk here: http://www.phys.psu.edu/~collins/software/latexmk-jcc/

  2. Add the following to your ~/.latexmkrc file:

    $pdflatex = 'pdflatex -interaction=nonstopmode';
    

    (For OS X with Skim)

    $pdf_previewer = "open -a /Applications/Skim.app";
    
  3. While editing your source file, foo.tex, run the following in a terminal:

    latexmk -pvc -pdf foo.tex
    
  4. Use Skim or another realtime pdf viewer to view foo.pdf. For Skim, just look at the “Sync” tab in Skim’s preferences and set it up for your editor.

Voila! Hitting save on foo.tex will now cause foo.pdf to refresh without touching a thing.


Source: (StackOverflow)

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 copied to a predefined folder in the linux machine through WinSCP and then the command is run from PuTTY. Is there a way by which I can automate this through a program. Ideally I would like to right click the file from windows and issue the command which would copy the file to remote machine and run the predefined command (in PuTTy) with the filename as argument.


Source: (StackOverflow)

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 example inside a .bat file. How can I do this, is there a way to do it?


Source: (StackOverflow)

How to get Bundle Id of your app iOS UIA automation

How do I get the bundle Id of the app I am in ?


Source: (StackOverflow)