Why Global Variable return value as null?

I create new profile then add several variables there(not on default profile), but when i call the variable for setText it will error because global variable return null value, this is my code

WebUI.setText(findTestObject(‘Register/Register Email/email_email_address’), GlobalVariable.Email)

is there anything wrong with my code ?

You need to use this profile by selecting it from the top right profile drop down, otherwise, these values will be NULL upon executed.

Vinh Nguyen said:

Do you switch to use this new profile?

:frowning: i don’t know about that, always use default profile before
how to switch the profile ?

Vinh Nguyen said:

You need to use this profile by selecting it from the top right profile drop down, otherwise, these values will be NULL upon executed.

can we switch it in code ? because i need to use many profile, calling many testcase

1. You can’t switch the profile directly in code.
2. To switch to a profile manually, please select it from this list

Screenshot at May 08 13-37-15.png

1 Like

Vinh Nguyen said:

1. You can’t switch the profile directly in code.
2. To switch to a profile manually, please select it from this list

okay thank you, i will use default profile then

I am facing the Global Variable returning Value as Null
I have created a new profile named as “Demo”


Though I use the profile “DEMO” while executing the script
I am facing below error
[ERROR] - Test Cases/TC02_HotelBooking_E2E_InputDataFromExcel FAILED because (of) java.lang.NullPointerException: Cannot execute null+{HotelURL=Adactin.com - Hotel Reservation System, Screenshotpath=C:\Katalon Studio\AdactinDemo\, Username=xxxx, UserPwd=xxxxx}

My script worked fine till 5.5 version of KatalonStudio, I am facing this issue on 5.6.3 Katalon Studio

Error message.PNG