I am trying to install the IBM DAP chrome extension using Selenium webdriver. I don't have access to crx file. So, I tried to install it directly through the chrome web store for plugins as:
browser = webdriver.Chrome()
browser.get('https://chrome.google.com/webstore/detail/dynamic-assessment-plugin/fnapgcgphlfhecijolobjodbbnjjpdga')
browser.maximize_window()
browser.implicitly_wait(5)
browser.find_element_by_css_selector("body > div.F-ia-k.S-ph.S-pb-qa > div.h-F-f-k.F-f-k > div > div > div.e-f-o > div.h-e-f-Ra-c.e-f-oh-Md-zb-k > div > div").click()
browser.switch_to_alert().accept()
but this code is not accessing the pop up window and is not able to click the 'Add extension' button. How to access the pop up window and click on the 'Add extension'?
It is not the javascipt alert. It cannot be handled using Selenium Alert. It is a native os related window similar like file upload window.
In Java, we can use Robot class to simulate keyevent to handle this.
If it is windows os , we can use AutoIt script to handle the pop up. Please refer this related post for auto it usage. This is an exe and can be execute in any language.
I have tried in java using Robot class and it is working for me.
Following @Navarasu solution, I copied pyrobot.py file from here. It worked perfectly fine for me.