å¦ä½å¯¹Flexè¿è¡èªå¨åæµè¯ä¹RIAtest使ç¨æ¹æ³.ä»å¤©ææ¶é´æ¸ä¸ä¸flexèªå¨åçä¸äºä¸è¥¿ï¼ä»å¤©å
ä»ç»ä¸ä¸ä¸ªæ¶è´¹çflexèªå¨åçå·¥å
· RIAtestã 第ä¸æ¬¡è®¤è¯å®æ¯å¨InfoQçå¨åä¸çå°çï¼å½æ¶æ²¡æçæï¼è¿æ¬¡å¥½å¥½ç使ç¨äºä¸ãæ¨å¯ä»¥å¨ä»¥ä¸çé¾æ¥ä¸è½½ï¼
ããä»å¤©ææ¶é´æ¸ä¸ä¸flexèªå¨åçä¸äºä¸è¥¿ï¼ä»å¤©å
ä»ç»ä¸ä¸ä¸ªæ¶è´¹çflexèªå¨åçå·¥å
· RIAtestã
ãã第ä¸æ¬¡è®¤è¯å®æ¯å¨InfoQçå¨åä¸çå°çï¼å½æ¶æ²¡æçæï¼è¿æ¬¡å¥½å¥½ç使ç¨äºä¸ãæ¨å¯ä»¥å¨ä»¥ä¸çé¾æ¥ä¸è½½ï¼
ããç¸å¯¹ä¸FunFX å Flex seleniumçä¸æçï¼RIAtestå·²ç»éæäºå½å¶ï¼åæ¾ï¼æå·¥èæ¬çåè½çå®ç¼åä¸äº®ã
ããç®åç说ä¸ä¸å¦ä½ä½¿ç¨å®è¿è¡flexèªå¨åæµè¯ï¼è¿éçå»äºFunFXï¼Flex seleniumï¼FlexMonkeyéè¦éæ°ç¼è¯å·¥ç¨çç¦æ¼ã
ãã1.å¯å¨RIAtestï¼å¨Fileâ>new projectæ°å»ºä¸ä¸ªé¡¹ç®ï¼é¡¹ç®å»ºå¥½åï¼å¨new projectä¸ç¹å»å³é®ï¼éæ©Add New Scriptï¼ä¼æ·»å ä¸ä¸ªæ°çèæ¬æ件ï¼ä½ å½å¶çèæ¬å°±ä¼åå°è¿ä¸ªæ件éé¢ãéæ© Projectâ>Options
ããå¨Application SWF Fileæ¯æ¨è¦æµçflexç¼è¯åºæ¥çSWFï¼ç¹å»OKç¡®å®(æ们使ç¨RIAtestçå®è£
è·¯å¾RIATest 3\samples\components\app\binä¸é¢æApp.swfæ件åä¾å)ã好äºï¼æ们å¯ä»¥å¼å§è¿è¡ç¨åºï¼è¿è¡å½å¶èæ¬å¦ãç¹å»èåæ runâ>Launch Applicationï¼RIAtestä¼è°ç¨ç³»ç»çæµè§å¨ï¼å è½½swfæ件ï¼è¿å°±æ¯æ们è¦æµè¯çç¨åºäºãç¹å»å¼å§å½å¶èæ¬çæé®ï¼å°±å¯ä»¥å¼å§å½å¶èæ¬äºï¼å»æµè§å¨ä¸çé£ä¸ªAPP.swfä¸é便ç¹ç¹çï¼ä¼çå°RIAtestçèæ¬æ件ä¸çæä¸äºèæ¬ãè¿äºå°±æ¯å½å¶çèæ¬äºãåç¹å»é£ä¸ªçº¢è²æé®åæ¢å½å¶ï¼å¨runâ>terminate applicationç¨æ¥ç»æåºç¨ç¨åºçæ¬æ¬¡è¿è¡ã
ãã2.ä¸é¢å°±æ¯RIAtestçç¸å
³èæ¬è¯è¨ï¼
ããFlexBox("index:30")=>click();
ããFlexBox("SimpleComponentsView")=>click();
ããFlexTextArea(ânewItemTextâ)=>keyPress(KEY_BACKSPACE);
ããè¿éä¸å¾ä¸æä¸ä¸Watiråseleniumä¸æ饶æ们çalertå¼¹åºæ¡ï¼è¿éç±äºRIAtestå®çå
é¨æºå¶éç¨Flex Automationæ¥å®ä½ç»ä»¶ï¼æ们å¯ä»¥ç¨ä»¥ä¸çæ¹æ³æ¥å®ä½
ããnew Locator({automationClassName:âFlexButtonâ, automationName: âOKâ})
ããé¦å
æ们使ç¨object inspectoræ¥è·å¾è¦åid(index)ï¼ç¶åå¤ææ¯å¦åå¨alertï¼ä¹åæ们ç¨ä¹åå®ä½çâOKâ buttonæ¥è¿è¡ç¹å»æä½ãå¤çèµ·æ¥è¿æ¯æ¯è¾ç®åçã
ããè¿æ¯ç»§ä¹åç èªå¨åæµè¯ç³»åä¹åï¼å次ç 究flexçèªå¨åãRIAtesté对flexçèªå¨åæµè¯æ¯æ¯è¾ä¸éçï¼ä¸æå¾å®¹æãé
ç½®ï¼ç¼åèæ¬ï¼ç»´æ¤èæ¬é½ä¸é¾ãç¸å¯¹å¦æä½¿ç¨ selenium Flexåruby FunFxçè¯éè¦å¨ä»£ç ä¸å¥½å¥½ä¸å夫ï¼å®ä»¬å¯¹å¾å¤å
置类æ¯æä¸æ¯å¾å¥½ãç±äºRIAtestä¸æ¯freeçï¼éè¦æ¨å¨éé±åå·¥ç¨é¾åº¦ä¸åéæ©ã
温馨提示:答案为网友推荐,仅供参考