“The current scope already contains a veriable of the name optionLenght” What is the cause of the mistake?

#Code#

int optionListLenght = 19

Random rand = new Random()

int index = rand.nextlnt(optionListLenght + 1)

WebUl.selectOptionByIndex(findTestObject(‘Page_AnyWork - WareHouse/Company’), index)

#Code#

#Code#
int optionListLenght = 2

Random rand = new Random()

int index = rand.nextlnt(optionListLenght + 1)

WebUl.selectOptionByIndex(findTestObject(‘Page_AnyWork - WareHouse/Address’), index)

#Code#

 

I\'m running the test but \\\"The current scope already contains a veriable of the name optionLengh\\\"
error view. What is the cause of the mistake ?
 

Because there is more than one of the same variable name,

I just found out :slight_smile: