셀레늄에서 여러 창/탭 처리

코드 예제

0
0

셀레늄에서 여러 창/탭 처리

Selenium stays on one window. If you open a window and then 5 tabs popped open,
selenium is focused on the first window
If you are on a new window and you tell selenium to print an element on 
the default window, it will still work even that user’s focus is on the 
new window. Must switch to new window:

    - Use windowHandle()
    - Driver.getWindowHandle()
   - Everytime Selenium opens a browser, it's going to give an index ID
   for the page  called Handles
      - Returns the handle/id of current page (as a string)
      - driver.switchTo().window(string handle)
      - driver.getWindowHandles()  for multiple windows
Returns a Set of window handles
      - Switch using titles:
  	for(string handle: driver.getWindowHandles()){                            
		driver.switchTo().Window(handle)                            
	   		 if(driver.getTitle().equals(targetTitle)
	      			break;

비슷한 페이지

예제가있는 유사한 페이지

다른 언어로

이 페이지는 다른 언어로되어 있습니다

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................