Reputation: 53
I'm working on a selenium test and I need to get a chrome extension from the chrome app store to use in the test. Right now it's a manual process to update to a newer version of the extension.
Current Flow:
1. Manual download extension through a chrome extension downloader.
2. Store the .crx file in a location visible to the selenium test.
3. Execute test with that extension.
I was hoping that google had an API that could be hit in order to download the extension but I've been unable to find anything to that effect. Has anyone ran into a situation like this and been able to solve it?
Upvotes: 1
Views: 220
Reputation: 26
Basically you just have to capture the redirect url and then request that.
In python:
pluginId = id at end of url on plugin page. option 2 on here explains it well
blah=requests.get(url,params{'prodversion':'57.0','x':"id=pluginId",'response':'redirect'},verify=False,stream=True)
blahFile = requests.get(blah.url)
extension = open("yourExtension.crx", 'wb')
extension.write(blahFile.content)
extension.close()
Upvotes: 1