Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

I want to make a script that plays all videos of YouTube channel and perform player settings and return status.

Execution of the following command does not create any error on java stacktrace but, neither has effect on YouTube player.

  • player.nextVideo() (command does not move to next video),
  • player.previousVideo() (command does not move to previous video), and
  • player.setShuffle(true).

Here is a complete script. My code use FlexWebDriver class, described for instance here.

import org.openqa.selenium.firefox.FirefoxDriver;

public class Youtube {

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

    FirefoxDriver driver = new FirefoxDriver();

    FlexWebDriver flashApp = new FlexWebDriver(driver, "movie_player");

    driver.get("http://www.youtube.com/watch?v=fZUTMprV9dI&list=UUQc_OGfP0IsgOWT0vosmQjg&feature=plpp_play_all");
    Thread.sleep(5000L);

    flashApp.call("nextVideo");
    flashApp.call("previousVideo");
    flashApp.call("setShuffle","true");
  }

}
share|improve this question
1  
As is, the code starts a FireFox browser and plays a series of YouTube videos. I do not see any error messages. Can you explain what you mean by "perform player settings and give status"? Where do you see the error messages? In a Java stack trace? In the browser? Somewhere else? Which version of Selenium are you using? Which version of FireFox? Which operating system? And finally, what is your question? –  user246 Feb 25 '12 at 23:25
    
I don't get error in Java stack trace. Problem is that Effect of flashApp.call("nextVideo"); / flashApp.call("previousVideo"); / flashApp.call("setShuffle","true"); commands are not appeared on youtube video player. when next video command execute next video should started on youtube player. but this is not happened –  Jasmine.Olivra Feb 26 '12 at 5:44
    
@Jasmine, I improved formatting a bit for you, so hopefully it can be better understood what your problem is. –  dzieciou Nov 3 '12 at 16:53

2 Answers 2

up vote 2 down vote accepted

This happens because FirefoxDriver does not support execution of Flex applications.

share|improve this answer

To test Flex applications you need to use a selenium flex testing framework. There are quite a few available such as FlexUI. You can find out about others at this SQA question: Further Detail On Flex Test Frameworks.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.