Forum Discussion

contacteswart's avatar
contacteswart
Occasional Contributor
6 years ago

Identify a Hyper Link with any property that is not depended with Cell value in Key word driven test

Hello All

This is my first post in the forum.

Question1

I am automating website work flow through Key word driven approach. I have to click on a Product link in a web page whis is in a web table. Every time we login the product place changes. Not in the same cell every time. Hence my record and play script fails as it identify with cell value. I went through all other Object properties and notice that all of them uses cell value to identify the product. Is there any way we can click on the hyper link without giving a cell value?

Question2

How to introduce additional wait time in Record and Play script. Usually our website is slow and at time taking more time to launch web page so I want to introduce hard coded wait times

 

Thanks in advance foryour help

Regards

Eswar

2 Replies

  • Marsha_R's avatar
    Marsha_R
    Champion Level 3

    for question 1:

    Is there some other field that unique identifies the link, perhaps the text?  That would be the thing to use.

     

    for question 2:

    There are ways to add hard delays:

    https://support.smartbear.com/testcomplete/docs/reference/program-objects/aqutils/delay.html

     

    However, the better way to overcome these timing issues is with a Wait* method. 

    https://support.smartbear.com/testcomplete/docs/reference/test-objects/members/window-and-process/wait-method-window-object.html

    (or look under W in the list below)  

    There are many different types, WaitObject, WaitChild, WaitBrowser, etc.  This will give you a more specific wait time and not make you have to guess when your item will be available.

     

     

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    Question 1:

     

    I would suggest, rather than relying on the click on the component, implementing code that "finds" what you want to click on it and return the object... THEN click on it.  We have a similar situation.  We have a web table that has a list of items.  Each time we run the test, the list potentially changes so we can't always rely on the item we want to always be on the same row.  So, we created code that does a for loop through the table, checking a particular column.  Each time through the loop it checks the value in that column.  If it finds the item we're looking for, the function returns the desired row which we store in a variable and then use to actually click on the desired cell.

     

    Question 2:

     

    The quickest and easiest way to do this is to increase the Auto-Wait Timeout in Tools -> Current Project Properties -> Playback.