Ask a Question

Test Complete BDD

New Contributor

Test Complete BDD

I am trying to write BDD scenario and trying to integrate it with a script that I had already created. 

The script starts with 

from Locators import Locators
from TestData import TestData

and then has the following statement 

def FindID():


I am trying to integrate this as a step definition with "Given" statement. It is giving error "Unexpected Identifier". 

Please help me. I am new to test complete and learning.

Champion Level 3

A good starting point would be to read through Behavior-Driven Development (BDD) With TestComplete

Thankyou for your reply. I did go through that. It has simple examples and I followed the example for python (the 'def' statement inside the 'Given' step definition). I am getting error. Here is the code:


Given("the user is logged in to the XXX application", function (){
from Locators import Locators
def FindInv_1():





Can you please help me? How do I fix this?



Champion Level 3

The coding you have provided looks like it's for JavaScript and not Python. Python coding will look something like this,


@given("My app has started")
def step_impl():
  # ...


The BDD Tests topic has example codes for Python as well.

Showing results for 
Search instead for 
Did you mean: