-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add plugins option into kw "New Browser" #3972
Comments
I do not understand your request. I could not find plugin argument form Playwright API documentation. Also it looks like you have file somewhere, but your example does not show how that file is used. Could you explain what your need is and not the solution you are currently yousing? |
I have problem, because I need 1 specific argument for auto dowload files (I have problem with blob: file), but I found only 1 solution what I sent into this ticket. So is it possible add option into New Browser KW for custom plugins? Selenium have something similary. |
Browser library uses Playwriting for controlling browsers. It’s not the same technology as selenium. Therefore you would find something similar from the Playwright API documentation. If you are referring to SeleniumLibrary plugin, then Browser library has the same functionality, with the difference that Browser library uses Playwright and not selenium. But your request is still hard to understand, could you please elaborate it more. Example what is the argument, what it’s supposed to do, if you are using similar things in selenium or SeleniumLibrary side, can you show it and anything else what could help us to understand your problem better. |
I have the same problem when using Browser and also solved it in a similar way by modifying the 'Preferences'-file. When using SeleniumLibrary the same could be achieved by passing an instance of ChromeOptions to the 'Create Webdriver'-kw as options. Didn't find a way to do that with the Browser Library without a workaround. I'm guessing the 'firefoxUserPrefs'-parameter that can be passed to the 'New Browser'-kw, can be used to change those settings but for the Firefox browser. |
And what was the problem? In @hutbazku case it looks like custom download directory was set for some reason, but I could be also wrong. |
i was struggling with file downloads as well a bit ( in my case due to remote browser where I am running tests), but I always found a solution in playwright or browser lib documentation or I was pointed on the option how to do it on slack. Seems like you guys are looking for a way to 1) automatically download a file/pdf file in browser lib? - i do it with:
sorry if I didnt get the point, just thought it may help. |
The problem is that I didn't find a way to change the chromium browser preference setting 'plugins.always_open_pdf_externally'. In SeleniumLibrary you could pass the value with ChromeOptions. The setting changes whether PDFs open in a new tab in the browsers integrated pdf viewer, or the PDFs are just downloaded. If I'm not wrong it seems that browser or playwright changes this setting when ran in headless mode. Is there a way to change the 'plugins.always_open_pdf_externally' setting without running in headless mode? Thanks @keef78 that snippet may be a better workaround than the one I came up with. |
Well, does the solution in #3972 (comment) work for you? |
If I understood this correctly, this is the playwrights option: https://playwright.dev/docs/chrome-extensions |
I'm currently using the complex New Persistent Context kw to set up only plugins to automatically download PDF files for me. I have these 2 KW, which first sets up the given plugin and then I have to return everything to its original state.
![obrazek](https://private-user-images.githubusercontent.com/37021143/397676320-58b7e267-cbcd-47a8-a9d9-d88dd8fef5ed.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzNjM2ODEsIm5iZiI6MTczOTM2MzM4MSwicGF0aCI6Ii8zNzAyMTE0My8zOTc2NzYzMjAtNThiN2UyNjctY2JjZC00N2E4LWE5ZDktZDg4ZGQ4ZmVmNWVkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEyVDEyMjk0MVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTg4Yzk0MTRiNDRjZjAxZjgxNmE2NjA0MmE5MjdjZTQzYmJhNDMxNDE2NTMzNjQxOWFlMWRlZTVjOGExMTNiZTEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.aEwU_i05DJizab9iwQPjL-clCsJjGXRpg3yOPfNUoaA)
Furthermore, New Persistent Context do not work well with New Context, which we often use.
This is in Precerences:
![obrazek](https://private-user-images.githubusercontent.com/37021143/397676044-bf3eb462-91b8-468d-86b4-b50125f8b36c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzNjM2ODEsIm5iZiI6MTczOTM2MzM4MSwicGF0aCI6Ii8zNzAyMTE0My8zOTc2NzYwNDQtYmYzZWI0NjItOTFiOC00NjhkLTg2YjQtYjUwMTI1ZjhiMzZjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEyVDEyMjk0MVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTgyZmU2ZjgxNGM5NDFiM2Q5MWM1NDkwNDZlNTc3MjY3M2YyM2QxYzVhZDhiYjQ2NmU0Y2ZiNmNlMTVmYTgwNDQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.-UQmo1tQyxMdjQelQrMjjPStEJEwvDcmTEFYQ9YavaU)
The text was updated successfully, but these errors were encountered: