Forum Discussion

Maros94's avatar
Maros94
New Contributor
3 years ago
Solved

How do I prevent a browser refresh after "Navigate" method in KeywordTests

Dear community,

 

I am new to TestComplete and have a question regarding the Navigate method for browsers in KeywordTesting.

 

Basically what I am struggling with is when I am using multiple browsers (chrome, edge) and perform multiple navigate methods then it always refreshes my browser before it performs the following operations. However, one of web applications I am testing is a webchat so a refresh will close the chat session when already opened and this is something I would like to prevent.

 

To clarify the above, an example from my automated keyword test:

 

1.Open the webchat URL in Chrome
2. Send a message through the chat window
3.As an agent in a different webapplication (edge), accept the chatmessage and send a reply
4. Navigate back to chrome and verify the chat reply from the agent
At step 4, Testcomplete will refresh the chrome after the navigate to chrome method which is basically something I would like to prevent, since a refresh will close my ongoing chat session. 

 

Is there something that I could do / use to prevent the refresh at step 4?

 

Any advise is very appreciated.

Many thanks in advance.

 

Kind Regards,

 

Maros

  • mattb Hello Matt,

     

    Thank you for your response. I found a workaround for this. Instead of the "Navigate" feature I use the "Aliases.browser.BrowserWindow" object which will be recorded once I click on the browser again, this will open the browser without refreshing the page. Works fine!

3 Replies

  • Hi,

    Can you share an image of your test? I dont think there is any issue with your automation flow, but it will be easier to troubleshoot with an image 🙂 

    • Maros94's avatar
      Maros94
      New Contributor

      mattb Hello Matt,

       

      Thank you for your response. I found a workaround for this. Instead of the "Navigate" feature I use the "Aliases.browser.BrowserWindow" object which will be recorded once I click on the browser again, this will open the browser without refreshing the page. Works fine!

      • sonya_m's avatar
        sonya_m
        SmartBear Alumni (Retired)

        Thank you so much for sharing the workaround with the Community Maros94 !