Fixed several bugs in tests for WebUI

Change-Id: Icd98004fe0fe7d259a6a0af171b558ca4906b134