Search code examples
qtphp-uft

UFT scripting will highlight object, but won't click it


Why does the WebElement object highlight just fine, but the click doesn't do anything?

Browser is Chrome.

Statement are:

Browser("Message Validators | ETT").Page("Message Validators | ETT").WebElement("css:=SPAN.btn.btn-default").Highlight

Browser("Message Validators | ETT").Page("Message Validators | ETT").WebElement("css:=SPAN.btn.btn-default").Click

Solution

  • Setting.WebPackage will do the trick. Tested the code on Chrome.

    '~~> Runs mouse operations using the mouse
    Setting.WebPackage("ReplayType") = 2
    Browser("name:=Message Validators.*ETT").Page("title:=Message Validators.*ETT").WebElement("xpath:=//span[contains(.,'Upload File')]").Click
    '~~> Runs mouse operations using browser events
    Setting.WebPackage("ReplayType") = 1