Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Click after CheckProperty to a WebElement passed via Function argument fails
#1
Not Solved
Hi,  I'm very new to UFT.

Now I have two scripts like:

Code:
Browser().Page().WebEdit("editBoxA").Set "SomeValue"
Browser().Page().WebEdit("editBoxA").CheckProperty "value","SomeValue"
Browser().Page().WebEdit("editBoxA").Click

and:

Code:
Browser().Page().WebEdit("editBoxB").Set "SomeValue"
Browser().Page().WebEdit("editBoxB").CheckProperty "value","SomeValue"
Browser().Page().WebEdit("editBoxB").Click

So I thought it would be nice if I can use Shared Library Function like:

Code:
Public Sub checkElement(ByRef element)
  element.Set "SomeValue"
  element.CheckProperty "value","SomeValue"
  element.Click
end
then each scripts could be:
Code:
checkClick Browser().Page().WebEdit("editBoxA")
But I got an error 

> Cannot identify the object "editBoxA" (of class WebEdit)

in the line "element.click".

I tried to comment out CheckProperty line, then it works fine.

Please someone let me know of my mistake, or more efficient code.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Help Waitproperty or Checkproperty with micGreaterThan() Code typhoon23 1 1,977 08-23-2017, 05:02 PM
Last Post: Ankur
  Unable to click on dynamically changing webelement preeti 0 1,807 04-29-2017, 08:50 PM
Last Post: preeti
Exclamation WebElement("WebElement").Click is not working sia sharma 7 23,953 09-28-2016, 08:58 PM
Last Post: supputuri
Exclamation SAPGuiUtil.Autologon method fails liorde 2 5,943 10-25-2015, 02:08 PM
Last Post: liorde
  Calling a function in a Test Script from a function library anupam4j 3 6,113 06-26-2015, 12:31 AM
Last Post: babu123

Forum Jump:


Users browsing this thread: 1 Guest(s)