Showing results for 
Search instead for 
Did you mean: 

Problem with Set Element, Custom Script and split() using a VDI environment

0 Kudos

I'm developing an automation to check the expiration date in a PI/PO production environment, but when I try to set an element, it gets stuck in this action after executing it. So I tried to perform these steps through the custom script and managed to get around the situation, but after the custom script has been executed with just the set element command ($.application.screens.capture.elements.elementName.set("...")), it simply ignores any command other than a custom script after the custom script runs. So I'm trying to solve everything through the custom script, but when I try to use split(" ") on the element obtained through get element ($.application.screens.capture.elements.elementName.get().split(" ")), it returns an error informed that split() is not a function. I need to use the content of this element to make a few validations.

Can you please help me to understand what is going on?

These are some observations from the tests that I already have made:

1 - The application has been tested manually and all the elements are working. The problems only appear in the automation.

2 - All the screens are with mainframe set to true;

3 - Wait Screen does not have made difference for the problem with de set element;

4 - The get() function returns the element that I need;

5 - split() function is not working with the string that I get from the get() function;

6 - split() function works with any other variable created by me on the custom script.

Example: let text = "Sun Mar 07 05:30:15 BRT 2025";

textArray = text.split(" ");

textArray -> ["Sun", "Mar", "07", "05:30:15", "BRT", "2025"];





Accepted Solutions (0)

Answers (0)