Forum Discussion

ḥari's avatar
ḥari
Frequent Contributor
2 years ago

Warning in Log file

Hi Team,

After execution in log file, it returns the warning message as " The browser is already running" because the browser in already opened so it's throwing warning message.

 

How can I overcome this issue without closing the browser???

 

and also I have tried to block that message using the following coding

 

var block=aqString.Find(LogParams.Str, "The browser is already running");

if(!block=-1)

LogParams.Locked=true;

else

LogParams.Locked=false;

 

But it shows ReferenceError as "LogParams is not defined"!

 

 

Anyone help me regarding this.

 

Thanks in advance!!!

 

  • See the example in Log.Enabled Property and Typical Event Handler Tasks (Blocking Log Messages)

     

    My preference would be to use the following,

     

    function BrowserTest()
    {
        if (!Sys.WaitBrowser("chrome").Exists) {
            Browsers.Item("chrome").Run("http://smartbear.com/");
        } else {
            Browsers.Item("chrome").Navigate("https://www.w3schools.com/");
        }
    }

     

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    See the example in Log.Enabled Property and Typical Event Handler Tasks (Blocking Log Messages)

     

    My preference would be to use the following,

     

    function BrowserTest()
    {
        if (!Sys.WaitBrowser("chrome").Exists) {
            Browsers.Item("chrome").Run("http://smartbear.com/");
        } else {
            Browsers.Item("chrome").Navigate("https://www.w3schools.com/");
        }
    }

     

    • ḥari's avatar
      ḥari
      Frequent Contributor

      Hi rraghvani

       

      I am also tried and worked that Log.Enabled property.

      and also what you shared that also works fine.

       

      Thanks!

       

  • leticia203's avatar
    leticia203
    New Contributor

    Hello

    I have another option try this one 

    Checking for error logs is the first step for determining the nature of the problem.
    ...
    To check for error logs, follow these steps:
    Check the log files for error messages. Examine errlog. log first.
    If indicated, check optional log files for error messages.
    Identify the errors associated with your problem.

    iraqi dinar guru

    • ḥari's avatar
      ḥari
      Frequent Contributor

      Thanks leticia203

       

      I will try this option also.