How to extract keyword names written under testcases?

we have built in keyword to extract testname and suite name of robot framework but i am unable to get the built in method to extract Keyword name under testcases.

Can you please explain a bit, what you want to achieve?

1 Like

This my sample code.

*** Settings ***
Documentation Extract the keyword name

*** Keywords ***
Log the given message
log to console keyword

*** Test Cases ***
Extract testcase
Log the given message

question:
I want to extract the “Log the given message” keyword in the test file

Note:
This is my python code to extract the test name of robot test file
test_name = BuiltIn().get_variable_value(“${TEST NAME}”)

It will return “Extract testcase” test name in the robot file.