Testing the AutoHotKey script for sending data to OneNote
来源:互联网 发布:淘宝购物车营销针对 编辑:程序博客网 时间:2024/04/24 09:06
http://blogs.msdn.com/b/johnguin/archive/2009/04/06/testing-the-autohotkey-script-for-sending-data-to-onenote.aspx
I spent the last week showing everyone I could how slick Jordan's AutoHotKey script for OneNote is. Thanks again, Jordan!
Oh, and Ani has already patched the routine to start a new SideNote automatically in case you don't have OneNote running beforehand. It's just gets easier and easier to send data to OneNote. You can get those changes from his comments here.
A few comments showed up after I posted the article from users who could not get the script working, though. One person said he could not get AHK (AutoHotKey) working on Windows 7, and another was having problems with Vista. I thought this would be a good time to create a simple test matrix for this "addin." Here's what I did.
First, I looked at the functionality of the script. It mimics typing "CTRL+C" in whatever application has focus, then finds the OneNote window, then mimics typing "CTRL+V" to paste into OneNote. Then it restores focus back to the application where you started. Overall, this is pretty simple.
Since CTRL+C and CTRL+V are supported on every version of Windows, there is not a need to differentiate different editions of Windows. We can "equivalence class" Windows Vista 32 bit with 64 bit Windows 2008 server - this functionality is exactly the same. So far, so good. I always look for equivalence classes since they reduce the testing workload I have in front of me.
The focus switching is a little trickier. I'm always leery of depending on the UI for automation, and this automation script is no exception. A simple pop up alert from any application that fires at an inopportune time can steal focus from the application that had it a split second ago. In this case, the "CTRL+V" keys could be sent to a random dialog that opens from any other application that happens to open one and would cause the script to fail. Also, I'm not 100% sure I can get away with treating the way Windows XP deals with focus the same way Windows 7 beta 1 does. To be safe, I decided to test this on Windows XP, Vista and Windows 7 Beta 1.
The last test I wanted to run had to do with the title of the OneNote window. Jordan's code searches for " - Microsoft Office OneNote". I could not remember what the frame of the Home and Student Edition of OneNote had in it, nor could I remember what the trial edition used. I also need to test the non-trial, non-H&S edition. Three more cases.
Here's my first tentative matrix.
At this point, I had three operating systems with three different "types" of OneNote. I can simplify this matrix by realizing the title of the OneNote window does not change from OS to OS. So I decided to test the Home and Student Edition on Windows XP, the trial on Vista and the Enterprise setup on Windows 2008.
This assumption, that the title of the Windows frame does not change, is not 100% accurate. The H&S edition has some text appended to it and reads " - Microsoft Office OneNote non-commercial edition." Since AHK looks for titles that INCLUDE " - Microsoft Office OneNote" instead of titles that are exactly equal to " - Microsoft Office OneNote" , I can get away with this shortcut.
So my final test matrix looked like this:
Then it was just a question of rolling out some HyperV virtual machines for Vista and Windows 2008 and testing. I have a physical machine set up with the Home and Student Edition already. It is a bare bones machine - a slow Celeron process, 512MB of Ram, a 4200 RPM hard drive, low end integrated video, etc… I think the entire thing cost less than $200, and that was the source of my comment that on a slow machine, the copy and paste took a noticeable amount of time. I tested manually copying and pasting from a few different applications on that machine, and in all my tests, the pasting of HTML took a few seconds. On more modern hardware this pasting was much faster. And in all cases, the speed of the AHK was the same as pasting manually, so I'm not too worried about the overhead of this tool causing problems. Other than that performance issue, all tests went fine.
There was some related testing I did to ensure the CTRL+C copy worked with a few different applications – notepad, Internet Explorer, Firefox and Word. They all passed, and this was only a quick check since this test is another example of equivalence classing.
The only caveat I could see that may cause problems was the need to restart AHK after modifying the default file to use WINDOWS+Z to send the currently selected data to OneNote.
I hope those folks who had problems got this working, because it really is useful.
Questions, comments, concerns and criticisms always welcome,
John
- Testing the AutoHotKey script for sending data to OneNote
- Copy and Paste to OneNote (AutoHotKey script)
- The data for testing
- Using AutoHotKey to open a specific OneNote page
- simple script for loop testing
- Script do the data transfer from target server to local
- ganglia 报 "Error 1 sending the modular data for" Error解决方法
- Sending Data Directly to a Printer
- Sending data to Auditconsole via mlogc
- Sending Simple Data to Other Apps
- 《Training:Sending Simple Data to Other Apps》
- warning: failed to set breakpoint site at 0x1005ed32c for breakpoint 28.1: error sending the breakpo
- XMLHttpRequest - Sending a Request to the Server
- Sending the User to Another App
- Sending the User to Another App
- Sending the User to Another App
- The first article for testing ...
- OneNote and Autohotkey – Useful Scripts
- linux常用命令
- extern 使用方法
- QT下int与QByteArray的转换
- windows live writer写csdn博客,very good~
- 子页面调用父页面【子页面与父页面间的调用】
- Testing the AutoHotKey script for sending data to OneNote
- 深入理解mysql之BDB系列(3)---数据页结构(摘自老杨)
- 线程和消息队列的详解 【图】
- java 进阶
- 深入理解数据库原理系列(2)---并发控制原理(摘自老杨)
- 【KMP算法详解——适合初学KMP算法的朋友】
- chat server该如何进行性能测试?
- c语言指针的*和&两符号的功能
- 关于.net 页面提交后 css失效或者部分失效的问题