Ask a Question

How to find web object if it is matches go to next line and click on URL link

Ashoka
New Contributor

How to find web object if it is matches go to next line and click on URL link

Using Python script test complete tool. Find web object and if web object matches navigate next line click URL link. Why i am trying this because URL link is dynamic.

6 REPLIES 6
Ashoka
New Contributor

Using Python script with test complete tool. Find web object and if web object found next step is to navigate next line and click on the URL link. Why i am trying this because URL link is dynamic.

 

Is it possible to traverse in web page using regular expression? if yes please let me know the syntax. 

If you don't want to go the name mapping route there are several find methods available to Test Complete objects.

 

https://support.smartbear.com/testcomplete/docs/reference/test-objects/members/common-for-all/findch...


Thanks,
Carson

Click the Accept as Solution button if my answer has helped
Ashoka
New Contributor

Thanks for response.

 

My question is after matching web object I need to go to next line form matched object and I need to click on URL link.

Please find the attachedscreenshot.

Eg: Found "Login Page" underneath there is a URL link I need to click on the url link, Here I cant search URL link because its dynamic. 

 

Please let me know the solution in regex or any other ways



 

The link I provides ways to use regex or wildcards in your search criteria. Not sure what else to give you as I don't know how the structure of your page or what part of the url is dynamic. Also, just because the url is dynamic does not mean you can't search for. For example it's the only link inside that login panel you could search by index and object type.

 

From the documentation:

 

PropValues

An array containing the values of the specified properties or a single property value (see Remarks).

You can enter the item’s index (from 0) or its caption. The caption can contain asterisk (*) or question mark (?) wildcards or regular expressions. The asterisk (*) wildcard corresponds to a string of any length (including an empty string), the question mark corresponds to any single character (including none). To specify more complicated parts of a caption, use regular expressions. For information on them, see the Remarks section below.

The caption can be case-sensitive or case-insensitive depending on the value of the Use case-sensitive parameters project setting. Regular expression patterns are always case-insensitive.


Thanks,
Carson

Click the Accept as Solution button if my answer has helped
Ashoka
New Contributor

Cundrew,

 

Here I attached webpage appearance, in link panel there are multiple login links Admin, Viewer. After finding Viewer in web page there is a link under Viewer. I need to click on url link after viewer or admin name. Please let me know the solution.

I can't just give a solution based on a screenshot, I have not idea what the structure of your web page looks like. You might be able to find the link based off a shared parent of the viewer object, but that's just a stab in the dark if you could provide a screen of the object browser with the link you need to find selected that would help, but again, you can wild card or use reg ex in the find methods, the documentation above explains how to do this. 


Thanks,
Carson

Click the Accept as Solution button if my answer has helped
cancel
Showing results for 
Search instead for 
Did you mean: