Access and handle chrome extension popup using selenium webdriver

前端 未结 2 1483
傲寒
傲寒 2020-12-21 20:22

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 sto

2条回答
  •  孤城傲影
    2020-12-21 20:47

    Following @Navarasu solution, I copied pyrobot.py file from here. It worked perfectly fine for me.

    from pyrobot import Robot
    from selenium import webdriver
    import time
    
    browser = webdriver.Chrome()
    browser.get('https://chrome.google.com/webstore/detail/dynamic-assessment-plugin/fnapgcgphlfhecijolobjodbbnjjpdga')
    browser.maximize_window()
    browser.implicitly_wait(15)
    browser.find_element_by_css_selector("[aria-label='Add to Chrome']").click()
    
    time.sleep(3)
    rob = Robot()
    rob.key_press('tab')
    rob.key_press('enter')
    

提交回复
热议问题