Forum Discussion

josette_merhy12's avatar
josette_merhy12
Occasional Contributor
11 years ago

Switching Browsers

hi, i m trying to run the same jscript function on firefox and chrome. i m setting the variable browser = Sys.Browser() the first time i call this function, chrome was opened, so the system brow...
  • jose_pita's avatar
    11 years ago
    Instead of Sys.Browser() use Sys.Browser("nameOfYourBrowser").



    What I do is, I have a project variable browser and whenever I need to change browsers I do:



    function setBrowser(browser)

    {

      Project.Variables.browser = browser

    }



    function useDiffentBrowsers()

    {


       setBrowser("firefox")

       Sys.Browser(Project.Variables.browser).Page.Find(something).Click()

       setBrowser("chrome")

       Sys.Browser(Project.Variables.browser).Page.Find(something).Click()

    }