Katalon loses vital code switching to/from Manual View (was Katalon issue Javascript)

Thanks for the heads up @Russ_Thomas
I’ll make sure it gets some eyes

1 Like

This is just one of many issues caused by switching between the views. The bug has always been there. My guess is, it’s not easy to recover from the switch TO manual and then BACK to Script (in manual view, code needs to be parsed and “conditioned” for the view template).

In which case, at the very least, a WARNING should popup:

This script contains formatted script code which may not be compatible with Manual View and will need to be removed. Do you wish to continue?
(Choose CANCEL to keep your original code in Script View)

@mike.verinder

1 Like

+1 Warning message could have been present

1 Like

no + vote from me. The warning message will be easily ignored.

It might be an excuse: “I warned you not to, but you did it”.

But it wont help people who haven’t experienced this symptom.

Experience only helps.

In Katalon Studio, Don’t switch from Script mode to Manual mode.

Or, they should be aware that their own code formatting won’t be respected by the Manual mode.

1 Like

Thanks, but sometimes it’s easier to add manual steps, and this issue should ideally be handled by Katalon itself. It’s not feasible to completely avoid using the manual view, as there are certain scenarios where using manual view is faster.

anyway thanks for your help :+1:

1 Like

OK. If you are going to use the Manual mode, then you should accept that your own code formatting in the Script mode will be no longer preserved.

If you can accept it, that’s fine. The code will stay syntactically valid and will work anyway.

1 Like

Well, I somehow agree with … but.
This feature (manual view) it is mostly for new users with almost zero coding experience.
Looks like you are a bit more experienced, since you are already at the level when you write some custom code … but a bit lazy (like me).
So, you should be already familiar with typing, e.g WS. and use the intellicence provided by the eclipse engine. Using Manual View from time to time will only confuse you.

On the other side, yeah, this bug is valid and it is there since centuries.
It was reported many times in many ways.
Switching from one view to the other should not alter the existing code.
But I doubt it is an easy fix for it.

1 Like

Mhm…
well, i propose another option.
Since the katalon ‘engine’ detects this somehow and do some action, instead of rising a warning it should notify the user ‘cannot parse this code block properly’ and give the user the choice between keeping the code block or re-format

1 Like

I don’t think that they can implement this.

1 Like

Neither I, but let’s see if the development team pick-up the challenge.
Impossible is nothing!
I have some ideas how this can be achieved but let them ask, or do a brainstorm

1 Like

Let me reword this.

I don’t think that they would challenge this.

I think so because of a cost & benefit consideration. It’s just a bit of uglification. The reformatted code works without error.

1 Like

Hi @Elly_Tran,

Could you submit a bug report ticket to our Product team about @tahirieljalil’s issue? Thanks em.

2 Likes

I personally do not mind this issue much because I never use the Manual mode.

I always import many external libraries other than com.kms.katalon.core.*. The Manual mode is not designed to present those “non Katalon-native” code properly. Let me show you an example how my sample test case is displayed in Manual mode.

A long sequence of Binary Statement and Method Call Statement which intentionally hides the data type declarations of variables (String, float, BufferedImage). This presentation make me very frustrated. I would say that Manual mode with non Katalon-native factors is ugly.

The same test case in Script mode is presented like this:

import java.awt.image.BufferedImage

import javax.imageio.ImageIO

import org.openqa.selenium.By
import org.openqa.selenium.WebDriver

import com.kazurayam.ashotwrapper.AShotWrapper
import com.kms.katalon.core.webui.driver.DriverFactory
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI

WebUI.openBrowser('')
WebUI.setViewPortSize(1000,1000)
WebUI.navigateToUrl('https://forum.katalon.com/')

WebDriver driver = DriverFactory.getWebDriver()
String xpath = "//div[@id='list-area']"

float dpr = AShotWrapper.DevicePixelRatioResolver.resolveDPR(driver)
AShotWrapper.Options options = new AShotWrapper.Options.Builder().devicePixelRatio(dpr).build()

BufferedImage image = AShotWrapper.takeElementImage(driver, By.xpath(xpath), options)
assert image != null

File file = new File("./element_screenshot.png")
ImageIO.write(image, "PNG", file)

driver.quit()

I feel relieved by the source code presented as text.

Thus I don’t use Manual mode. So I am free from the original problem (Katalon loses vital code switching to/from Manual View).

1 Like

Which is the point of the message/alert.

Huh? It’s simple, to the point advice. :roll_eyes:

1 Like

To be totally free, simple dont use katalon.
So i don’t see your point here.
We help somehow the development team with how to improve it, or we create a library with workarounds?

1 Like

Hi @tahirieljalil ,

Please help provide your device information and Katalon version, so that I can create the ticket to investigate this issue. And are you a paid user? Thank you!

Hi,

I would like to update the news on this issue that our Product team has not supported this case now yet. If multiple other users raise the same concern with you, I will then raise the feature request for it. Thank you!

1 Like

I gathered.

Are you not reading the entire thread? Why would a future request have any more effect than the numerous reports going back ~6 years?

This bug is…

          (a fossil)

Hey Elly
A feature request that may get approved
(probably low on the backlog list).
Would be a pop-up message of some sort informing the user.

1 Like