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

Example with-page-object of Google failed due to some changes in website #4106

Closed
uditrajput03 opened this issue Mar 8, 2024 · 5 comments · Fixed by nightwatchjs/nightwatch-setup-tools#9 or #4118
Assignees

Comments

@uditrajput03
Copy link
Contributor

Description of the bug/issue

image

Example located in .\nightwatch\examples\with-page-objects\google.js failes due to certain change in selector of google.no menu.

selector: '#hdtb-msb' not found on the searchResult page.
Also elements in nightwatch\page-objects\google\searchResults.js also needed to be changed as @class also changed in menuXpath

const menuXpath = '//div[contains(@class, "hdtb-mitem")][contains(., "%s")]';

Steps to reproduce

Run following command to reproduce

npx nightwatch .\nightwatch\examples\with-page-objects\google.js

Sample test

No response

Command to run

npx nightwatch .\nightwatch\examples\with-page-objects\google.js

Verbose Output

No response

Nightwatch Configuration

No response

Nightwatch.js Version

3.4.1

Node Version

No response

Browser

No response

Operating System

No response

Additional Information

This maybe fixed by locating the menu by role="navigation" in xpath.
Fix should be in consideration to replicate the usecase of that particular example

@uditrajput03
Copy link
Contributor Author

uditrajput03 commented Mar 8, 2024

@garg3133 Fixed it but unable to find that example file that is initiated with npm init nightwatch
image

@dikwickley
Copy link
Contributor

hey @uditrajput03 i think the files are present here: https://github.com/nightwatchjs/create-nightwatch

@uditrajput03
Copy link
Contributor Author

hey @uditrajput03 i think the files are present here: https://github.com/nightwatchjs/create-nightwatch

I have searched it , It's actually here nightwatchjs/nightwatch-setup-tools
Also create PR resolves nightwatchjs/nightwatch-setup-tools#9

@garg3133
Copy link
Member

This needs to be fixed in this repository as well, so re-opening this.

@garg3133 garg3133 reopened this Mar 11, 2024
@uditrajput03
Copy link
Contributor Author

This needs to be fixed in this repository as well, so re-opening this.

Consent page has been removed from google homePage that is used in examples/tests/googlePageObject.js (due to which also issue in this example examples/tests/google.js)
I have modified file for googlePageObject.js example as of nightwatchjs/nightwatch-setup-tools.
Also modified some lines which are relate to consent element to make it work
Submitting an PR related to it. Unsure about google Consent page waiting for your review to move forward.
reference:
examples/tests/googlePageObject.js
examples/tests/google.js
examples/pages/google/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants