groovy.lang.MissingPropertyException

system.out.printLn(...
1 Like

Just to be cautious.

The correct syntax is:

System.out.println("Your text here !");

Regards !

Hi Team,

I am also getting a same issue when trying to acces an radio button , i tried many ways but getting below issue please help
Reason:
groovy.lang.MissingPropertyException: No such property: checked for class: Script1587984141192
at Emms-1230-brandfilterissue.run(Emms-1230-brandfilterissue:54)
at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:337)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:328)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:307)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:299)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:233)
at com.kms.katalon.core.main.TestSuiteExecutor.accessTestCaseMainPhase(TestSuiteExecutor.java:169)
at com.kms.katalon.core.main.TestSuiteExecutor.accessTestSuiteMainPhase(TestSuiteExecutor.java:142)
at com.kms.katalon.core.main.TestSuiteExecutor.execute(TestSuiteExecutor.java:91)
at com.kms.katalon.core.main.TestCaseMain.startTestSuite(TestCaseMain.java:157)
at com.kms.katalon.core.main.TestCaseMain$startTestSuite$0.call(Unknown Source)
at TempTestSuite1588068187447.run(TempTestSuite1588068187447.groovy:36)
My code :-1:

import static com.kms.katalon.core.checkpoint.CheckpointFactory.findCheckpoint
import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase
import static com.kms.katalon.core.testdata.TestDataFactory.findTestData
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import static com.kms.katalon.core.testobject.ObjectRepository.findWindowsObject
import com.kms.katalon.core.checkpoint.Checkpoint as Checkpoint
import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile
import com.kms.katalon.core.model.FailureHandling as FailureHandling
import com.kms.katalon.core.testcase.TestCase as TestCase
import com.kms.katalon.core.testdata.TestData as TestData
import com.kms.katalon.core.testobject.TestObject as TestObject
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS
import com.kms.katalon.core.webui.driver.DriverFactory
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
import com.kms.katalon.core.windows.keyword.WindowsBuiltinKeywords as Windows
import internal.GlobalVariable as GlobalVariable
import plp.Resources
import org.openqa.selenium.WebDriver
import org.openqa.selenium.TimeoutException;
import org.openqa.selenium.WebDriver.Timeouts;
import org.testng.Assert
import org.openqa.selenium.WebElement as WebElement
import com.kms.katalon.core.webui.common.WebUiCommonHelper as WebUiCommonHelper
import org.openqa.selenium.Keys as Keys

WebDriver driver=DriverFactory.getWebDriver();

Resources.clickonMobilecategory()
Thread.sleep(2000)

WebUI.click(findTestObject(‘Object Repository/PLPpage/Mobiles_color’))
Thread.sleep(2000)

WebUI.click(findTestObject(‘Object Repository/PLPpage/mobiles_brand_apple’))
Thread.sleep(2000)

//WebUI.click(findTestObject(‘Object Repository/PLPpage/radiobutton_high-to-low’))
//WebUI.waitForElementNotPresent(findTestObject(“Object Repository/PLPpage/radiobutton_high-to-low”), 5)
//Thread.sleep(2000)

//Thread.sleep(2000)

//boolean visible= WebUI.verifyElementVisible(findTestObject(‘Object Repository/PLPpage/radiobutton_high-to-low’))
//println(visible)
WebUI.waitForElementClickable(findTestObject(‘Object Repository/PLPpage/radiobutton_high-to-low’),30)
boolean click=WebUI.verifyElementClickable(findTestObject(‘Object Repository/PLPpage/radiobutton_high-to-low’));
println(click)

//WebElement element = WebUiCommonHelper.findWebElement(findTestObject(‘Object Repository/PLPpage/radiobutton_high-to-low’),30)
//WebUI.executeJavaScript(“arguments[0].click”, Arrays.asList(element))

println(checked)

WebUI.click(findTestObject(“Object Repository/PLPpage/radiobutton_high-to-low”));

object Xpath :- //ul[@class=‘items grayCheck’]/li[2]
URL:- https://www.emi.in/mobile-phones

What is Emms-1230-brandfilterissue? Is it your test case? Could you share the code?

The message is saying that something named checked is missing. Any typo?

@kazurayam
I got the same issue:
Reason:
groovy.lang.MissingPropertyException: No such property: get for class: Script1606987724779
at test1.run(test1:60)
at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:393)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:384)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:363)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:355)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:251)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:114)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:105)
at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)
at TempTestCase1606987823860.run(TempTestCase1606987823860.groovy:25)
.

I use a keyword for input email with timestamp and then I want to verifiy if that specific email is added with a get method like:

WebUI.verifyElementText(findTestObject(‘Object Repository/Page_Sales Funnel - TexasLending.com/input_Email Address_email’), get.class(email))

I tryed like:
WebUI.verifyElementText(findTestObject(‘Object Repository/Page_Sales Funnel - TexasLending.com/input_Email Address_email’), email.get(0))

Same error.

but for me Test1 is the name for my testcase.

@costea.georgian89

It is not recommended to append questions to years-old posts. You should make a new Post for your case.

I need more information about your case. Please have a look at the following guidance.

When you copy&paste code fragments in the post, please use triple back ticks to make CODE BLOCK, like
スクリーンショット 2020-11-30 11.00.05

@kazurayam
Oki Doki thank your answers and sorry.
I post here because was like my problem and I want thinking here will be more visible, I already made a post for 1 week and no answers and I need to resolve this error soon as possible.

My code

import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase
import static com.kms.katalon.core.testdata.TestDataFactory.findTestData
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import static com.kms.katalon.core.testobject.ObjectRepository.findWindowsObject
import com.kms.katalon.core.checkpoint.Checkpoint as Checkpoint
import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile
import com.kms.katalon.core.model.FailureHandling as FailureHandling
import com.kms.katalon.core.testcase.TestCase as TestCase
import com.kms.katalon.core.testdata.TestData as TestData
import com.kms.katalon.core.testobject.TestObject as TestObject
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
import com.kms.katalon.core.windows.keyword.WindowsBuiltinKeywords as Windows
import internal.GlobalVariable as GlobalVariable
import org.openqa.selenium.Keys as Keys

WebUI.openBrowser('')

WebUI.navigateToUrl('https://www.texaslending.com/')

WebUI.click(findTestObject('Object Repository/Page_TexasLending.com - When you think of m_ec7bcf/img_Simplify your search. Select your loan._410ce5'))

WebUI.delay(2)

WebUI.click(findTestObject('Object Repository/Page_Refinance Home  Current Mortgage Rates_4ab5ec/img_Blog_do-not-smush'))

WebUI.delay(2)

WebUI.setText(findTestObject('Object Repository/Page_Sales Funnel - TexasLending.com/input_What is your current loan balance_fie_eccf68'),
	'653')

WebUI.click(findTestObject('Object Repository/Page_Sales Funnel - TexasLending.com/img_What is your current loan balance_vc_si_5c602b'))

WebUI.delay(2)

WebUI.click(findTestObject('Object Repository/Page_Sales Funnel - TexasLending.com/div_We currently do not loan in this area'))

WebUI.delay(2)

WebUI.delay(2)

WebUI.setText(findTestObject('Object Repository/Page_Sales Funnel - TexasLending.com/input_Zipcode_zip'), '75065')

WebUI.delay(2)

WebUI.click(findTestObject('Object Repository/Page_Sales Funnel - TexasLending.com/img_We currently do not loan in this area.__d583fb'))

WebUI.delay(2)

WebUI.click(findTestObject('Object Repository/Page_Sales Funnel - TexasLending.com/img_How did you hear about us_vc_single_ima_7c4a04'))

WebUI.setText(findTestObject('Object Repository/Page_Sales Funnel - TexasLending.com/input_First Name_fname'), 'test')

WebUI.setText(findTestObject('Object Repository/Page_Sales Funnel - TexasLending.com/input_Last Name_lname'), 'test')

WebUI.setText(findTestObject('Object Repository/Page_Sales Funnel - TexasLending.com/input_Email Address_email'), CustomKeywords.'email.email.populateEmail'())

WebUI.verifyElementText(findTestObject('Object Repository/Page_Sales Funnel - TexasLending.com/input_Email Address_email'),	populateEmail.get(0))


WebUI.click(findTestObject('Object Repository/Page_Sales Funnel - TexasLending.com/input_Phone Number_field27977902'))

WebUI.setText(findTestObject('Object Repository/test2/Page_Sales Funnel - TexasLending.com/input_Phone Number_field27977902'),
	'1234567890')

WebUI.click(findTestObject('Object Repository/test2/Page_Sales Funnel - TexasLending.com/img_I agree to the Terms and Conditions and_928f25'))

WebUI.closeBrowser()

And my keyword which I use:

package email

import static com.kms.katalon.core.checkpoint.CheckpointFactory.findCheckpoint
import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase
import static com.kms.katalon.core.testdata.TestDataFactory.findTestData
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import static com.kms.katalon.core.testobject.ObjectRepository.findWindowsObject

import com.kms.katalon.core.annotation.Keyword
import com.kms.katalon.core.checkpoint.Checkpoint
import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile
import com.kms.katalon.core.model.FailureHandling
import com.kms.katalon.core.testcase.TestCase
import com.kms.katalon.core.testdata.TestData
import com.kms.katalon.core.testobject.TestObject
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
import com.kms.katalon.core.windows.keyword.WindowsBuiltinKeywords as Windows
import org.openqa.selenium.Keys as Keys
import internal.GlobalVariable

public class email {
	@Keyword
	def populateEmail(){

		String myEmailAddress = "test" + System.nanoTime() + "@itest.com";
		return myEmailAddress;
	}
}

It seems you have changed your code already. The error log you posted above lost its value. I need the error log emitted by the latest version of your codes.

Sorry here is the error message which I got after finish the execution:
=============== ROOT CAUSE =====================

For trouble shooting, please visit: https://docs.katalon.com/katalon-studio/docs/troubleshoot-common-execution-exceptions-web-test.html

12-03-2020 11:33:55 AM Test Cases/test1

Elapsed time: 56.276s

Test Cases/test1 FAILED.
Reason:
groovy.lang.MissingPropertyException: No such property: email for class: Script1606987724779
at test1.run(test1:60)
at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:393)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:384)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:363)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:355)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:251)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:114)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:105)
at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)
at TempTestCase1606988034113.run(TempTestCase1606988034113.groovy:25)

You uses many Test Objects in the Object Repository. I need them as well to reproduce your case on my side.

Is it possible to make a zip of your project and share it here?

@kazurayam
Here is a google drive link:

@kazurayam The test case is to add a different email every time and that I added the timestamp and then I want to check if this email is inputted because I will go to a DB page where I should search for this specific email inputted.

I tried to run the test case in the project you zipped. The Test Case ran without error. Do you have any issue still?

Let me add an advice. The class name alabal.alalbala looks odd. It is not compliant to the Convention.

Code Conventions for the Java Programming Language, 9 Naming Convention

Class names should be nouns, in mixed case with the first letter of each internal word capitalized. Try to keep your class names simple and descriptive. Use whole words-avoid acronyms and abbreviations (unless the abbreviation is much more widely used than the long form, such as URL or HTML).

So alabal.Alalbala would be better.

@kazurayam

Check this sorry:

I looked at Velocify (2).zip

When I executed the test1, I saw an Exception:

Reason:
groovy.lang.MissingPropertyException: No such property: email for class: Script1606987724779
	at test1.run(test1:60)
...

This Exception is thrown at the line #60 of test1 script:

WebUI.verifyElementText(findTestObject('Object Repository/Page_Sales Funnel - TexasLending.com/input_Email Address_email'),	
    email.get(0))

The cause is quite obvious. In the test1 script, you do not have a variable email defined.

I have no more words to say. I do not know what you meant by email.get(0).

1 Like

@kazurayam I want to see if katalon input the specific email from keyword and then I want to get to verify.
I am newbie here so if you can help me will be more than nice:)

Note: I have not downloaded your code. I am looking at the code you placed in your posts above.

The email package and class do not appear to be imported into your test case. And I’m not sure what the hierarchy/structure is either, but you need something like this in your test case:

import email

In my code, I make my keywords static, which means I don’t need to say @Keyword and the methods are available to use like a global method:

Test Case

import static email

email package:

public class email {
	static def populateEmail(){

		String myEmailAddress = "test" + System.nanoTime() + "@itest.com";
		return myEmailAddress;
	}
}

But that still doesn’t explain what email.get(0) is meant to do. I don’t see a list/array called email anywhere.

1 Like

@Russ_Thomas
I was found in another post where use get(0)) to return the input value and I was thinking maybe I can use the same method to get the specific email inputted, how I said I want to verify if this email is inputted.
And thank you for the code

@costea.georgian89

I modified your original project. Now it runs fine.

Velocify 2.zip (122.2 KB)

The most notable part for you would be this portion in the Test Case test1:


def address = CustomKeywords.'com.costea.EmailUtil.getMyAddress'() 
WebUI.setText(findTestObject('Page_Sales Funnel - TexasLending.com/input_Email Address_email'), address)

//WebUI.verifyElementText(findTestObject('Page_Sales Funnel - TexasLending.com/input_Email Address_email'),
//    email.get(0)) 
def v = WebUI.getAttribute(findTestObject('Page_Sales Funnel - TexasLending.com/input_Email Address_email'),
        'value')
def result = WebUI.verifyEqual(v, address)
if (result) {
	WebUI.comment("Good! The address ${address} is what I expected")	
} else {
	WebUI.comment("Nein, die Adresse ${address} ist nicht das, was ich erwartet habe")
}

You should use WebUI.getAttribute(testobject, 'value') in order to retrieve the value out of the <input value="..."> tag.
WebUI.verifyElementText() does not work to retrieve and verify the @value attribute of <input>.

Why?

You should be aware, HTML <input value="foo"> tag contains the text("foo") you put as @value attribute. It does not look like <input>foo<input>. See some resources about HTML, like this

2 Likes