paco246y8 / flash-selenium

Automatically exported from code.google.com/p/flash-selenium
0 stars 0 forks source link

python: window.document.clickcolors is undefined #15

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. start selenium-remote-control-1.0-beta-2 
2. run the python test script below

from ammado.common.flashselenium.FlashSelenium import FlashSelenium
from ammado.common.flashselenium.selenium import selenium

uat = "http://www.geocities.com/paulocaroli/flash/colors.html"
browserType = "*firefox"
selenium = selenium("localhost", 4444, browserType, uat)
selenium.start()
selenium.open(uat)
flashApp = FlashSelenium(selenium, "clickcolors")
print flashApp
flashApp.percent_loaded()

What is the expected output? 
The percent loaded method should be sucessfully called.

What do you see instead?
Exception: ERROR: Threw an exception: window.document.clickcolors is 
undefined

What version of the product are you using? On what operating system?
Windows Server 2003
selenium-remote-control-1.0-beta-2
Flash-Selenium_python_client_r37

Please provide any additional information below.

Has anyone managed to get this working with python?

Original issue reported on code.google.com by billy.lo...@googlemail.com on 15 May 2009 at 9:47

GoogleCodeExporter commented 9 years ago
I tried the java client as well and get same outcome:

Exception in thread "main" com.thoughtworks.selenium.SeleniumException: ERROR: 
Threw 
an exception: window.document.clickcolors is undefined
    at 
com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrE
rror
(HttpCommandProcessor.java:97)
    at com.thoughtworks.selenium.HttpCommandProcessor.doCommand
(HttpCommandProcessor.java:91)
    at com.thoughtworks.selenium.HttpCommandProcessor.getString
(HttpCommandProcessor.java:262)
    at com.thoughtworks.selenium.DefaultSelenium.getEval(DefaultSelenium.java):435)
    at com.thoughtworks.selenium.FlashSelenium.call(FlashSelenium.java:55)
    at com.thoughtworks.selenium.FlashSelenium.PercentLoaded(FlashSelenium.java:95)

Original comment by billy.lo...@googlemail.com on 15 May 2009 at 10:58

GoogleCodeExporter commented 9 years ago
This is the Java test

import com.thoughtworks.selenium.DefaultSelenium;
import com.thoughtworks.selenium.FlashSelenium;
import com.thoughtworks.selenium.Selenium;
import com.thoughtworks.selenium.SeleniumException;

public class RestoreDBSnapShot
{

    public static void main(String[] args)
        throws Exception
    {

        String URL 
= "http://www.geocities.com/paulocaroli/flash/colors.html";

        Selenium selenium = new DefaultSelenium("localhost", 
4444, "*firefox",URL);
        selenium.start();

        FlashSelenium flashApp = new FlashSelenium(selenium, "clickcolors");
        selenium.open(URL);

        flashApp.PercentLoaded();

        System.out.println("Test Finished");

    }
}

Original comment by billy.lo...@googlemail.com on 15 May 2009 at 11:03

GoogleCodeExporter commented 9 years ago
Hey Billy,

Use "coloredSquare" instead of "clickcolors" while instantiating FlashSelenium. 
It
should solve your issue. 

The colors.html has undergone some changes and the id has chanded on that end. 
Sorry
that we haven't updated the test cases accordingly.

Original comment by sachin.s...@gmail.com on 16 May 2009 at 5:18

GoogleCodeExporter commented 9 years ago
I have ran into similar issue even when I change from clickcolors to 
coloredSqure.

Here's the error message that I received:

File "C:\Python26\lib\selenium.py", line 202, in do_command
    raise Exception, data
Exception: ERROR: Threw an exception: window.document.coloredSquare is undefined

Here's the error message on the selenium server:
16:20:56.205 INFO - Got result: OK,Mozilla/5.0 (Windows; U; Windows NT 5.1; 
en-US;
rv:1.9.
o/2009042316 Firefox/3.0.10 on session f681191cc847456eac39de3a607f82e7
16:20:56.220 INFO - Command request:
getEval[window.document['coloredSquare'].IsPlaying();
sion f681191cc847456eac39de3a607f82e7
16:20:56.236 INFO - Got result: ERROR: Threw an exception:
window.document.coloredSquare i
d on session f681191cc847456eac39de3a607f82e7

Original comment by daved...@gmail.com on 17 May 2009 at 11:32

GoogleCodeExporter commented 9 years ago
Here's the selenium version that I am using:

C:\test>java -jar selenium-server.jar -interactive
17:24:48.689 INFO - Java: Sun Microsystems Inc. 11.3-b02
17:24:48.689 INFO - OS: Windows XP 5.1 x86
17:24:48.689 INFO - v1.0-beta-2 [2571], with Core v1.0-beta-2 [2330]

Original comment by daved...@gmail.com on 18 May 2009 at 12:28

GoogleCodeExporter commented 9 years ago
I changed the id to coloredSquare as suggested but I still get same result:

import com.thoughtworks.selenium.DefaultSelenium;
import com.thoughtworks.selenium.FlashSelenium;
import com.thoughtworks.selenium.Selenium;
import com.thoughtworks.selenium.SeleniumException;

public class RestoreDBSnapShot
{

    public static void main(String[] args)
        throws Exception
    {

        String URL 
= "http://www.geocities.com/paulocaroli/flash/colors.html";

        Selenium selenium = new DefaultSelenium("localhost", 
4444, "*firefox",URL);
        selenium.start();

        FlashSelenium flashApp = new FlashSelenium
(selenium, "coloredSquare");
        selenium.open(URL);

        flashApp.PercentLoaded();

        System.out.println("Test Finished");

    }
}

this is the program output:

--------------------Configuration: restore - JDK version 1.6.0_01 <Default> - 
<Default>--------------------
Exception in thread "main" com.thoughtworks.selenium.SeleniumException: ERROR: 
Threw 
an exception: window.document.coloredSquare is undefined
    at 
com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrE
rror
(HttpCommandProcessor.java:97)
    at com.thoughtworks.selenium.HttpCommandProcessor.doCommand
(HttpCommandProcessor.java:91)
    at com.thoughtworks.selenium.HttpCommandProcessor.getString
(HttpCommandProcessor.java:262)
    at com.thoughtworks.selenium.DefaultSelenium.getEval(DefaultSelenium.java):435)
    at com.thoughtworks.selenium.FlashSelenium.call(FlashSelenium.java:55)
    at com.thoughtworks.selenium.FlashSelenium.PercentLoaded(FlashSelenium.java:95)
    at RestoreDBSnapShot.main(RestoreDBSnapShot.java:23)

Process completed.

Original comment by billy.lo...@googlemail.com on 18 May 2009 at 8:22

GoogleCodeExporter commented 9 years ago
just to add that I have tried with firefox 3.0.10 and IE7. 

This is the embedded flash object source code on the test page:

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" 
codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#
versi
on=8,0,0,0" width="100" height="100" id="clickcolors" align="middle">
        <param name="allowScriptAccess" value="sameDomain" />
        <param name="movie" value="ColoredSquare.swf" />
        <param name="quality" value="high" />
        <param name="bgcolor" value="#ffffff" />
        <embed src="ColoredSquare.swf" quality="high" bgcolor="#ffffff" width="500" 
height="500" name="coloredSquare" align="middle" allowscriptaccess="*" 
type="application/x-shockwave-flash" 
pluginspage="http://www.macromedia.com/go/getflashplayer" />      
</object>

In IE7 the error is as follows:

--------------------Configuration: restore - JDK version 1.6.0_01 <Default> - 
<Default>--------------------
Exception in thread "main" com.thoughtworks.selenium.SeleniumException: ERROR: 
Threw 
an exception: 'window.document.coloredSquare' is null or not an object
    at 
com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrE
rror
(HttpCommandProcessor.java:97)
    at com.thoughtworks.selenium.HttpCommandProcessor.doCommand
(HttpCommandProcessor.java:91)
    at com.thoughtworks.selenium.HttpCommandProcessor.getString
(HttpCommandProcessor.java:262)
    at com.thoughtworks.selenium.DefaultSelenium.getEval(DefaultSelenium.java):435)
    at com.thoughtworks.selenium.FlashSelenium.call(FlashSelenium.java:55)
    at com.thoughtworks.selenium.FlashSelenium.PercentLoaded(FlashSelenium.java:95)
    at RestoreDBSnapShot.main(RestoreDBSnapShot.java:23)

Process completed.

Original comment by billy.lo...@googlemail.com on 18 May 2009 at 8:34

GoogleCodeExporter commented 9 years ago
What is happening with this issue? Almost 3 months in the stewing - should be 
well
cooked by now!
I have encountered exactly the same problems using 'FlashSelenium Java Client
Selenium RC Extension - Compatible with SRC 0.9.2' as well as 'FlashSelenium 
Java
Client Selenium RC Extension - Compatible with SRC 1.0'.
Very keen to dive into testing Flash with Selenium but this is a MAJOR obstacle.

Original comment by dschulb...@gmail.com on 10 Aug 2009 at 11:43

GoogleCodeExporter commented 9 years ago
Hello there

I had the same issue working with flashselenium-java-client-extension.jar 
Got result: ERROR: Threw an exception: window.document.clickcolors is undefined 
on
session f76257b0d48e435daae101d70ec19f0a

I solved it adding flashselenium-java-client-extension-1.0.jar to the Path 
Configuration

Tell me whether it works for you.
Note: I run the test using IE, not Firefox.

Original comment by laurapi...@gmail.com on 14 Aug 2009 at 3:09

GoogleCodeExporter commented 9 years ago
please let me know any solution for this issue

Exception in thread "main" com.thoughtworks.selenium.SeleniumException: ERROR: 
Threw
an exception: 'window.document.coloredSquare' is null or not an object
        at
com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrE
rror(HttpCommandProcessor.java:97)
        at
com.thoughtworks.selenium.HttpCommandProcessor.doCommand(HttpCommandProcessor.ja
va:91)
        at
com.thoughtworks.selenium.HttpCommandProcessor.getString(HttpCommandProcessor.ja
va:262)
        at com.thoughtworks.selenium.DefaultSelenium.getEval(DefaultSelenium.java:461)
        at com.thoughtworks.selenium.FlashSelenium.call(FlashSelenium.java:55)
        at com.thoughtworks.selenium.FlashSelenium.PercentLoaded(FlashSelenium.java:95)
        at webdirver.RestoreDBSnapShot.main(RestoreDBSnapShot.java:26)
Java Result: 1
BUILD SUCCESSFUL (total time: 6 seconds)

Original comment by ravindra...@gmail.com on 20 Apr 2010 at 6:32

GoogleCodeExporter commented 9 years ago
Regarding the original issue by Billy, please check BrowserConstants.py and 
verify that your browser is there. If not, add your browser, and also verify 
that this value is checked in: FlashSelenium.py!checkBrowserAndReturnJSPrefix.

-- Ateeq

Original comment by ateeq.sh...@gmail.com on 22 Mar 2012 at 7:29