ShaftHQ / SHAFT_ENGINE

SHAFT is a unified test automation engine for web, mobile, API, CLI, database, and desktop e2e testing. Powered by best-in-class frameworks, SHAFT provides a wizard-like syntax to drive your automation efficiently, maximize your ROI, and minimize your learning curve with no limitations! Stop reinventing the wheel! Upgrade now!
https://shafthq.github.io/
MIT License
330 stars 127 forks source link

[Bug]: Drag-and-Drop Fails on Subsequent Actions with NoSuchElementException After Initial Success" #1750

Closed Hussam16 closed 2 weeks ago

Hussam16 commented 3 weeks ago

Title: SHAFT Engine: Drag-and-Drop Fails on Subsequent Actions with NoSuchElementException After Initial Success

Description
I’m encountering an issue while performing multiple drag-and-drop actions using the SHAFT engine. The first drag-and-drop action executes successfully, but subsequent actions fail. Upon reviewing the console, I observed the following exception:

[INFO] java.lang.AssertionError: Failed to drag and drop against "AppiumBy.accessibilityId: drag-l2". Root cause: "org.openqa.selenium.NoSuchElementException: An element could not be located on the page using the given search parameters."  

It is confusing since the first action completes as expected, but the others fail immediately.

Code Snippet

driver.touch().tap(AppiumBy.accessibilityId("Drag"));  
driver.element()  
    .dragAndDrop(AppiumBy.accessibilityId("drag-l2"), AppiumBy.accessibilityId("drop-l2"))  
    .dragAndDrop(AppiumBy.accessibilityId("drag-r3"), AppiumBy.accessibilityId("drop-r3"))  
    .dragAndDrop(AppiumBy.accessibilityId("drag-c3"), AppiumBy.accessibilityId("drop-c3"))  
    .dragAndDrop(AppiumBy.accessibilityId("drag-r1"), AppiumBy.accessibilityId("drop-r1"));  

Link to SHAFT_Engine Console Logs
Console Logs

Link to SHAFT_Engine Allure Report
Allure Report

Environment

Steps to Reproduce

  1. Launch the app and initiate a drag-and-drop action.
  2. Execute multiple drag-and-drop actions in a sequence.
  3. Observe that only the first action succeeds, and the others fail with a NoSuchElementException.

Attachment
Steps to reproduce (GitHub link)


This should help in logging your defect clearly for others to understand and reproduce the issue.