Ask a Question

Playback the script (function: repeatedly open and close the browser) , unexpected dialog popup

SOLVED
ApplePen
Contributor

Playback the script (function: repeatedly open and close the browser) , unexpected dialog popup

Playback the script (function: repeatedly open and close the browser) , unexpected Message will be popup.

----------------------------------------------

The message of the unexpected dialog:

Firefox: 

Firefox safe mode

Firefox was accidentally switched off at boot time. This could be due to additional components or other reasons.

You can try troubleshooting in safe mode to solve this problem.You can also skip troubleshooting and try to refurbish Firefox.

Chrome:

Restore pages?

Chrome didn't shut down correctly.

----------------------------------------------

The problem does not happen with IE/Edge.

Please check the attachment(file b) in detail.


Looking forward for your reply.
Thank you.
---Steven Wang
 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
AlexKaras
Community Hero

Re: Playback the script (function: repeatedly open and close the browser) , unexpected dialog popup

Hi,

 

I would recommend to consult documentation that contains a lot of useful information.

.Close() method does not return anything, so it is useless to do a verification like if (.Close()).

Also, attempting to close an application two times in a row can easily cause unpredictable behavior.

And finally, it is better to copy/paste your real code than to type it as occasional typo(s) (like TestApps, Chorme, Terminal) can easily mislead others.

The code from the sample provided in the help for the .Close() method adopted to your case may look like this:

 

  p = TestedApps.Chrome;

  // Closes the process
  p.Close(10000);
  // Checks whether the process is closed
  if (p.Exists)
  {
    Log.Warning(p.ProcessName + " seems to hang, terminating.");
    p.SaveDumpToLog();
    // Terminates the process
    p.Terminate();
  }

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================

View solution in original post

4 REPLIES 4
tristaanogre
Community Hero

Re: Playback the script (function: repeatedly open and close the browser) , unexpected dialog popup

My guess is that you are opening and closuing the browsers too fast.  It would probably not be a bad idea for us to see the actual code you are attempting to use to do this so we can make some suggestions.   What I would suggest is that, after calling the browser.Close() method, add some code to wait for the process to be completely shut down before kicking off the next browser instance.  

 

Also... interesting item.... the date and time of your test log is August, 2017...  Why wait 3 months to post the question?


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
ApplePen
Contributor

Re: Playback the script (function: repeatedly open and close the browser) , unexpected dialog popup

@tristaanogreBefore I still collect the problems about our test by TestComplete.

Recently submit them. So the date is Augest.

Like the below ?:

[ TestApps.Chrome.Close();

if(!TestApps.Chrome.Close()){

  TestApps.Chorme.Terminal();

} ]

 

 

AlexKaras
Community Hero

Re: Playback the script (function: repeatedly open and close the browser) , unexpected dialog popup

Hi,

 

I would recommend to consult documentation that contains a lot of useful information.

.Close() method does not return anything, so it is useless to do a verification like if (.Close()).

Also, attempting to close an application two times in a row can easily cause unpredictable behavior.

And finally, it is better to copy/paste your real code than to type it as occasional typo(s) (like TestApps, Chorme, Terminal) can easily mislead others.

The code from the sample provided in the help for the .Close() method adopted to your case may look like this:

 

  p = TestedApps.Chrome;

  // Closes the process
  p.Close(10000);
  // Checks whether the process is closed
  if (p.Exists)
  {
    Log.Warning(p.ProcessName + " seems to hang, terminating.");
    p.SaveDumpToLog();
    // Terminates the process
    p.Terminate();
  }

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================

View solution in original post

ApplePen
Contributor

Re: Playback the script (function: repeatedly open and close the browser) , unexpected dialog popup

@AlexKaras

I will try it as your recommendation.

Thank you.

cancel
Showing results for 
Search instead for 
Did you mean: