Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Bookmark Functionality #312

Open
ben-c-at-moz opened this issue Oct 16, 2024 · 6 comments · May be fixed by #327
Open

Add Bookmark Functionality #312

ben-c-at-moz opened this issue Oct 16, 2024 · 6 comments · May be fixed by #327

Comments

@ben-c-at-moz
Copy link
Collaborator

Add functionality to NavBar (and elsewhere) to set, unset, and retrieve bookmarks.

Refer to https://github.com/mozilla/fx-desktop-qa-automation/blob/main/modules/browser_object_navigation.py for ideas on what needs to be built and how to do it.

Add tests that exercise all methods. Make sure they run in make test and in CI.

Make sure the existing tests also pass using make test and in CI.

@khabdrick
Copy link

Hello there, can I take this up?

@b4handjr
Copy link
Contributor

Hello there, can I take this up?

Please do

@khabdrick
Copy link

Message: Unable to locate element: [id="popup-notification-primary-button"]; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception.

I am getting the above error from the code below:

    @property
    def add_bookmark(self):
        """Adds a bookmark for the current page."""
        with self.selenium.context(self.selenium.CONTEXT_CHROME):
            bookmark_button = self.root.find_element(*self._bookmark_button_locator)
            # if not self.is_bookmarked:
            bookmark_button.click()  # Click to add bookmark
            self.root.find_element(
                By.ID, "popup-notification-primary-button"
            ).click()
            self.root.find_anonymous_element_by_attribute("anonid", "button")
            print("Page is already bookmarked.")

The work is a bit of a trial and error for me, so I want to know if it is possible to get a list of the elements I can access on the browser?

@khabdrick
Copy link

Like when I click the star button, there will be a popup and I want to click done there.

@b4handjr
Copy link
Contributor

As it says, the element can't be found. I would check your CSS selector. What is self.root and can #popup-notification-primary-button be found from it? If not you can get another element to use as the root element to start your search.

@Temidayo32
Copy link
Contributor

@b4handjr I will commence working on this first

@Temidayo32 Temidayo32 linked a pull request Dec 13, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants