My favorites | Sign in
Project Logo
                
New issue | Search
for
| Advanced search | Search tips
Issue 14: Is it Bug: Creating flashApp with id="clickcolors" doesnt work but instead with name="coloredSquare" it works.
2 people starred this issue and may be notified of changes. Back to list
Status:  Accepted
Owner:  sachin.sudheendra
Type-Other
Priority-Medium
Maintainability


Sign in to add a comment
 
Reported by manisha.bhardwaj, May 03, 2009

What steps will reproduce the problem?
Original sample selenium code available here fails to execute flashApp. Its
created using this statement:
flashApp = new FlashSelenium(selenium, "clickcolors"); 
"clickcolors" is the id of object in colors.html

What is the expected output? What do you see instead?
But if I create flashApp instance using name of embed object in colors.html
page, it works. 
flashApp = new FlashSelenium(selenium, "coloredSquare");

Please let me know if I am not doing it correctly, or I missed out anything. 


Comment 1 by sachin.sudheendra, May 16, 2009
Hi Manisha,

You should be using "new FlashSelenium(selenium, "coloredSquare");"
if you're testing the sample colors application.

Our bad that only the java client test cases were updated and not others. Thanks for
bringing this up.

Status: Accepted
Owner: sachin.sudheendra
Labels: -Type-Defect Type-Other Maintainability
Comment 2 by s0ckzz, May 29, 2009
I tried using IE6 + Win XP using "clickcolors" but the test "testColorTransition"
doesn't work completely
line 36:                 assertEquals(BLUE, flashApp.call("getColor")); => it seems
that the previous click doesn't work on IE

Another thing... If I use 'coloredSquare' on IE6 an exception is thrown:
"com.thoughtworks.selenium.SeleniumException: ERROR: Threw an exception: Element
coloredSquare not found"
Comment 3 by rkmohapatra, Jun 04, 2009
I am trying to test a Flash App using FlashSelenium.
In my case, I get hold of the flash object name as below.

browser.getEval("this.browserbot." +
                    "getCurrentWindow().document.getElementsByTagName('frame')[0]" +
                    ".contentWindow.document.getElementsByTagName('frame')[0]." +
                    "contentWindow.document.getElementById('player')." +
                    "getElementsByTagName('param')[0].name");

The HTML code snippet is something like this.

<object id="player" ...>
<param value="player/playershell.swf" name="movie"/>
...
</object>

But I get exception when tried to test any flash menthods.
FlashSelenium flashApp = new FlashSelenium(browser, browser.getEval("this.browserbot." +
                    "getCurrentWindow().document.getElementsByTagName('frame')[0]" +
                    ".contentWindow.document.getElementsByTagName('frame')[0]." +
                    "contentWindow.document.getElementById('player')." +
                    "getElementsByTagName('param')[0].name"));
        System.out.println ("Is Playing: "+flashApp.IsPlaying());

ERROR: Threw an exception: Element movie not found.

I also tried by using the object id as parameter to FlashSelenium constructor.

I tried with both original JAR file of flash-selenium and the JAR with some
fixes(found in this forum).

Appreciate any help in resolving this.

NOTE: I used Selenium RC 1.0 beta2. Wanted to know if this is something related to
the issues for supporting RC 1.0 version as mentioned in the flash-selenium web page.

Thanks,
Rajesh



Comment 4 by rkmohapatra, Jun 04, 2009
Tried again with the fixed flash-selenium.jar posted in this forum.
With the followng code I did not get any exception. 
But I am little confused with the return values of the method calls to IsPlaying and
PercentLoaded.

The flash movie is actually playing a powerpoint presentation within flash.
And the call to IsPlaying return false and call to PercentLoaded returns 100 although
all the slides in the presentation are not yet played.

Any idea what could be the reason for this?

FlashSelenium flashApp = new FlashSelenium(browser, browser.getEval("this.browserbot." +
                    "getCurrentWindow().document.getElementsByTagName('frame')[0]" +
                    ".contentWindow.document.getElementsByTagName('frame')[0]." +
                    "contentWindow.document.getElementById('player').id"));
System.out.println ("Is Playing: "+flashApp.IsPlaying());
System.out.println ("Loaded: "+flashApp.PercentLoaded());

Appreciate any help with this.

Thanks,
Rajesh
Comment 5 by manisha.bhardwaj, Jun 04, 2009
You might try changing html src code as shown here.
http://code.google.com/p/flash-selenium/source/browse/trunk/flash/changingcolors/colors.html
There is an <embed> tag here. It takes up "name" attribute for this tag. Your html
src code doesn't have this. 

Other thing is I am not sure what is browser type in ur code. I have something like
this: 
   28:     selenium = SeleniumEnvironment.create("http://url-to-open this)
   29:                  .createSelenium();
   30:     selenium.start();
   31:     flashApp = new FlashSelenium(selenium, SWF_NAME);
   32:     selenium.open(URL);
             ....
   38:     flashApp.StopPlay();
   39:     assertEquals(100, flashApp.PercentLoaded());
   40:   }

Hope this helps. 
Manisha
Sign in to add a comment

Hosted by Google Code