1

i have this problem, an "url" has a "token" which generates a random number. When i try to manipulate an object in this "url" during the run session, UFT doesn't recognize the object because the "url" change.

For example:

record::

Browser("url").Page("dynamicalUrl").WebButton("cancel").Click 
'The url value of Page( "dynamicalUrl") is for example: https://example.com/token=542654364678

Run Session::

UFT crashes in the step, because it doesn't recognize objects and the url value of Page( "dynamicalUrl") changes to: https://example.com/token=987757858

Is there any solution to this?, if someone know how to solve this, thanks in advance.

3 Answers3

4

if you only need the cancel button try to make the object dynamic Use the spy to review properties and select the most appropriate ones.

Browser("index:=0").Page("name:=Page").WebButton("name:=Cancel")
Barry
  • 3,303
  • 7
  • 23
  • 42
3

There is no need to have any description for Page objects. Every Browser has only one Page, the reason UFT has this object at all is to create manageable object repositories.

Motti
  • 110,860
  • 49
  • 189
  • 262
2

Usually it is a Bad Practice to use the URL as a Page identififer. Try to use the title property instead.

In case you need the URL, use it as a Regular Expression. If your token is just numbers than the regexp is something like:

https://example.com/token=\d+

Generally speaking whatever is a dynamic part in a Property you need to use Regular Expressions for that

Bela Tamas Jozsa
  • 714
  • 5
  • 10