Selenium:我可以测试一个页面是否正确加载了Flash应用程序(即swf)? [英] Selenium: Can i test if a page loaded a flash app (ie a swf) properly?

查看:211
本文介绍了Selenium:我可以测试一个页面是否正确加载了Flash应用程序(即swf)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在写一些硒测试(在rspec为一个Rails应用程序)。我的一个网页加载一个瑞士法郎,而我不想测试这个Flash应用程序的功能,我想测试它加载好。这是可能的吗?



如果有帮助,加载swf的html是:

 < OBJECT classid =clsid:D27CDB6E-AE6D-11cf-96B8-444553540000
codebase =http://download.macromedia.com/pub/shockwave/cabs/flash/swflash .cab#version = 8,0,0,0width =800height =600>
< PARAM NAME = movie VALUE =http:// localhost:3000 / assets / players / millionaire / millionaire.swf>
< PARAM NAME = quality VALUE =high>
< PARAM NAME = FlashVars VALUE =quizXML = http:// localhost:3000 / quizzes / 371.xml?online = true& myURL = http:// localhost:3000 / assets / players / millionaire /& ;在线=真>

< param name = width value =800>
< param name = height value =600>
< EMBED src =http:// localhost:3000 / assets / players / millionaire / millionaire.swfFlashVars =quizXML = http:// localhost:3000 / quizzes / 371.xml?online = true& amp; amp; ; myURL = http:// localhost:3000 / assets / players / millionaire /& online = truewidth =800height =600quality = high TYPE =application / x-shockwave-flashPLUGINSPAGE = http://www.macromedia.com/go/getflashplayer\">
< / EMBED>
< / OBJECT>

谢谢 - max

解决方案

是的,你可以。看看闪硒。 http://code.google.com/p/flash-selenium/

有一个叫做percentLoaded的小函数。
$ b

assertEquals(100,flashApp.PercentLoaded());你可以写一个简单的循环等待它给100回。



像:

  while(flashApp.PercentLoaded()<100)
{
Thread.sleep(1);
}

希望有帮助,
Gergely。


I'm writing some selenium tests (in rspec for a rails app). One of my pages loads a swf and while i don't want to test the functionality of this flash app i do want to test that it loaded up ok. Is this possible?

In case it helps, the html to load the swf is:

<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="800" height="600">
<PARAM NAME=movie VALUE="http://localhost:3000/assets/players/millionaire/millionaire.swf">
<PARAM NAME=quality VALUE="high">
<PARAM NAME=FlashVars VALUE="quizXML=http://localhost:3000/quizzes/371.xml?online=true&myURL=http://localhost:3000/assets/players/millionaire/&online=true">

<param name=width value="800">
<param name=height value="600">
<EMBED src="http://localhost:3000/assets/players/millionaire/millionaire.swf" FlashVars="quizXML=http://localhost:3000/quizzes/371.xml?online=true&myURL=http://localhost:3000/assets/players/millionaire/&online=true" width="800" height="600" quality=high TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">
</EMBED>
</OBJECT>    

thanks - max

解决方案

Yes you can. Take a look at flash-selenium. http://code.google.com/p/flash-selenium/

There is a little function called percentLoaded.

assertEquals(100, flashApp.PercentLoaded());

You can write a simple for cycle to wait for it to give back 100.

Like:

    while ( flashApp.PercentLoaded() < 100 )
    {
        Thread.sleep(1);
    }

Hope that helps, Gergely.

这篇关于Selenium:我可以测试一个页面是否正确加载了Flash应用程序(即swf)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆