Is it possible to open a new tab in watir-webdriver? - ruby

The only thing that looks a bit like what I'm trying to achieve is this, but this works only for IE... for firefox I found that information, so is it not possible to open tabs, just new windows?
And the attach method is accessing only already OPEN tabs/windows... Is there a way to decide to open a specific link in a new window/tab? I searched in the documentation, but I didn't find such a function...

Ok thats not a solution but a work-around:
I switch to ruby mechanize, is quite different to use, but allows to do multithreading and everything without a visible browser window...

Related

How to open a file in multiple programs as my 'default program'

So I've got a lot of manual HTML checking to do, most of which is just a quick glance at the code and then make sure the page displays correctly.
My thought is that it would be much easier to do this if I could set multiple programs to open when I double click on a .htm file. By this I mean open the file in the programs I specify all at once without multiple "right-click > open with > the program" actions.
So really I'd like for it to open in my HTML editor, Chrome, and Firefox all at once and then I can just glance at them all and move about my business. I figure I'll still have to close all of them manually but at least I can do that every once in a while not EVERY time.
Any ideas? I was thinking about a simple man-in-the middle app to open all of the programs, but that seems like it would be a rather large solution to a small issue, is there a simple (and fairly quick-to-execute) way of doing this in a windows-based fashion, or should I just try and slim down this proposed app as much as possible and maybe it won't be too slow to open?
I was thinking about a simple man-in-the middle app to open all of the programs
That is exactly what you need. And then you can add that app to the "Open With" menu of the file extension(s) you want to process.
that seems like it would be a rather large solution to a small issue
Not really. It would actually be a very small app to implement. All you need is a configuration to specify the target apps, then receive the selected filename(s) as command-line parameters and pass them in a loop to the other apps using ShellExecute/Ex() or CreateProcess()as needed. Not much to it.
is there a simple (and fairly quick-to-execute) way of doing this in a windows-based fashion
Not really. You have to create your own app for it, and then register it so you can invoke it when needed.
should I just try and slim down this proposed app as much as possible and maybe it won't be too slow to open?
It won't be slow at all, unless you make it slow. If you really want to cut down overhead, you could even implement it as a simple .bat script that uses the start command to launch the files, instead of compiling an actual executable.
Looks like you would create something called a Shortcut Menu Handler. Beware, as that involves messing with the registry.

"open" command doesn't work properly inside tmux

I am trying to use the open command to open a link in Chrome from my terminal.
It works fine in plain Terminal.app or iTerm2, but doesn't work properly from tmux. What happens is: it opens a new instance of Chrome (rather than opening a new tab) and doesn't actually go to the URL.
Is there any fix for this? The reason I need this functionality is for running Mutt with urlview to open the links from emails.
Thanks.
This sounds like a problem that could be solved by installing reattach-to-user-namespace.
If you don't wanna get deep into manually solving this problem you can use one of the tmux plugins:
tmux-urlview looks like exactly what you're looking for
another solution is to use tmux-copycat + tmux-open

Is there anyway to collaborate on a Google Document in realtime using VIM?

I want to use the VIM keyboard commands to edit a Google Document. Preferably I'd like to use my .vimrc file and have changes I make reflected in real time (or at least on save). I want to do this for a technical coding interview.
So far I've tried using GoogleCL which only pushes/receives changes on quitting VIM (which is too slow). And I've tried the Vimium Chrome plugin but that seems to be just for navigation not text editing. I however may be overlooking a feature of one of these.
I'm using OSX and Chrome, Safari or Firefox.
You can:
sync your google docs then edit normally
use vim-anywhere plugin
use GoogleCL inside au FileWrite
use some library to quickly create your own thing, for instance google-drive-ruby (see short example on its page).
To collaborate and see changes real time you could for instance use ruby library to upload/dowload changes every now and then. If you always overwrite your original file even as you edit it, you can diff external changes to see what the other users did.

Creating quick GUI front ends

I wanted to have a GUI front-end for a script that accepts numerous command-line options, most of them are UNIX paths. So I thought rather than typing them in (even with auto-completion) every time, I'd create a GUI front end which contains text boxes with buttons beside them, which when clicked will invoke the file browser dialogue. Later, I thought I'd extend this to other scripts which would sure require a different set of GUI elements. This made me think if there's any existing app that would let me create a GUI dialog, after parsing some kind of description of the items that I want that window should contain.
I know of programs like Zenity, but I think it's doesn't give me what I want. For example, if I were to use it for the first script, it'll end up flashing sequence of windows in succession rather than getting everything done from a single window.
So, basically I'm looking at some corss-platform program that lets me create a window from a text description, probably XML or the like. Please suggest.
Thanks
Jeenu
Mozilla's XUL is a cross platform application framework - . You could write an app as a Firefox plugin or a standalone XUL application.
mono and monodevelop could work for this. Or even something super simple like shoes.

Web page download automation in vbscript

How would you automate logging into a website and downloading a page using vbscript?
Using the MSXML.XMLHTTP-object to first do a POST to login and then add the cookie-headers to a GET request.
As a quick and dirty solution, you could use a Shell object with SendKeys and Run as demonstrated here. These functions are quite powerful for those situations where you just can't the right object or library to use...
Well the script (given on link )works fine if you open the notepad and don't change the focus to other window.
If you change the focus above script doesn't work.

Resources