>Workaround: Flash selenium test would not run in firefox 3.5 except when the browser mode is *firefoxProxy

>I looked into flash selenium a few weeks back and i thought it was a great way for me to test certain part of the apps i have been ignoring for some time.

However after knocking up a few test i discovered that my test would not run in my version of firefox (3.5). I got this error:

INFO – Got result: ERROR: Threw an exception: NPMethod called on non-NPObject wrapped JSObject! on session 471c65508e46457fa43f4deb873d0592

Then i read in some issue raised in the flash selenium site that flash selenium would only work in firefox 3.0 and it worked fine in IE for me.

Today while i was investigating another issue, i decided to try running the flashSelenium test in the “*firefoxproxy” mode and my tests ran succcessfully.

I am sure this workaround would be welcome by people facing this issue as well, please leave a comment if this is any help.

Thanks

Advertisements
This entry was posted in Software Testing and tagged , , , , , . Bookmark the permalink.

17 Responses to >Workaround: Flash selenium test would not run in firefox 3.5 except when the browser mode is *firefoxProxy

  1. Sachin says:

    >That is great news buddy! Thanks for that. I'll give it a shot once and if all goes well i'll post it up on the homepage.Thanks again.

  2. Indian says:

    >Hi,can you please explain how you used "*firefoxProxy", still I'm facing issue with running scripts.can you please paste sample code hereThanks,Vikram

  3. leumascom says:

    >@Indian, I would rather you paste a sample of the error you get when you run your tests and also a code copy of the line that starts selenium rc would be good ..

  4. leumascom says:

    >on a secodn thot, if it help selenium = new DefaultSelenium("localhost", 4444, *firefoxproxy, http://google.com);selenium.start();

  5. sumush says:

    >thanks a ton. that helped.

  6. Vikram says:

    >Hi leumascom,Please find below error meesage————-17:24:29.445 INFO – Java: Sun Microsystems Inc. 14.3-b0117:24:29.446 INFO – OS: Windows 7 6.1 x8617:24:29.456 INFO – v1.0.1 [2696], with Core v@VERSION@ [@REVISION@]17:24:29.554 INFO – Version Jetty/5.1.x17:24:29.555 INFO – Started HttpContext[/selenium-server/driver,/selenium-server/driver]17:24:29.556 INFO – Started HttpContext[/selenium-server,/selenium-server]17:24:29.556 INFO – Started HttpContext[/,/]17:24:29.566 INFO – Started SocketListener on 0.0.0.0:444417:24:29.566 INFO – Started org.mortbay.jetty.Server@1ac3c0817:24:29.646 INFO – Checking Resource aliases17:24:29.652 INFO – Command request: getNewBrowserSession[*firefoxproxy, http://flashselenium.t35.com/colors.html, ] on session null17:24:29.658 INFO – creating new remote session17:24:29.784 INFO – Allocated session 83e50a719ba947d6a872137826f14d4b for http://flashselenium.t35.com/colors.html, launching…17:24:29.784 WARN – It looks like your baseUrl (http://flashselenium.t35.com/colors.html) is pointing to a file, not a directory (it doesn't end with a /). We're going to have to strip off the last part of the pathname.17:24:29.848 INFO – Preparing Firefox profile…17:24:32.809 INFO – Launching Firefox…17:24:36.401 INFO – Got result: OK,83e50a719ba947d6a872137826f14d4b on session 83e50a719ba947d6a872137826f14d4b17:24:36.409 INFO – Command request: open[http://flashselenium.t35.com/colors.html, ] on session 83e50a719ba947d6a872137826f14d4b17:24:37.624 INFO – Started SocketListener on 0.0.0.0:4988117:24:39.023 INFO – Got result: OK on session 83e50a719ba947d6a872137826f14d4b17:24:39.026 INFO – Command request: getTitle[, ] on session 83e50a719ba947d6a872137826f14d4b17:24:39.036 INFO – Got result: OK,Clicking Colors on session 83e50a719ba947d6a872137826f14d4b17:24:39.038 INFO – Command request: getEval[this.browserbot.findElement("clickcolors").getColor();, ] on session 83e50a719ba947d6a872137826f14d4b17:24:39.052 INFO – Got result: ERROR: Threw an exception: this.browserbot.findElement("clickcolors").getColor is not a function on session 83e50a719ba947d6a872137826f14d4b17:24:39.055 INFO – Command request: testComplete[, ] on session 83e50a719ba947d6a872137826f14d4b17:24:39.055 INFO – Killing Firefox…17:24:39.178 INFO – Got result: OK on session 83e50a719ba947d6a872137826f14d4b——-

  7. Vikram says:

    >Please find the code as well ——import org.openqa.selenium.server.SeleniumServer;import org.openqa.selenium.server.RemoteControlConfiguration;import com.thoughtworks.selenium.DefaultSelenium;import com.thoughtworks.selenium.Selenium;//import com.thoughtworks.selenium.SeleniumException;import com.thoughtworks.selenium.FlashSelenium;import junit.framework.TestCase;import java.io.File;//import org.openqa.selenium.server.SeleniumServer;public class GoogleTest extends TestCase{ private FlashSelenium flashApp; private Selenium browser; private SeleniumServer serverLauncher; private RemoteControlConfiguration RC; File FFpath; private final static String GREEN = "GREEN"; private final static String BLUE = "BLUE"; private final static String RED = "RED"; private final static String URL = "http://flashselenium.t35.com/colors.html"; public void setUp() { try{ FFpath = new File("c:\\custom-profile"); RC = new RemoteControlConfiguration(); RC.setFirefoxProfileTemplate(FFpath); //serverLauncher = new SeleniumServer(RC); serverLauncher = new SeleniumServer(); serverLauncher.start(); browser = new DefaultSelenium("localhost", 4444, "*firefoxproxy",URL); browser.start(); flashApp = new FlashSelenium(browser, "clickcolors"); browser.open(URL); }catch(Exception e){ e.printStackTrace(); } } public void tearDown() { browser.stop(); serverLauncher.stop(); } public void testColorTransition() { assertEquals("Clicking Colors", browser.getTitle()); assertEquals(GREEN, flashApp.call("getColor")); flashApp.call("click"); assertEquals(BLUE, flashApp.call("getColor")); flashApp.call("click"); assertEquals(RED, flashApp.call("getColor")); flashApp.call("click"); assertEquals(GREEN, flashApp.call("getColor")); } public void testRectangleLabel() { assertEquals("(Click here)", flashApp.call("getSquareLabel")); flashApp.call("setSquareLabel", "Dummy Label"); assertEquals("Dummy Label", flashApp.call("getSquareLabel")); } }—–

  8. leumascom says:

    >I think you asked the same problem here: http://code.google.com/p/flash-selenium/issues/detail?id=34#c1I looked into this and i used the suggestion given on the page and it now works.flashApp = new FlashSelenium(browser, "coloredSquare");and not flashApp = new FlashSelenium(browser, "clickcolors");if you are still having problems, send me an email to samueladesoga@gmail.com as i think the issue is different from what this topic addresses

  9. Gowri says:

    >when I use firefoxproxy all I get ia an empty firefox window and it hangs there :(My Code:import com.thoughtworks.selenium.*;import com.thoughtworks.selenium.FlexUISelenium;import com.thoughtworks.selenium.SeleniumException;import java.util.regex.Pattern; import junit.framework.*; public class FlexSample extends TestCase { private FlexUISelenium flexUITester; private Selenium browser; private final static String URL = "file:///C:/Documents%20and%20Settings/qqsics/Desktop/FlickrRIATest/bin-debug/FlickrRIATest.html"; public void setUp() { browser = new DefaultSelenium("localhost", 4444, "*firefoxproxy",URL); browser.start(); flexUITester = new FlexUISelenium(browser, "FlickrRIATest"); browser.open(URL); } public void tearDown() { browser.stop(); } public void testColorTransition() { try { Thread.sleep(10000); } catch (InterruptedException ex) { } flexUITester.type("Gowri").at("searchTerms"); try { Thread.sleep(10000); } catch (InterruptedException ex) { } flexUITester.click("Search"); try { Thread.sleep(10000); } catch (InterruptedException ex) { } } public static Test suite() { return new TestSuite(FlexSample.class); } public static void main(String args[]) { junit.textui.TestRunner.run(suite()); }}

  10. Vikram says:

    >Today I'm seeing strange error after using selenium = new DefaultSelenium("localhost", 4444, *firefoxproxy, http://google.com);error: Got result: Illegal operation on WrappedNative prototypeCan you please share how to got the value "*firefoxproxy" as browserstartcommand; as java doc help for Selenium RC Java doesn't have this oneThanks,Vikram

  11. >Thanks a lot for the tip! Worked for me.

  12. Anonymous says:

    >Thanks buddy !!!! It helped me…

  13. Gergely says:

    >Thanks man!! Your post helped a lot!!

  14. I love green says:

    >Thanks info in your post helped me a lot… thank you

  15. mamta says:

    >Can you please tell me how can i automate selenium for my web application which is using flash…i am not able to get how to get values from flash chart for comparision purpose.is there any ebook regarding flash selenium .please let me know.my id is mamta.singla@gmail.com

  16. Anonymous says:

    >Thanks so much it really helped me 🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s