Advertisement
TikhomirovSergey

Untitled

Sep 3rd, 2013
1,093
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.64 KB | None | 0 0
  1.     //switches to object
  2.     //this method can be overridden
  3.     protected synchronized void switchToMe()
  4.     {
  5.         //firstly we should switch parent browser window on
  6.         if (parent!=null)
  7.         {
  8.             parent.switchToMe();       
  9.         }
  10.         else
  11.         {
  12.             nativeWindow.switchToMe();
  13.         }
  14.         //if this object is placed on some frame
  15.         if (frameToSwitchOnInt!=null)
  16.         {  
  17.             frameSupport.switchTo(frameToSwitchOnInt);
  18.             return;        
  19.         }
  20.         if (frameToSwitchOnStr!=null)
  21.         {
  22.             frameSupport.switchTo(frameToSwitchOnStr);
  23.             return;
  24.         }
  25.         if (frameToSwitchOnElem!=null)
  26.         {
  27.             frameSupport.switchTo((WebElement) frameToSwitchOnElem);
  28.             return;
  29.         }
  30.         return;
  31.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement