Selenium successfully tests Foundation modals, however, it encounters issues when trying to do so

While experimenting with :webkit, I encountered an issue where testing for the existence of my Foundation modal was not possible. However, everything seemed to be working correctly when using :selenium. What could be causing this discrepancy?

it "should open modal" do
  current_path.should eq(root_path)
  page.should have_selector("#modal") # This fails in webkit, works in selenium

My environment includes Capybara 2.4.1 and capybara-webkit 1.3.0.

Answer №1

Please include the following code snippet in your test document. You will require a JavaScript function to trigger the modal's opening since there seems to be an issue preventing it from displaying automatically.

Execute this script on your page: $('#modal').foundation('reveal', 'open');

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

Using Selenium to interact with drop-down lists using div tags instead of select tags

As a newcomer to automated testing using Selenium Web Driver, I am struggling to test drop down lists for the location type without relying on the select command. The element in question is enclosed within a div tag. I attempted sending keys but that meth ...

WebDriverManager unable to connect with PhantomJSDriver

I am facing an issue with using WebDriverManager. I want to use PhantomJSDriver without manually setting a system property like this: System.setProperty("phantomjs.binary.path", "E:/phantomjs-2.1.1-windows/bin/phantomjs.exe"); In my pom.xml, I have these ...

Error: The 'chromedriver' executable must be located in the PATH directory

Currently, I am utilizing OS X El Capitan along with Eclipse (Neo) and Python. I have written some Selenium scripts in Python. Initially, these scripts were functioning properly. However, after upgrading from OSX Sierra to El Capitan, Please note: thi ...

Encountering an error message stating that the element is unclickable at coordinates (355, 160

My script is encountering an issue due to the following exception: org.openqa.selenium.WebDriverException: unknown error: Element is not clickable at point (355, 160) During page loading, if the element appears in the background, Selenium attempts to ...

Retrieve the value from a specific div among several divs with identical names

I am searching for the TTM EPS value and I need to extract it from this link Below is the code that I have written so far: import os from webdriver_manager.chrome import ChromeDriverManager import time from selenium import webdriver from selenium.webdrive ...

Determining when the scroll bar has reached the end using Selenium in Python

I'm working on implementing a while loop in Selenium, and I want to set a condition for the loop to stop when the scroll bar reaches the end of the page. How would I go about coding this type of condition within the while loop? Right now, my loop is s ...

Obtaining the text content of a <div> element when clicked using Selenium

I am trying to extract the email address from the code snippet below, but I am unsure of how to do it. Any assistance would be greatly appreciated! <div class="taLnk hvrIE6 fl" onclick="ta.trackEventOnPage('Listing', 'Email', 774169 ...

Unable to launch selenium.WebDriver in Firefox using Java when running in a headless environment

Here is an example code snippet I'm working with: import org.openqa.selenium.WebDriver; import org.openqa.selenium.firefox.FirefoxDriver; class Gecko { ... FirefoxBinary ffB = new FirefoxBinary(); ffB.setEnvironmentProperty("DISPLAY", ":10"); ... ...

What is the best way to locate and interact with recurring elements in Selenium that are nested within the <button> tag?

There are two buttons on different pages, named BEREKEN and VERTEL. The first part of the code is functioning correctly. I am able to access and click the button. However, the second part of the code is not working as expected and I am unsure why. Part 1: ...

Uncovering content across multiple pages using BeautifulSoup for web scraping

Currently, I am working on a project for one of my courses that involves web scraping data from Bodybuilding.com. My main objective is to collect information regarding the members of the website. Initially, I was able to successfully scrape data from the 1 ...

A guide on retrieving information from a table using Selenium in Python

I'm currently working on a project where I need to extract data from a table on a website that spans multiple pages. I'm struggling with understanding how to retrieve all the rows and columns from the table using Python and Selenium. Here's ...

Unable to generate a fresh database entry through form submission

I have designed User and Pairings models as shown below: class User < ActiveRecord::Base enum role: [:student, :supervisor, :admin] has_many :students, class_name: "User", foreign_key: "supervisor_id" belongs_to :supervisor, ...

Unable to find the element within an iframe using Selenium while searching for a dictionary definition

Just starting out with Selenium and trying to automate filling out a web form to retrieve results as a Python dictionary. Here's what I have so far: from selenium.webdriver.common.keys import Keys from time import sleep driver = webdriver.Chrome() dr ...

Issue with Katalon Studio on Mac: It is unable to click a button and instead tries to click the HTML parent tag

In my Katalon Studio script, I have a button click command that uses scrollIntoView to bring the button into view before clicking it. ((JavascriptExecutor) functiondriver).executeScript("arguments[0].scrollIntoView({block: \"nearest\"});", butto ...

Selenium is not able to retrieve the most recent AJAX content

Looking to extract table data from the following website: "". While using Chrome browser's Inspect Element feature, I can view the table entries in the DOMTree as shown on the webpage. However, upon executing the provided code, a different table is re ...

What is the best way to extract data from various webpages connected to a single source using selenium?

Lately, I've been working on extracting a large amount of pricing data from a website by starting with one page that contains links to each item's individual page. My goal was to automate the process using a script that would click on a specific ...

Automation tool encountering difficulty in selecting pagination button on website

I'm having trouble using selenium and geckodriver with Firefox to scrape eBay while running on Ubuntu 16.04. All I want to do is click the next button, but my code doesn't seem to be working correctly. The two instances of button assignment I tr ...

Is it possible to verify if the input data in a login form text box is alphanumeric with Selenium Webdriver?

After transitioning from Selenium RC to Web Driver, I have been tasked with testing a registration form that includes a "login" field. My objective is to validate the form based on two specific criteria: Ensure that the name entered in the Login field ...

Finding checkboxes that have the "checked" attribute: a simple guide

I'm working with a list of checkboxes and trying to identify the ones that have the "checked" attribute. Here's an example of what my checkbox element looks like: <input type="checkbox" class="u-display--inline-block u-margin-right--small" ch ...

Assigning a value to a text field in Selenium results in an error message stating that the element cannot be found: NoSuchElementException - "Unable to locate element

I am diving into the world of Web scraping and Python for the first time. My task involves setting the value in a text box named "rcdate" on a specific URL using Selenium, and then extracting the filtered values. When trying to run this code snippet, an ex ...