Forum Discussion

rhsou123's avatar
rhsou123
Contributor
9 years ago

Object Required "SystemUtil"

Hi,

 

Please can anyone help me in replacing this code:

 

SystemUtil.Run "IEXPLORE.exe",URL,browserPath

I discovered that this can be used only by UFT and not VBscript in general.

 

Can anyone help me in replacing it to be accepted by Testcomplete please ?

    • rhsou123's avatar
      rhsou123
      Contributor

      I replace it and it works for part of the code and not for the other,

       

      Browsers.Item("iexplore").Run URL
      	If Browser("title:=Sign In.*").Page("title:=Sign In.*").WebEdit("name:=UserName.*").Exist(3) Then
              Browser("title:=Sign In.*").Page("title:=Sign In.*").WebEdit("name:=UserName.*").Set userName
              Browser("title:=Sign In.*").Page("title:=Sign In.*").WebEdit("name:=Password.*").Set password
              Browser("title:=Sign In.*").Page("title:=Sign In.*").WebEdit("name:=Password.*").Submit
              Browser("title:=Sign In.*").Sync

      an other error is generated wich is "Type Mismatch Browser", is Browser too related to UFT ?

       

      If yes, how can I replace it please ?

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        In this case, yes. The syntax you are using with your browser is probably UFT specific.

        So, question first: Have you mapped your pages, etc, with your NameMapping? If not, you'll need to do some other work to do what you want exactly.  Honestly, your BEST bet is to do a quick record of some of your tests to get the mapped names of your objects. Otherwise, some of those chains of objects (parent.child.child2.child3... etc) can get VERY long.

         

        IF mapped correctly, Aliases.browser should return the browser object that you are running... under that, should then be a Page object, and then your different edit fields mapped from there.  With a well mapped Page Object Model, you should be able to call something like

         

        dim textUserName
        Browsers.Item("iexplore").Run URL
        set textUserName = Aliases.browser.pageSignIn.WaitAliasChild('UserName')
        if textUserName.Exists 
            textUserName.SetText userName
            textPassword.setText password
            

        Or some such thing... probably a lot of variable definitions and syntax that I'm missing but hopefully you get the idea.

        Again, for your specific test cases, you might want to do a quick record to see how the syntax plays out in TestComplete AND to make sure that your NameMapping is fully populated with what you need.