variable expansion is not happening inside multiple quotes. Here is the code
products = ['One','Two','Three']
for i in range(0,len(products)):
el = self.driver.find_element_by_android_uiautomator('new UiSelector().text("{}")').format(products[i])
print (el)
expected result should be:
el = self.driver.find_element_by_android_uiautomator('new UiSelector().text("One")')
Error Message:
File "temp_test.py", line 84, in test_product
el = self.driver.find_element_by_android_uiautomator('new UiSelector().text("{}")').format(products[i])
NoSuchElementException: Message: An element could not be located on the page using the given search parameters.
Please help me to resolve this issue!!!