Start a new topic

How to deal with controls contain dynamic text?

I read this article, but I probably need some more examples to be able to do this.

Let me try to help with below example:

When you test with the web browser with personal user pages, the title often appears with the dynamic text. Example: title of inbox page in Yahoo Mail, the title is a pattern: (number_of_unread_email unread) - user_name – Yahoo Mail. The “number_of_unread_email” and “user_name” depend on number of unread email and username, so it’s impossible if you captures interface with a fixed title.

You can use wildcards to deal with this. A wild card always begins with “{” and end with “}”. To present the title of inbox page in Yahoo Mail you can use the following wildcard: {\([0-9]* unread\) - .* - Yahoo Mail}. In which, “\(“ matches a “(“ character; “[0-9]*” match 0 or more characters in the range 0 to 9; “.*” match any (0 or more) character.

So, we can use below interface definition with wildcards to map that window:

It will be matched like this:

In the case you match a control has a property which changes value after each occurrence. You must use wild card to match it. For example: tag “span” content Send Button in Compose page of Yahoo Mail, the id property has value: “yui_3_16_0_1_1408179372147_2546”. Number “1408179372147” and “2546” change after each occurrence. If you want to match this control using id property, you can use pattern: {yui_3_16_0_1_[0-9]*_[0-9]*}

Hope this example helps.

Login or Signup to post a comment