<ruby id="h6500"><table id="h6500"></table></ruby>
    1. <ruby id="h6500"><video id="h6500"></video></ruby>
          1. <progress id="h6500"><u id="h6500"><form id="h6500"></form></u></progress>
            • 軟件測試技術(shù)
            • 軟件測試博客
            • 軟件測試視頻
            • 開(kāi)源軟件測試技術(shù)
            • 軟件測試論壇
            • 軟件測試沙龍
            • 軟件測試資料下載
            • 軟件測試雜志
            • 軟件測試人才招聘
              暫時(shí)沒(méi)有公告

            字號: | 推薦給好友 上一篇 | 下一篇

            SilkTest中Exists()的替代方法

            發(fā)布: 2011-4-11 10:42 | 作者: 不詳 | 來(lái)源: 領(lǐng)測軟件測試網(wǎng)采編 | 查看: 28次 | 進(jìn)入軟件測試論壇討論

            領(lǐng)測軟件測試網(wǎng)

              SilkTest中Exists()的替代方法  軟件測試

              Posted by Stan Taylor on March 31, 2010

              I've recently started a new SilkTest project testing a web application, using SilkTest's new open agent and the 4Test scripting language. This post covers an aspect of what I've learned.

              In the SilkTest 'classic' agent, you used the 'Exists()' method to test whether an object exists in the application under test, e.g.,:

              if (Page.Object1.Object2.Object3.Exists())

              // do something...

              With the open agent's dynamic object recognition, the Find() method is what you need to use, but it took me some research to figure out how to do an if statement with the find() method. Here's a test:

              if (Desktop.Find("http://BrowserApplication//BrowserWindow//INPUT[@id='sysname']",{5, false}) != NULL)

              // do something

              You'll notice that I added an optional argument: {5,null}. These two values constitute a FINDOPTIONS data type record. The first one is the timeout. The second value is the important one for our purposes: it "determines whether the Find method throws an E_WINDOW_NOT_FOUND exception if no object is found or NULL is returned if no object is found. "

              So, you set that value to FALSE and then test to see whether or not the Find() method returns NULL. If not null, the object exists.

              --------------------------------------------------------------------------------

              Comments

              The following can be tried:

              [-] window BrowserChild AUTPage1

              [ ] tag "Jingle Bells"

              [ ] locator "http://BrowserApplication//BrowserWindow[@caption='Jingle Bells']"

              [ ]

              [-] DomElement HomePageImage

              [ ] locator "http://IMG[@title='You are on Home page.']"

              [ ]

              [ ]

              [-] void TestObjExists ()

              [ ]

              [-] if AUTPage1.HomePageImage.Exists()

              [ ] Print ("You got lucky & are on Home page.")

              [-] else

              [ ] LogWarning ("Sorry, you missed the bus.")

              Posted by: STU | April 5, 2010 02:03 PM

            延伸閱讀

            文章來(lái)源于領(lǐng)測軟件測試網(wǎng) http://kjueaiud.com/


            關(guān)于領(lǐng)測軟件測試網(wǎng) | 領(lǐng)測軟件測試網(wǎng)合作伙伴 | 廣告服務(wù) | 投稿指南 | 聯(lián)系我們 | 網(wǎng)站地圖 | 友情鏈接
            版權所有(C) 2003-2010 TestAge(領(lǐng)測軟件測試網(wǎng))|領(lǐng)測國際科技(北京)有限公司|軟件測試工程師培訓網(wǎng) All Rights Reserved
            北京市海淀區中關(guān)村南大街9號北京理工科技大廈1402室 京ICP備10010545號-5
            技術(shù)支持和業(yè)務(wù)聯(lián)系:info@testage.com.cn 電話(huà):010-51297073

            軟件測試 | 領(lǐng)測國際ISTQBISTQB官網(wǎng)TMMiTMMi認證國際軟件測試工程師認證領(lǐng)測軟件測試網(wǎng)

            老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月
              <ruby id="h6500"><table id="h6500"></table></ruby>
              1. <ruby id="h6500"><video id="h6500"></video></ruby>
                    1. <progress id="h6500"><u id="h6500"><form id="h6500"></form></u></progress>