Using Selenium Webdriver to initiate the play function of a video by clicking on the control

Is there a way to play the video on this page by clicking the play button?

I noticed a 'playpause' control in the JavaScript, but I'm unsure how to activate it.

<div id="videoModal" class="reveal-modal expand open" style="display: block; opacity: 1; visibility: visible; top: 100px;">
<video id="wp_mep_1" width="709" height="540" preload="none" controls="controls" poster="http://prolifiq.com/wp-content/themes/prolifiq/img/bgr-video.png">
<source type="video/mp4" src="http://prolifiq.com/wp-content/themes/prolifiq/videos/Prolifiq-Invite.mp4"></source>
<source type="video/webm" src="http://prolifiq.com/wp-content/themes/prolifiq/videos/Prolifiq-Invite.webm"></source>
<object width="709" height="540" data="http://prolifiq.com/wp-content/plugins/media-element-html5-video-and-audio-player/mediaelement/flashmediaelement.swf" type="application/x-shockwave-flash">
</video>
<script type="text/javascript">
jQuery(document).ready(function($) {
$('#wp_mep_1').mediaelementplayer({
m:1
,features: ['playpause','current','progress','duration','volume','tracks','fullscreen']
});
});
</script>
<a class="close-reveal-modal">×</a>
</div>

To close the video, I use an XPath to click the "x" button at the top right corner of the player.

Here's the code snippet:

import java.util.List;
import java.util.regex.Pattern;
import java.util.concurrent.TimeUnit;

import org.junit.*;

// Other imports...

public class prolifictestscript {
  // Class implementation...
}

Answer №1

Implement Javascript for this task, it works efficiently with Flash player. For additional details on available tags, refer to HTML Audio/Video DOM Reference

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

There were multiple files discovered with a platform-agnostic path of 'META-INF/DEPENDENCIES'

I am encountering an issue with my Android project where I have added Selenium WebDriver. Upon building my app, I receive the following error message: More than one file was found with `OS` independent path `META-INF/DEPENDENCIES` The gradle file fo ...

Accessing the parent scope from a directive within a nested ng-repeat in AngularJs

Seeking guidance on accessing the parent scope within a directive nested in an ng-repeat. Here is an example: <div ng-app="myApp" ng-controller="myCtrl"> <div ng-repeat="section in sections"> {{section.Name}} <div ng-rep ...

The listener method seems to be triggered twice when executing test suites using testng.xml

I have implemented a Listener class to monitor the status of the method at the end whether it has passed or failed. Everything seems to be functioning correctly, but I am noticing that it is getting called twice after the execution of the Method. Below, I ...

Recording Audio Using ReactJS

I am exploring ways to record audio using ReactJS and save it on my Node server. Initially, I attempted to utilize the "react-audio-recorder" module but encountered issues when attempting to record multiple audios consecutively. Additionally, I experiment ...

What are the steps to incorporate ThreeJS' FontLoader in a Vue project?

I am encountering an issue while attempting to generate text in three.js using a font loader. Despite my efforts, I am facing difficulties in loading the font file. What could be causing this problem? const loader = new FontLoader(); loader.load( ' ...

How to fetch a file from a Spring Boot server using Angular 4

I'm currently developing a Spring Boot server with an Angular 4 front-end. I've created a service that allows users to download a .zip file from the front-end using HttpClient. Below is my code: Angular service: getZip(fileName: string) : Obser ...

The function will provide the value prior to the execution of the Jquery image loading

if (DataService.Validation(file)) { //angularjs call to api controller }; //DataService Validation: function (file) { var Url = URL.createObjectURL(file); var img = new Image(); $(img).load(function () { var imgwidth = this. ...

How to create a calendar selection input using PHP?

Before I start writing the code myself, I am searching to see if there is already a solution available or if someone has previously outsourced the code. Below is an example of my date selection: I want to create a feature where selecting a month will aut ...

When a function is called within a 'For' loop, it may result in a NameError

I've encountered an issue while attempting to call a function from within a FOR loop. The error message I receive is: test() NameError: name 'test' is not defined Below is the code in question: from selenium import webdriver from seleni ...

How can you make sure that mouse events pass through the KineticJS stage?

Is it possible to have a PanoJS3 component covering the entire screen with a KineticJS stage on top, but still allow touch events to pass through the KineticJS stage to what lies beneath? I want shapes on the stage or layer to receive the touch events, wh ...

Validate the checkbox with Vuelidate only when the specified property is set to true

I have a website login form where users may need to check a specific checkbox before logging in. Here is part of the Vue component code that handles this functionality: <script setup lang="ts"> import {ref, defineProps} from 'vue&a ...

jQuery click() function fires twice when dealing with dynamic elements

I am loading content from a database through ajax into a div and then when clicking on any of these content pieces, it should reload new content. The ajax request is initialized as a method within a class that I call at the beginning: function Request(ta ...

Collect data from the webpage by utilizing either selenium or beautifulsoup

I'm attempting to extract data from the following table on . I've made multiple attempts using XPath and BeautifulSoup, but so far have only been able to retrieve the first row or unstructured text. Here's an example of the code I've t ...

Unable to utilize Selenium in conjunction with a for loop

I'm facing an issue while writing a program that involves a for loop. It seems like I need to declare the Selenium webdriver before the loop, but every time I try to do so, I encounter an error. The loop doesn't seem to recognize the driver.get p ...

``When multiple elements are clicked, the second click will remove the class

I'm struggling with jQuery. Essentially, I want the first click on "div 1" to add a class to the others and display "lorem ipsum" text, and continue this pattern for the rest. However, if I click on the same div again, the class should be removed and ...

GraphQL Error (Status Code: 429) - Next.js Development issue

If you're facing a GraphQL Error (Code: 429) while working on a nextjs project, here's a handy solution. Here's what happened: I created a headless CMS using Hygraph and NextJS 13 for a blog project. I also utilized the npm package graphql ...

The Strong Password checker fails to identify the presence of a forward slash

Here is a regex I have for validating a strong password: /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d!$\/%@]{6,20}$/ Criteria: Alphanumeric with special characters $/%@ At least 1 number At least 1 lowercase letter At least ...

What is the most effective way to toggle the visibility of div elements using jQuery?

I am currently working on a small project centered around interviewing people using short GIF animations. I want the viewers to have 10 seconds to watch the GIF, but I've noticed that the timer is not accurate in my code. After some research, I came ...

What could be causing my JavaScript code to not function properly in an HTML document?

Hello, I am a beginner in the world of coding and currently delving into web development. Recently, I was following a tutorial on creating a hamburger menu but I seem to be encountering some issues with the JavaScript code. I have double-checked my Visual ...

Go back to the previous operation

Utilizing ajax to verify if a username is available by checking the MySQL database. If the username is already taken, it will return false to the form submit function. index.php $("#register-form").submit(function(){ var un = $("#un").val(); $.aj ...