Ideally, yes.
In practice, if investors think the stock price will be higher in the future, they buy.
Dividends are such a tiny amount compared to the value of the share, that in reality it's all just speculation on how people are going to speculate.