Search dictionary element by Gherkin

Asked

Viewed 20 times

1

I need to perform an automation, in which I need my code to read the information presented in Table by the Gherkin to select the option I presented inside a dictionary, which is in a file intended for Page Object.

I’m with Gherkin, written this way:

When selecting the fields

Buttons
buttonOne
buttonTwo
buttonFour

In Page Object, I have a function to store the information, in which the fields are with their locators, inside a dictionary, as below:

def func(self):    
dicionario = {    
"Op 1": self.botao_op1    
"Op 2": self.botao_op2    
"Op 6": self.botao_op6        
}
self.dicionario[**Como definir aqui um parametro que irá buscar a informação descrita na tabela do Gherkin**].click()

My step, it’s like this:

@when('Quando selecionar os campos')
def insert_items_profile(context):
  context.page_object.dicionario()

How to make the execution, read the information of my code, which passes to function inside Page Object?

  • Please clarify your problem or provide additional details in order to highlight exactly what you need. The way it’s written these days it’s hard to tell exactly what you’re asking.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.