Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

window handles

main_window_handle = None
while not main_window_handle:
    main_window_handle = driver.current_window_handle
driver.find_element_by_xpath(u'//a[text()="click here"]').click()
signin_window_handle = None
while not signin_window_handle:
    for handle in driver.window_handles:
        if handle != main_window_handle:
            signin_window_handle = handle
            break
driver.switch_to.window(signin_window_handle)
driver.find_element_by_xpath(u'//input[@id="id_1"]').send_keys(user_text_1)
driver.find_element_by_xpath(u'//input[@value="OK"]').click()
driver.find_element_by_xpath(u'//input[@id="id_2"]').send_keys(user_text_2)
driver.find_element_by_xpath(u'//input[@value="OK"]').click()
driver.switch_to.window(main_window_handle) #or driver.switch_to_default_content()
Comment

PREVIOUS NEXT
Code Example
Javascript :: updating a random variable in a function 
Javascript :: after variable javascript 
Javascript :: phaser matter is undefined 
Javascript :: javascript to typescript converter 
Javascript :: react-bootstrap-sweetalert is not running 
Javascript :: how to get specific property name with numbers from object in javascript 
Javascript :: number of filters 
Javascript :: set timeout with no name 
Javascript :: multply js 
Javascript :: ohif add auth to config 
Javascript :: wordpress how to read jquery 
Javascript :: Hexo - Execute Console Commands 
Javascript :: How to write "Hello World" 
Javascript :: how to set maxLength of input type number in react 
Javascript :: (state.isLoggedIn = function() {return false}) react redux 
Javascript :: create index with multiple fields mongo 
Javascript :: React Router rendering blank pages for all components 
Javascript :: dependent drop down list in jquery 
Javascript :: Changing the value of a dropdown when the value of a number box changes in AngularJS 
Javascript :: angularjs getting Error: [$rootScope:inprog] $digest already in progress when changed from Fetch to $http + $q 
Javascript :: AngularJS Form validation transition to valid when some elements are not even touched yet 
Javascript :: Delete a field from Firebase Firestore where the field/key has a period/punctuation (".") - modular v9 JavaScript SDK 
Javascript :: javascript array add method 
Javascript :: sending api with limited fields in express 
Javascript :: get copied text javascript 
Javascript :: varibale as listeneres javascirpit 
Javascript :: div auto extend win righting in 
Javascript :: What is an array? Is it static or dynamic in Javascript 
Javascript :: React Using Self Made Module 
Javascript :: what does the text before an object stand for in js 
ADD CONTENT
Topic
Content
Source link
Name
2+5 =