How to Mimic the tool functions like Click(),SetText("") in SilKTest Open Agent (4Test) , Any clear example ?

Hi, As per my Application(Windows) if we click on the button it should open dialog box (Close based on the dialog box). Here based on the provided input in fields its pulling data from backend, so sometimes its opening and sometimes its not closing the dialogbox. so i would like to Mimic the Click Finction like enabled = true, visible = true  or waitforpropery.

In UFT we have objControl to mimic the existing functions as user defined functions.

Here do we have any options to deal this kind ?

  • Suggested Answer

    0  

    Hi  

    It's not really clear what you need to do from my perspective.

    In Silk Test the click method is available on any object type, therefore you should simply need to script the Click action as required. For example:

    	[ ] //Click the center of the DemoBtn
    	[ ] SampleApp.DemoBtn.Click()
    	[ ] 
    	[ ] //Click a specific location of DemoBtn
    	[ ] SampleApp.DemoBtn.Click(MB_LEFT, 10, 5)
    

    The SetText method is a specialized method that is only available for certain object types, generally text input related control. For objects where the SetText method is not available, the TypeKeys method can be used to send text to the object in question. For example:

    	[ ] SampleApp.AfxWindowOrFrame.TypeKeys("Demo Text")
    

    If you need to perform a conditional click based on whether a control exists or not, then you can use the Exists method:

    	[-] if(!ChildDialog.Exists(5))
    		[ ] SampleApp.DemoBtn.Click()
    

    Regards
    Robert

  • 0 in reply to   

    Hi Robert, Thanks for your input. here My Application is not stable so if i click on pushbutton sometimes its not opening because data what ever we selected on that dialogbox its settling slowly. so i thought to write userdefined function for Click. like first i will verify button exitance and next i can check for button available and if not enabled will wait for till enable then it will clik on object . so i cant add this script everytime.

  • 0 in reply to 

    Hi Robert, please check below image, according to my app behavior coded like this

    here we declared sequence as window variable . do we have any other alternative without declaration?