需要有关 Flash 硒的帮助

发布于 2024-10-04 11:51:35 字数 1322 浏览 1 评论 0原文

我正在自动化一个嵌入了 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

空城仅有旧梦在 2024-10-11 11:51:35

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文