Drag and Drop, drags but doesnt drop

Hello,

Im trying use Katalon Studio on Jira. Basically, I want to move a task from “In Progress” to “Concluded”.

I tried both approaches in this tutorial, It worked in Jquery and W3 studio practice exercises but when I tried to the same thing in Jira, Katalon Studio recorder, stops for a little, then stars the dragging, but it doesn’t move, and after some seconds he moves a little and drops in the same place.

I choosed the right division to drop ( used spy like in the exercises ).

Thanks in advance,
Miguel Tavares

why to do that from webUI approach?
Jira have a very decent API, using it you can do amazing stuff sometime not possible from web.
Are you hired by Atlassian to test this product?

see: https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issues/#api-rest-api-2-issue-issueidorkey-transitions-post

Hello,

I am learning to use Katalon and was trying to do that as an exercise to test Katalon functionalities. It is not related to Atlassian at all.

I will check the API approach, thanks.

Well … Jira may not be the best candidate to start learning Katalon, the UI is pretty complex.

Hello again,

I tested with the API approach successfully but I still need to do it with the Web approach.

Katalon does not move the “mouse” before trying to find the destination, and in Jira, the boxes that I want to Drop the object into, only appear after the user drags the object a little. Katalon does not find the xpath that I am giving, and tries other options, dragging and dropping in the wrong locations.

Is possible to drag the box using an offset (?) for example before doing the drag to the final destination ( and check for the final destination xpath after the drag with offset)? Or other solution for this issue?

Thanks in advance,

Miguel Tavares

Hi @miguel.tavares

Yes, it is possible to drag and drop to an offset by using:

WebUI.dragAndDropByOffset(testObject, xOffset, yOffset)

I do not currently have access to a Jira site, so I am not sure what the sites HTML looks like when it comes to the task and the columns.

In Azure Devops however which also has tasks you can drag and drop to different columns, I can click and drag a task to a different column, then check that tasks HTML elemenets for an attribute called aria-label which will contain the column name. Therefore I can do a check to see if the HTML attribute contains the columns name after the click and drag to offset

A website you can use for Katalon testing is https://demoqa.com/ it has a lot of things you can interact and test with such as drag and drop objects.

I noticed that, in Jira, if the mouse is released to soon, the issue will go back to the originating column.
In your case looks like it is not moving at all.

So, I suppose, it has something to do with the selector you are using for the target column, you may have to inspect carefully the html of the Jira dashboard and tune it manualy.

the spy tool only produce a ‘best guess’ but most of the time the result is not good enough

You can anytime subscribe for a free acount and create your own Jira + Confluence:

My wife did such and we use it for home activity planning :smiley: (bathroom renovation etc)

Hi

I know that Katalon DragAndDropToOffset , exists, but what I meant was a function that drags a little (with an offset) and then drops on a given element.

Hi

I already did that analysis.

Katalon starts the Drag, and stays in this state:

image
You can reproduce it, by clicking on the box and not moving the mouse. And Katalon tries to find the object that I said he should drop the box. But the problem is that the object does not exist in the HTML yet.

When you click on the object and you start dragging, Jira will generate the code with the drop options, and when you drop that code will disappear from the HTML. I am now trying to find out how this code is generated.

When you drag the box a little it will look like this
image

well, as usual, you do not show to us all.

looks like your action performs two transitions not one.

so the defect mai be into the workflow and the dashboard settings you made for that project, and have nothing to do with katalon himself.

good luck to debug it.

I have been trying to solve your problem by setting up a test environment in Jira and testing it myself. I understand what you are experiencing, but I can also not get the task to move to where I want it.

On other sites drag and drop to test object and offset works perfectly, but in Jira it just doesn’t want to move the task and it takes forever for katalon to find the test objects I want to interact with on Jira.

I suggest you do not use Jira as your site to test katalon studio with and move on from this issue. Jira was not meant for automation training.

1 Like

Jira is using a lot of scripts and customizations under the hood.
Happens that I am a Jira admin so I know what I am speaking about (at work. at home, the wife is the manager)
I used both, on-prem and cloud instances.
Altough the pages may apear having a simple and clear HTML structure when the user inspect it, once an action is performed lot of stuff hapens.

So, I also sugested, from the begining:

  • To perform automated actions on Jira, using the API is the best solution
    (depending on the needs, if custom workflows and automated rules are needed without using the API, then scriptrunner may help)
  • To learn Katalon, use something else (unless you are a brave and wanna learn it the hard way)
1 Like

From what I can see in the screenshot posted I can deduct some things.
I assume the project is using the most basic workflow (it’s a software type project I assume) where a certain issue type can be moved from any state to any other (available) state.
This is fine. This is the most Agile workflow Jira offer… and I love it, we encourage all of our teams to use it.

For the Epic issue type looks like at least two transitions are possible (from TO DO to IN PROGRESS or BLOCKED).
Which is abit odd from an Agile perspective … how an Epic can be blocked? An Epic is just a collector of the total team effort (Stories, Tasks, Bugs etc)…
So, it should have only three states, planning, on going and completed.

But nvm … moving forward … back to the topic.
Since the dashbord have a single target column, when moving the issue to this column the user has to decide into what state should be.

So, attempting to automate this, will somehow confuse the selenium ‘logic’ under the hood.
The HTML code of the dragged object is changing (most probably imediately after is clicked and moved 1 pixel) … so the selector used to locate it no longer matches :smiley:

In addition to that, the HTML code of the target column is also changing (note that when the transition is in progress, it gets highlighted, if you will have two columns for each transition possible you will notice both of them are in such state)

Good luck to solve it!

Looking a bit on how it behaves on the Jira instance I am using at work.
This is a certain card in a certain column, in “un-clicked” state:

Once I click it and attempt to move it a bit, some stuff changes:

So, everything depends on the original selector used, I guess.
From what I see in my case, two attributes are preserved, data-issue-id and data-issue-key.
Such are unique, since are comming directly from Jira DB which does not allow duplicates.

So, what may work:

  • locate the needed card by whatever selector you curently use
  • rettrieve one of those attributes
  • build a new test object using the retrieved attribute as selector
  • attempt to move it (by offset or by selector to target column)

Ofcourse, you should carefully inspect your dashboard, we use a heavily pimped one so the HTML may look completely different

In my dashboard I dont have that attributes, but thanks for your help :smiley:

Well, ofcourse.
My examples came from our production instance, which is a cloud one with an enterpise licence.
Yours may be different, so you can show to us how does it looks in your case with the hope we can find something relevant.

When I am not dragging a Story the html looks like this:

image

When I am dragging a Story the hmtl looks like this:

image

That seems to be the html code of the target column.
Please inspect the card (Story 1) as I did in my example.
First thing to solve is the locator for this one.

Side note, an Epic is not a Story, read my previous posts. An Epic can collect stories and other issue types.
So, for the sake of learning Agile methodologies properly, either use Epic1 Epic2 etc for your issues, or create Story issues if you preffer that name :smiley:
Of-course this has nothing to do with the testing you are trying to do, but common, take some time and read about Agile methodologies since you are learning Jira also.

Html for the story:

But Katalon already finds the storys , the problem is finding the place to drop

I created the Story “KT-56” inside of the Epic with the name “Test Epic Name” .
The symbol in KT-56 is for the Storys