2009-06-18

Don't forget regsvr32 AutoItX3.dll

When using Watir,should register AutoItX3.dll

>cd C:\ruby\lib\ruby\gems\1.8\gems\watir-1.5.6\watir\
>regsvr32 AutoItX3.dll

enjoy Watir!

2009-06-17

Expand VMware HardDisk

Stuck in Team Foundation Server setup on VMware machine.
When I batch Visual Studio 2005 Team Suite SP1,VM machine HD was full,could not extract that.
Tools.
  • GPARTED-CLONEZILLA

  • Virtual Disk Development Kit 1.0.1 for Windows

  • 1.Expand physical(image) Hard disk.

    cmd.exe
    >vmware-vdiskmanager.exe -x GB .vmdk

    Need to set environment path to "C:\Program Files\VMware\VMware Virtual Disk Development Kit\bin" or drug "vmware-vdiskmanager.exe" on cmd window.
    2.Expand partition.
    Boot target VM machine from .iso.
    (when VM machine start F2 => go BIOS => Boot device setting)
    Easy GUI,but better chose lang = "EN" otherwise garble.(in my case)

    2009-06-16

    run Jruby on Google App Engine from windows

    Basically follow this lecture OK.
    http://blog.bigcurl.de/2009/04/running-sinatra-apps-on-google.html
    jruby-rack
    Get a fresh version from http://github.com/nicksieger/jruby-rack/tree/master

    cd jruby-rack
    PATH-TO-JRUBY/bin/jruby -S rake SKIP_SPECS=true

    1.You should check directory.
    ex.)C:\jruby-rack
    should not path include "space" etc.
    I could not rake in Document~ directory.
    2.use Jruby from "git clone git://kenai.com/jruby~main"
    I stuck use other dist.

    that all,no problems
    p.s. better has Cygwin for use split-jruby.sh
    and when running on local by C:\appengine-java-sdk-1.2.0\bin\dev_appserver.cmd,error.
    But in Google App Engine,no error.
    this is my TODO:

    2009-06-10

    How to down load file.


    #!/usr/bin/env ruby

    require 'test/unit'
    require 'rubygems'
    require 'watir'
    require 'win32ole'



    class FileUpLoadTest < Test::Unit::TestCase
    include Watir

    def test_fileup
    ie = Watir::IE.new
    ie.goto('foo.com/fileup.html')
    assert(ie.file_field(:name,"register_data").exists?,message="error none file field")

    #Start down load
    ie.file_field(:id,'register_data').click_no_wait
    # should click_no_wait,otherwise wait forever behind modal window.

    windwName_dwn = "ファイルのダウンロード"
    windwName_sve = "名前を付けて保存"
    autoit=WIN32OLE.new("AutoItX3.Control")
    autoit.WinWait(windwName_dwn)
    autoit.WinActivate(windwName_dwn)
    autoit.ControlClick(windwName_dwn,"","[CLASS:Button;INSTANCE:2]")
    pathAndName = "var/foo.txt"
    autoit.WinWait(windwName_sv)
    autoit.WinActivate(windwName_sv)
    autoit.ControlSetText(windwName_sv, "", 1148, "#{pathAndName}")
    autoit.ControlClick(windwName_sv,"","[CLASS:Button;INSTANCE:2]")
    autoit.WinWait("ダウンロードの完了")
    end
    end

    2009-06-09

    stucks

    |
    V

    How to file up load


    #!/usr/bin/env ruby

    require 'test/unit'
    require 'rubygems'
    require 'watir'
    require 'win32ole'



    class FileUpLoadTest < Test::Unit::TestCase
    include Watir

    def test_fileup
    ie = Watir::IE.new
    ie.goto('foo.com/fileup.html')
    assert(ie.file_field(:name,"register_data").exists?,message="error none file field")
    path = "C:\\InstantRails-2.0-win\\rails_apps\\somefile.csv" # set("#{path}")
    ie.file_field(:id,'register_data').click_no_wait
    # debug code check file path and sleep sec.
    puts "#{path}"
    puts Time.now
    sleep(5)
    puts Time.now
    # debug code end

    autoit=WIN32OLE.new("AutoItX3.Control")
    autoit.WinWait("ファイルの選択")
    autoit.WinActivate("ファイルの選択")
    autoit.ControlSetText("ファイルの選択", "", 1148, "#{path}")
    autoit.Send("{ENTER}")

    ie.button(:name,"btnSubmitFile").click
    wait_until {ie.text.include? "アップロードされました。"} #rendering待ち
    assert(ie.text.include?("アップロードされました。"),message="error import" ) #データインポートチェック

    ie.close

    end

    end

    BCM4321 on Latitude D430

    At kernel 3 find wireless hardware lspci | grep -i wireless  check using current kernel module with PCI bus address lspci -vv -s 0c:...