I'm using Selenium 4 to do some automation and currently we just use it on chrome driver. I'm adding support for edge and got to that problem. (Using C#)
On chrome I can go to a extension settings page by doing:
driver.Navigate().GoToUrl("chrome-extension://<extensionId>/html/settings.html");
With that I can go to the settings page of my extension on chrome. However when I try the same code on edge (with the correct edge extension path) it doesn't work but when I copy and paste it directly to the browser and press enter it goes fine. Do anyone have any input?
edgeDriver.Navigate().GoToUrl("extension://<extensionId>/html/settings.html");
So, you should replace extension with chrome-extension in your URL
You should use
edgeDriver.Navigate().GoToUrl("chrome-extension://<extensionId>/html/settings.html");
Related
Trying to open a URL in an Edge Browser using SeleniumBasic (VBA). The problem is the secure website doesn't like two things. One SeleniumBasic-controlled website is in debug mode. Secondly, it requires the Edge Browser to be in IE mode.
I can open/work on other websites with no issues. Any help would be appreciated.
using this link solved the problem. I was able to load into an Edge browser and work with the Dom Document directly. Using IE Mode.
https://learn.microsoft.com/en-us/answers/questions/829365/vba-automation-with-edge-ie-mode.html
I am trying to scrape a website, but it is not loading in selenium. When I browse that website in my "real" chrome browser, everything works fine. Is there any way I can use my real browser with python to automate stuff, instead of using selenium??
Thanks
Using selenium we can automate real browsers.
If in case the website is not loading via selenium, you can check if adding desired capabilities helps.
Here we can set proxy, disable extensions etc. There are many options available.
https://chromedriver.chromium.org/capabilities
Also if you can share what kind of error is displayed that would be helpful.
I have a tool which load a website, fill in the information, and save the result.
It was working fine until last week.
After debugging, I found out the reason is because the site URL "became" redirected.
The redirected sequence is like below. (for example, site url is google.com)
google.com` → google.com\somethingbetween → google.com (yes, the final redirected url is exactly the same as the original url)
If I open chrome and navigate to the url manually, the page is loaded fine. But if opened by selenium chromedriver, it will stop as google.com\somethingbetween. The strange thing is if I manually enter the url inside the address bar of the browser which was opened by ChromeDirver (will have a little popup saying that the browser is currently controlled by automation tool), the browser will also stop at the second page ( google.com\somethingbetween).
I tried to use the Chrome beta version 79 (with chrome driver v79) but the problem didn't go away.
Use Chrome driver of stable version which may help you to get rid of this problem.Because under this version there is an issue of "issue 3133: window.navigator.webdriver is undefined when "enable-automation" is excluded in non-headless mode (should be true) [Pri-2].So do try with the stable versions like v78,v77.
The redirection issue occurs when "driver.get()" method is used. Please try using "driver.navigate().to()" method to navigate to the url. This may solve the issue.
Linking a related question:
How do I switch to redirected url using selenium web driver
I am working on selenium web driver. I want to open existing browser window via selenium script(Java).
There is no built-in method in Selenium that supports this feature directly. However, you can try the following:
driver.get("link");
driver.find_element_by_link_text('new link name').click().switch_to.window(driver.window_handles[0]);
Just switch to handle for self.You can also try storing handles in variables if you like.
The whole post can be found here.
I currently have a Chrome extension that uses Chrome's APIs and plan on making a Microsoft Edge version once it opens up as well. My question is how do you work with the multiple API's?
For example, I use the following to check if the extension has just been installed or not:
chrome.runtime.onInstalled
I'm assuming for Edge it would be something like:
edge.runtime.onInstalled
What's the best way to work with both of these? Do I just duplicate the code within the file where there is a copy of the code for one and the other and presumably the browser will ignore the other browser's code? (doesn't sound like the good option)
Or is there some cross-browser framework that I should use instead?
Or is there some other solution?
And please forgive me, this is my first entry into building extensions/apps, I'm generally just a Web Designer.
Thank you!
All browsers support or
chrome.runtime.onInstalled
or
browser.runtime.onInstalled
So, the right way is to start scripts in your extension with this code:
var browser = browser || chrome
And then use browser, for example:
browser.runtime.onInstalled
(I'm sorry about my english)
Edit:
Chrome and Opera support chrome and not browser.
Firefox support chrome and browser.
Edge support browser and I don't know if it support chrome.
Anyway, my solution work in all browsers.
Update (5.8.16):
Edge support browser and not chrome.