Attempting to locate an element using Selenium IDE proves to be challenging unless each command is executed individually

Currently, I am utilizing selenium ide for automating my tests. Once I click on a link, a popup window appears with a div containing text. Strangely, I am unable to retrieve the text within the div tag without either double-clicking on it or executing the command individually. Various attempts have been made to address this issue but none of them have proved successful:

Waiting for up to 1 minute; Continuously waiting for the element to appear even after 1 minute has passed, but without success; Attempting to identify the popup window by its title, however, it is failing to acknowledge the window.

Interestingly, waitForPopup is functioning properly, yet the element within the popup remains elusive.

Below is a glimpse of my code

<tr>
<!-- This step is successful -->
    <td>waitForElementPresent</td>
    <td>//a[@id='linkTopopup']</td>
    <td></td>
</tr>
<tr>
<!-- This step is successful -->
    <td>pause</td>
    <td>1000</td>
    <td></td>
</tr>
<tr>
<!-- This step is successful -->
    <td>click</td>
    <td>//a[@id='linkTopopup']</td>
    <td></td>
</tr>
<tr>
<!-- This step is successful -->
    <td>waitForPopUp</td> 
    <td></td>
    <td>30000</td>
</tr>
<tr>
    <td>waitForElementPresent</td>
    <td>//div[@id='divHavingText']</td><!-- struggling to find the 
element here -->
    <td></td>
</tr>
<tr>
    <td>storeText</td>
    <td>//div[@id='divHavingText']</td><!-- struggling to find the element here -->
    <td>myText</td>
</tr>

<div id='divHavingText'>
    hi
</div>

Any insights into why the element cannot be found unless double-clicked and not when the entire test case is run automatically?

Answer №1

A better approach is to utilize the "waitForAlert" command to pause execution until an alert appears, rather than just simply waiting.

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

Incorporate a background image with the JavaScript CSS property

I'm having trouble adding a background image using the Javascript CSS property in my code. When I directly add the 'url', it works fine. Could the issue be with the 'weatherImage' variable? Javascript var OpenWeatherKey = ' ...

Is it possible to create a button that can bring in a .css file?

Is there a way to create a button that imports styles from a .css file, or is it possible to change multiple CSS properties with buttons to create different website themes? This is the CSS file I have: .body { background-image: url("example.png"); } ...

The functionality of classes containing <ul> elements is ineffective

Having recently embarked on the journey of learning html/css, I've encountered some confusion along the way. Allow me to showcase my basic web-page layout: <html> <head> <meta charset="utf-8"> <link rel = "stylesheet" type="text ...

Tips for creating a star program using Angular 2+

Create an Angular 2+ code snippet that will print asterisks (*) in a list on button click. When the button is clicked, it should add one more asterisk to the list each time. For example: Button Click 1 - Output: * Button Click 2 - Output: ** Button Cl ...

Integrate buttons for increasing and decreasing with the `<select>` element in HTML

Apologies for what may seem like a trivial question, but I am truly stuck. Despite searching extensively, I cannot find how to create a basic HTML tag with increase and decrease buttons aligned to the right. Your assistance would be greatly appreciated. Th ...

Encountering difficulties extracting audio from the webpage

Attempting to extract audio(under experience the sound) from 'https://www.akrapovic.com/en/car/product/16722/Ferrari/488-GTB-488-Spider/Slip-On-Line-Titanium?brandId=20&modelId=785&yearId=5447'. The code I have written is resulting in an ...

The iPhone display scaling issue is causing difficulty viewing the entire website

Currently experiencing difficulties with a page that lacks sufficient content, resulting in a smaller height. As a result, the iPhone is scaling the page and cutting off the full menu bar (960px wide). I attempted to set a minimum height using a media quer ...

Frame keyword is operational on Chrome but encountering issues on Firefox

Having trouble selecting frames on Firefox, although it's working fine on Chrome. The following error is being displayed: An Element with the locator '//iframe[@name='slideInFrame']' could not be found. Attempting to automate t ...

What is the best way to create a seamless change from a black to white invert filter?

I'm currently working on a project where I need to change my icons from black to white. After some research, I found that the best way to do this is by using filter: invert(100%). However, when I try to transition it, the change happens abruptly after ...

Encountering a "file or directory not found" error during the installation of ply using

I recently stumbled upon an interesting project for testing Rest APIs. I was in the process of installing ply from https://github.com/ply-ct/ply npm install ply-ct --save-dev Encountered this error, wondering if anyone has a solution npm WARN saveError EN ...

PHP and AJAX allow for seamless data retrieval without the need for page refreshing, and the data can be easily displayed in a modal window

I am currently encountering an issue with sending data to another page without refreshing. I am able to send the data as text, but for some reason, I am unable to send it as a modal. Why might this be happening? Here is an image of my current page https:/ ...

How to reveal hidden Div element at a specific index with Angular Material table

In my mat-table, there are several functionalities available: 1. The ability to add or remove rows 2. Adding data into a row using different controls such as combo-boxes, text boxes, etc. One of the controls is a text box labeled "Additional Information ...

I am struggling to remove the div from its normal flow as it stubbornly remains positioned below

Is there a way to add a "contact" card to my website's right-top corner in a sticky position? I currently have a div block in that area which is blocking the contact card. Can anyone suggest a solution for this? https://i.stack.imgur.com/umC7B.jpg &l ...

Is the phrase "This site was built with Wix" visible on the website?

Recently, I've begun using Wix to build a website. I'm curious - does the message 'This website is created using Wix' appear at the top and bottom of the page when it's published? 'This website is created using Wix' I ...

The process of retrieving CSS attributes from a control found by XPath using Selenium IDE

During my Selenium IDE script execution, I am looking to identify and handle an error state. This specific error state is visually highlighted on the page with a select control changing its background color to a light shade of red. The xpath for the selec ...

Leveraging ng-click and ng-hide/show directives within ng-repeat in Angular

I have a simple Single Page Website built with Angular. I utilized ng-repeat to generate content on the main page, where each item is an image. I am looking to create an alternate view for each image to display more details. I have implemented this feature ...

"Encountering a Javascript issue while trying to apply a CSS class to a

Encountering issues in Safari desktop / mobile and Internet Explorer. The error message states: In Safari: TypeError: Attempted to assign to readonly property. IE Edge: Assignment to read-only properties is not allowed in strict mode The problem arises ...

Position the div in the center with overflow properties

After returning to web design as a hobby, I've encountered some difficulties. I'm currently trying to center a div that contains other centered divs. However, when resizing the page, I want to ensure that the divs remain centered and their overfl ...

Unable to generate new entries with HTML Form

I've been working on creating a simple form with the ability to add new seasons or entries that will be posted to a database, but I've hit a roadblock. Whenever I try to run it, the "Add more Episodes" buttons for new seasons don't seem to w ...

Executing a PHP script to initiate a ping transmission

I have a project to complete for my university involving the development of a simple application. However, I lack experience in this area and am unsure how to proceed. The objective is straightforward: I want to send ping requests to 50 IP addresses at t ...