Unable to identify the Xpath selector for the "Account settings button" and "find my iPhone" features within iCloud

When trying to access my iCloud account settings and locate the "Find my iPhone" button on iCloud.com, I am encountering issues with my selectors. It seems like there are no frames on the page, but the Xpaths I'm using are not matching.

Here are the steps I have taken:

  1. Sign in to my iCloud account
  2. Search for elements related to "Account settings" and "Find my" buttons

This is my current approach for finding the "Find" button:

WebElement settings=wait.until(ExpectedConditions.
elementToBeClickable
(By.xpath("//div[@class='user-name-with-chevron']")));
settings.click();

And this is what I'm doing to find the Account settings:

 WebElement settings = wait.until(ExpectedConditions.
 elementToBeClickable(By.xpath
 ("//div[@class='cw-button symbol-button link-button']")));
 settings.click(); 

I would appreciate any assistance as I am new to this and still learning. Apologies if my questions seem silly.

Link to the HTML page

Answer №1

It appears that you may have overlooked switching back to the default content after logging in. I tested the code below and it successfully worked for me:

driver.findElement(By.id("sign-in")).click();
driver.switchTo().defaultContent(); //switch back to default content 
driver.findElement(By.cssSelector("div.cw-button.symbol-button.link-button")).click(); //click on Account settings

By switching from the iframe to the default content, I was able to effectively locate any web element on the page. I hope this information proves helpful :)

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

Looking to have the image float after reducing the size of the windows in html?

For my webpage, I want an image to appear on the extreme left when the browser is maximized, but then move to the extreme right when the browser is minimized. I've tried using float, but it doesn't seem to be working. Any suggestions on how to ac ...

Creating a Rectangular Trapezoid Shape with CSS - Eliminating Unnecessary Spacing

I'm trying to create a trapezoid button using CSS. Here is the intended look: https://i.sstatic.net/0vqlk.png However, my current implementation looks like this: https://i.sstatic.net/QrR4t.png The button appears fine but there seems to be some e ...

What is the process of fetching an image from SQLite in Android Studio?

I have successfully stored 4 values, but I am only able to retrieve the Strings public class CafeteriaDB extends SQLiteOpenHelper { private static final String DATABASE_NAME = "cafeteria.db"; private static final int DATABASE_VERSION = 1; p ...

The z-index of the React Apex Chart toolbar menu icon is too high. Is there a way to decrease it?

Is there a way to adjust the z-index value of the icons within React Apexchart's toolbar menu? Even when I position my element at a higher level, they remain on top of it. ...

Attempting to ensure that the social media icons are perfectly centered in between the separators on the page

After adding new menu separators, the alignment of my social media icons has been thrown off and I need them to be centered. I'm not sure why this happened or how to fix it. I attempted to add some CSS but had no success. My website can be found at . ...

Background image spacing

Can anyone explain why there is extra space after my background image in this code snippet? (red line in image highlights the spacing issue) Even though the background image doesn't have this space, it seems to extend beyond where the black color ends ...

Learn how to apply inline styles to multiple objects within a single element using React

In my project using React, I am attempting to apply styles only to a specific element within another element. Here is an example with an h1 tag: const Header = () => { const firstName = "Ashraf"; const lastName = "Fathi"; const date = new Date() ...

What is the best way to transmit a JSON object to REST services using Angular?

Whenever I attempt to send the JSON object to REST services, I encounter an error that looks like this: http://localhost:8080/api/v1/cardLimit 400 (Bad Request); JSON Object Example: public class GameLimit implements Serializable { private stati ...

Troubleshooting the problem of fast rotation and scrolling of text in the middle but slow movement at the end with

Currently, I am utilizing the jquery animate function for animating text while also aiming to rotate the text if a specific degree is passed. In order to achieve this, I have implemented the following code snippet: var leftCss = "-"+$('#mydiv'). ...

Does text disappear when hovered over in CSS?

Having some trouble getting a text to display on hover over the parent container while adjusting the opacity. Despite trying multiple methods, it just won't show up no matter what I do! Here is my current code: .project{ position: relative; ...

Tips for preventing Google search from detecting Selenium WebDriver as suspicious activity

I am attempting to utilize the selenium webdriver to conduct an image search on Google without the need for manual browser navigation or URL pasting. However, Google has flagged my activity as suspicious with the following message: Our systems have dete ...

Designing a versatile pop-up window with jQuery or JavaScript that functions seamlessly across all web browsers

I've encountered an issue with my code where it displays a popup message correctly in Chrome, but when testing it on Firefox and Edge, it creates a strange box at the end of the page instead. Here is the code snippet I'm referring to: var iframe ...

When using Try-Catch, errors occurring in the "System.setProperty" method are not caught

While working with Selenium and Java to create a test, I included the following code snippet in order to troubleshoot any potential issues with the Chrome driver: try { System.setProperty("webdriver.chrome.driver", "Chrome Drivers ...

Even in the face of errors, Selenium with Node.js continues to run seamlessly. The challenge arises specifically with the 107.xx version of the Chrome browser and Chrome driver

Currently, I am employed in a project involving NODE JS (javascript) with selenium webdriver. Package.json- “chai”: “^4.3.6”, “chromedriver”: “^107.0.3”, “geckodriver”: “^3.2.0”, “mocha”: “^10.0.0”, “mochawesome”: “^7. ...

The hexadecimal code for the textured background color of an iOS Scroll View in CSS

Can someone share the specific CSS color code with me? I would like to apply this same color to my website. Appreciate it! ...

The spacing between elements in Flexbox is too excessive, creating an overly wide gap

How can I maintain a fixed 40 pixel gap between columns in flexbox without it increasing as the screen width widens? (I apologize for the brevity of this description, but there are no additional details to provide at this time) .browser-box { max-wid ...

Tips on assigning a reference to an element that has not been rendered yet

I've created a login page with a button labeled "Watch the video". When the button is clicked, it hides and reveals a video player. My goal now is to automatically start playing the video once it's displayed without requiring an extra play button ...

Obtain some content using Java along with Selenium WebDriver

I only want to extract the text "Invitation sent to xxxxx". I do not need the content inside the button tag. <button class="action" data-ember-action="" data-ember-action-3995="3995"> Visualizar profile </button> This is how I am c ...

Manipulate React class names by adding or removing them

Is there a way to toggle a className on click to change the style of a component? https://i.sstatic.net/z9FoA.png I need to rotate an arrow to the right when it's clicked and hide all components next to it using display: none;. I also require t ...

Overrule the child element selector using a class identifier

I'm facing an issue where the descendant selector is overriding my .red_p class. Is there a way to prevent this from happening without having to assign a class to each p element individually? HTML: <html> <head> <style> ...