Different refresh button in browsers

Different refresh button in browsers

Home Forums Ask Expert Different refresh button in browsers

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #32601
    Sergey ZAP
    Keymaster

      Hello Guengoha,

      There are different ways to address this.
      1. If you have a parameter for browser type, you can use it in IF…ELSE block. You need separate objects for each Refresh button – you can scan different browsers using separate apps/views. You script may look like this:
      If Datatable.Value(“Browser”)=”ie” then
      Application(“Application_IE”).View(“View_IE”).Object(“Refresh”).Click
      Elseif Datatable.Value(“Browser”)=”chrome” then
      Application(“Application_CHROME”).View(“View_CHROME”).Object(“Refresh”).Click
      Elseif Datatable.Value(“Browser”)=”firefox” then
      Application(“Application_FIREFOX”).View(“View_FIREFOX”).Object(“Refresh”).Click
      end if

      2. If you are not using parameter for browser, you can perform simple check if Refresh object exists. You also need separate objects for each browser’s Refresh button.
      If Application(“Application_IE”).View(“View_IE”).Object(“Refresh”).Exist(5000,false) then
      Application(“Application_IE”).View(“View_IE”).Object(“Refresh”).Click
      Elseif Application(“Application_CHROME”).View(“View_CHROME”).Object(“Refresh”).Exist(5000,false) then
      Application(“Application_CHROME”).View(“View_CHROME”).Object(“Refresh”).Click
      Elseif Application(“Application_FIREFOX”).View(“View_FIREFOX”).Object(“Refresh”).Exist(5000,false) then
      Application(“Application_FIREFOX”).View(“View_FIREFOX”).Object(“Refresh”).Click
      end if

      3. Since most browsers use same key combination for reload (CTRL+R), you can use this code (should work for any browser):
      zap.Keyboard.KeyDown zap.Keys.Ctrl
      zap.Keyboard.KeyPress zap.Keys.R
      zap.Keyboard.KeyUp zap.Keys.Ctrl

    Viewing 1 post (of 1 total)
    • You must be logged in to reply to this topic.

    Virtual Expert

    ZAPTEST

    ZAPTEST Logo