0

I am new to test complete I am trying to use a generic method to create script but I am not able to combine browser and element

Function EditText (BrowserObject,EditboxName, EditValue)
 BrowserObject.EditboxName.SetText EditValue
End Function

but the standard script like Aliases.browser.WebOrders2.ctl00MainContentfmwOrdertxt.SetText EditValue is working fine.

When I run the script It is showing Waiting for EditboxName I tried object.TextBox(EditboxName) but not working Please help me..

1 Answer 1

2

Editbox in your example is a parameter that works like a variable. It is impossible to use a variable value as a call to a method or property in this way:

BrowserObject.EditboxName

This is a call to the EditBoxName property or method that definitely does not exist in this situation.

I think that the best way you can do is search for an object using the FindChild method. You will need to use a good identification property in this call to reference an object. For example:

Set tBox = BrowserObject.FindChild("NativeWebObject.id", EditBoxName, 15)
If tBox.Exist Then
  tBox.SetText EditValue
Else
  Log.Error "The " & EditBoxName & " object is not found"
End If
Sign up to request clarification or add additional context in comments.

2 Comments

Thank you so much .... we have webedit(xxxxx) option in uft like that, in test complete we don't have any method ?
TestComplete does not have a method with such minor feature. However, TC has many more general ways to address and find an object. The FindChild method is just one of them.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.