Drag and Drop using Java in Selenium Webdriver

แชร์
ฝัง
  • เผยแพร่เมื่อ 11 ก.พ. 2025
  • In Selenium, you can perform a #drag-and-drop action using the Actions class.
    dragAndDrop(WebElement source, WebElement target): This method performs left click, hold the click to hold the source element, moves to the location of the target element and then releases the mouse click.
    Let’s see how to use Action class methods to perform drag-drop action:
    First, instantiate an Actions class:
    Actions actions = new Actions(driver);
    As you can see, the dragAndDrop(WebElement source, WebElement target) method has two arguments to pass. One is a source web element and another is target web element. This source web element is any web element that needs to be dragged. Target web element is any web element on which dragged object needs to be placed or dropped.
    Website references:
    jqueryui.com/d...
    www.selenium.d...
    #framework #selenium #seleniumframework #draganddrop #actionsclass #extentreports
    #testng #testrunner #webdriver #actionsapiinselenium #log4j2

ความคิดเห็น • 4

  • @srbmtech
    @srbmtech 2 ปีที่แล้ว +2

    That's very useful, thanks for uploading this !

    • @sdetadda
      @sdetadda  2 ปีที่แล้ว

      You're welcome!

  • @JOKER-sp9mx
    @JOKER-sp9mx 2 ปีที่แล้ว +2

    Make a video on dataproviders and pagefactory

  • @testing24x7
    @testing24x7 ปีที่แล้ว +1

    👍🏼