<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    躺在沙灘上的小豬

    快樂的每一天

    #

    靈活的Watir。

    記得以前用python寫過一個日報填寫的東西,可是涉及的庫太多,感覺很不好。
    今天剛剛看到Watir,變將它重寫了一下:

     require 'Watir'

    #登陸地址
    pform_login_url='http://ip/pform/common/login.jsp'
    #填寫日志地址
    pform_input_url='http://ip/pform/nbgl/datainputInitAction.do'

    ie
    =Watir::IE.new

    #輸入用戶名&密碼
    puts '登陸.'
    ie.goto(pform_login_url)
    ie.text_field(:name,
    'j_username').set('工號')
    ie.text_field(:name,
    'j_password').set('密碼')

    #提交頁面
    ie.button(:name,'submit').click

    #轉(zhuǎn)向日報填寫地址
    puts('填寫日報')
    ie.goto(pform_input_url)

    #填寫日報時間
    ie.text_field(:name,'fillInDate').set('2006-01-24')

    #選擇項目
    ie.select_list(:name,'detailList[0].projectId').select('***項目')
    #具體事項
    #
    ie.select_list(:name,'detailList[0].workId').select('代碼開發(fā)')
    #
    工作內(nèi)容
    ie.text_field(:name,'detailList[0].workContent').set('代碼開發(fā)')
    #正常工作時長
    ie.text_field(:name,'detailList[0].workNum').set('8')
    #加班工作時長
    ie.text_field(:name,'detailList[0].overtimeNum').set('0')

    puts(
    '提交日報')
    #提交表單
    ie.button(:id,'submit').click

    if ie.contains_text('成功')
      puts 
    '日報提交成功!'
    else
      puts 
    '日報提交失敗!'
    end

    ie.close
    #end

    很簡潔,但是有個問題,就是中文的問題,正好在 
    http://www.tkk7.com/raimundox/archive/2006/01/12/27676.html
    這里看到關(guān)于中文處理的方法,改進(jìn)之,偷懶,直接拷貝過來:)
    OK!提交之.

    posted @ 2006-01-23 17:02 martin xus| 編輯 收藏

    Watir Quick Start!

    http://rubyforge.org/projects/wtr/

    WATIR stands for "Web Application Testing in Ruby". Watir (pronounced water) is a free, open-source functional testing tool for automating browser-based tests of web applications.

    目前最新版本為1.4.1只支持Windows IE.
    Watir2.0會支持Linux和Firefox(http://rubyforge.org/pipermail/wtr-general/2005-May/001907.html)

    require 'watir' 

    #測試url
    test_site='http://www.4ya.cn/dosearchsite.action'

    #打開新的窗口
    ie = Watir::IE.new

    #轉(zhuǎn)到測試頁面
    ie.goto(test_site)

    puts 
    'Test Begin'


    #輸入需要查詢的字符 'FreeMarker'
    ie.text_field(:name,'searchQuery.queryString').set('FreeMarker')
    #點擊按鈕
    ie.button(:value,'Go').click

    #檢測查詢結(jié)果頁面是否包括 FreeMarker Quick Start 該文章
    #
    如果有,則測試通過,否則測試失敗!
    if ie.contains_text('FreeMarker Quick Start')
      puts 
    'Yeah!I can find FreeMarker Quick Start'
    else
      puts 
    'Ooooops!I can\'t find any more wich associate with FreeMarker Quick Start'
    end

    #關(guān)閉瀏覽器
    ie.close
    #end

    參考:
    Watir User Guide

    資源:
    http://watir.net/

    posted @ 2006-01-23 15:59 martin xus| 編輯 收藏

    Lightbox JS

    Lightbox JS is a simple, unobtrusive script used to to overlay images on the current page. It's a snap to setup and works on all modern browsers.

    http://www.huddletogether.com/projects/lightbox/

    image #1

    posted @ 2006-01-20 16:02 martin xus| 編輯 收藏

    ActiveState.Komodo.v3.5.2.Professional Keygen

    http://www.activestate.com/

    Komodo is ActiveState's cross-platform, multi-language Integrated Development Environment (IDE). Komodo supports development in numerous languages, including Perl, Python, PHP, Ruby, Tcl, XSLT, JavaScript, and more.

    http://www.tkk7.com/Files/martinx/ActiveState.Komodo.v3.5.2.Professional.Incl.Keygen.rar

    posted @ 2006-01-20 11:47 martin xus| 編輯 收藏

    Moo.ajax: 1.3kb for all your asynchronous needs

    http://ajaxian.com/archives/mooajax-13kb-for-all-your-asynchronous-needs
    Valerio Proietti, the creator of Moo.fx, has now created a micro library for Ajax, moo.ajax.

    I noticed many of you requested if it would have been possible to use the full prototype, instead of the lite one I provided with the full download of moofx, to use its ajax capabilities along with the effects. Sure you can, but wouldn’t it be cooler if there was a more lightweigt one?

    Just to continue my mission in small javascripting, I have arranged this moo.ajax, in just 1.3kb of uncompressed sweetness.

    read more for instructions, or download the script. As always, any comments/corrections/suggestions are highly appreciated.

    moo.ajax is a very simple ajax class, to be used with prototype.lite from moo.fx. It’s roughly based on the prototype one, so their usage are very similar.

    The request
    to make any request just call

    new ajax(url, options);


    The options
    method: choose either post or get. The default is post.
    posyBody postBody: if you choose post as method, you can write parameters here.
    onComplete: a function that will be fired when your request is complete. The request object will be passed as a parameter of the function.
    update: an dom element or an element’s id. This element will be filled with the request’s responsetext.
    An example
    This will call my script.php via post, setting as parameter sleep=3. When the request is complete I want an alert with the response text, and I want an element to be updated with the responsetext as well.

    new ajax ('sleep.php', {postBody: 'sleep=3', update: $('myelementid'), onComplete: myFunction});
    function myFunction(request){
      alert(request.responseText);
    }

    posted @ 2006-01-20 09:31 martin xus| 編輯 收藏

    僅列出標(biāo)題
    共28頁: First 上一頁 9 10 11 12 13 14 15 16 17 下一頁 Last 
    主站蜘蛛池模板: 亚洲图片中文字幕| 亚洲AV日韩AV永久无码免下载| 亚洲福利电影在线观看| 华人在线精品免费观看| 国产成人亚洲综合色影视| 巨胸狂喷奶水视频www网站免费| 国产亚洲精品无码专区| 两个人的视频www免费| 亚洲人成77777在线播放网站| 国产在线精品观看免费观看| 亚洲中文字幕无码一区二区三区| 中文字幕免费在线观看动作大片| 亚洲女久久久噜噜噜熟女| 免费日本一区二区| 亚洲成年人电影在线观看| 日韩精品成人无码专区免费| 亚洲国产精品无码久久98| 免费大黄网站在线观| 久久av免费天堂小草播放| 亚洲AV无码乱码国产麻豆| 久久精品国产这里是免费| 亚洲老熟女@TubeumTV| 女人18毛片a级毛片免费视频| 色噜噜的亚洲男人的天堂| 国产亚洲精久久久久久无码77777| 野花香高清视频在线观看免费 | 美女黄频a美女大全免费皮| 亚洲无线一二三四区手机| 无码国产精品一区二区免费16 | 亚洲日日做天天做日日谢| 国产三级免费电影| 免费无码又爽又刺激高潮软件| 亚洲精品在线播放| 日本中文一区二区三区亚洲| 在线观看免费黄网站| 亚洲中字慕日产2021| 亚洲国产精品激情在线观看| 99在线视频免费| 免费观看美女用震蛋喷水的视频| 亚洲综合无码无在线观看| 国产亚洲高清不卡在线观看|