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

[Bug]: click/tap method is not working in release 8.4.20241024 #1838

Open
mabouamer-93 opened this issue Jan 6, 2025 · 3 comments
Open

[Bug]: click/tap method is not working in release 8.4.20241024 #1838

mabouamer-93 opened this issue Jan 6, 2025 · 3 comments
Assignees
Labels
bug Something isn't working good first issue Good for newcomers java Pull requests that update Java code

Comments

@mabouamer-93
Copy link

Describe the bug

click/tap method is not working and throwing Method is not implemented error

Link to SHAFT_Engine Console logs

https://gist.github.com/mabouamer-93/a0ca86158702d6b0d9351a46d6dc051e

Environment

  1. SHAFT_Engine version that exhibits the issue (8.4.20241024):
  2. Last SHAFT_Engine version that did not exhibit the issue (8.3.20240829):
  3. Desktop OS: [Mac OS 15.2]
  4. Mobile Device Name [iPhone 15 Pro Max]
  5. Mobile Device OS [iOS 18.2]

To Reproduce

Steps to reproduce the behavior:

  1. driver.element().click() OR driver.touch().tap()

Expected behavior

driver clicked/taped on the element

@mabouamer-93 mabouamer-93 added bug Something isn't working triage needs to be looked at labels Jan 6, 2025
@MohabMohie
Copy link
Contributor

Attached logs show that SHAFT's forced scrolling using JavaScript is breaking click and tap actions against non-w3c-compliant appium scripts.

SHAFT should disable automated scrolling in case of non-web executions.

@MohabMohie MohabMohie added good first issue Good for newcomers java Pull requests that update Java code and removed triage needs to be looked at labels Feb 2, 2025
@MohabMohie
Copy link
Contributor

Further investigation shows that the user is configuring shaft for fullpage screenshots (which is the default configuration). This is why scrolling is called and why it fails.

The root cause behind it is that SHAFT is trying to get the element name (per default configuration) using the text attribute which should be replaced by the name attribute in case of appium execution.

Shaft should force regular screenshots instead of full page screenshots in case of appium execution.

Shaft should call the name attribute in case of appium execution.

@MohabMohie
Copy link
Contributor

First fix implemented. Shaft will now call the "name" attribute for appium elements and the "text" attribute for web elements.

Second fix seems to be already in place. Shaft will override screenshot type with VIEWPORT to prevent taking a fullpage screenshot on mobile devices. Further investigation is needed on a newer SHAFT release.

private static void overrideScreenShotTypeForMobileAndMacPlatforms() {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers java Pull requests that update Java code
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants