Americans’ growing frustration over high prices has defined many political campaigns ahead of November’s midterm elections.