需要有关 Flash 硒的帮助
我正在自动化一个嵌入了 Flash 的 Web 应用程序。 我使用 FlashSelenium 作为应用程序的 flash 部分,但每次运行测试时都会出现以下错误
com.thoughtworks.selenium.SeleniumException:错误:抛出一个 例外: this.browserbot.findElement("getInfo").PercentLoaded 不是 一个函数
下面是我的测试代码:-
import org.openqa.selenium.server.SeleniumServer;
import org.testng.annotations.Test;
import com.thoughtworks.selenium.DefaultSelenium;
import com.thoughtworks.selenium.FlashSelenium;
import com.thoughtworks.selenium.Selenium;
public class FlashClass extends SeleneseTestCase
{
private Selenium selenium = new DefaultSelenium("localhost", 4444, "*firefox","http://localhost:8080");
private FlashSelenium flashApp;
@Test
public void testflashTest() throws Exception
{
flashApp = new FlashSelenium(selenium,"getInfo");
SeleniumServer server = new SeleniumServer();
server.start();
selenium.start();
selenium.setSpeed("1000");
selenium.open("/web-App/Login.html");
selenium.windowMaximize();
selenium.type("userId", "test");
selenium.type("password", "test");
selenium.click("//input[@value=' Log In ']");
Thread.sleep(10000);
int i=flashApp.PercentLoaded();
System.out.println(i);
}
嵌入
flash 的 html 代码是:-
感谢这方面的任何帮助。
I m automating a web Application which has flash embedded in it.
I m using FlashSelenium for flash part of the application but every time i run the test i get the following error
com.thoughtworks.selenium.SeleniumException: ERROR: Threw an
exception: this.browserbot.findElement("getInfo").PercentLoaded is not
a function
Following is code for my test:-
import org.openqa.selenium.server.SeleniumServer;
import org.testng.annotations.Test;
import com.thoughtworks.selenium.DefaultSelenium;
import com.thoughtworks.selenium.FlashSelenium;
import com.thoughtworks.selenium.Selenium;
public class FlashClass extends SeleneseTestCase
{
private Selenium selenium = new DefaultSelenium("localhost", 4444, "*firefox","http://localhost:8080");
private FlashSelenium flashApp;
@Test
public void testflashTest() throws Exception
{
flashApp = new FlashSelenium(selenium,"getInfo");
SeleniumServer server = new SeleniumServer();
server.start();
selenium.start();
selenium.setSpeed("1000");
selenium.open("/web-App/Login.html");
selenium.windowMaximize();
selenium.type("userId", "test");
selenium.type("password", "test");
selenium.click("//input[@value=' Log In ']");
Thread.sleep(10000);
int i=flashApp.PercentLoaded();
System.out.println(i);
}
}
The html code where flash is embedded is:-
Any help in this regard is appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据 flash-selenium google 项目<,这似乎是一个已知问题/a>.建议的解决方法是不要在 Firefox 中运行,而是在 Chrome 中运行。或者还有另一个建议,即在 html 的嵌入标记中使用 swfObject 而不是 object。后者是更好的解决方案,但如果您想快速确保它正常工作,只需启动 chrome 即可。
Looks like this is a known issue according to flash-selenium google project. The recommended work around is to not run in firefox and to instead run in chrome. Or there was another suggestion which was to use swfObject instead of object in the embed tag in the html. The later is the better solution but if you want to quickly make sure it is working just fire up chrome.