Selenium doesn't load redirect page - selenium

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

Related

selenium chrome NET BLOCKED BY CLIENT

selenium chrome If a page is not operated for a long time, for example, time.sleep 15 minutes, and then again, it can not open the web page, how to refresh the browser debugging found that it is blocked by client did not install any advertising plug-ins after this situation, if you enter the target URL in a new tab enter, it can be opened normally, who knows the reason? I don't think it has anything to do with cookies, thank you.
chromedriver version is also correct, I do not know if everyone's selenium chrome will not have this problem if the open page time.sleep longer time
***The reason for this is partly to do with the html http-equiv attribute of the target site. If the page does not change for a long time, any further execution of the url of the target site in the same tab will not be considered as "re-fetching from the server" but from the cache, which will cause a js exception. Any subsequent get requests of the xhr type will be directed to chrome-extension://invalid
The value after chrome-extension:// will be BLOCKED by chrome if it is unrecognisable, which will happen in any chrome speculation.
A not-so-good solution is to pywin32 simulate re-opening a new tab by typing in the url, but this causes some tab over-closing and handles switching exceptions, so I'm considering seeing if I can fix this from some chrome option parameter settings***
Also if I don't use selenium chrome but normal manual normal browsing of the target site, I don't manipulate the page for a long time and I don't have the above problem, not quite sure if this is an ISSUE with chrome, don't want to switch to firefox as there is too much code to change.

TestCafe tests failing in Chrome (works fine with Safari)

I'm running the test on localhost, in Chrome, which clicks the button, navigates to a new page, and then navigates back to main page. My tests are failing when it goes back to main page with '404 this page could not be found'. Also noticed that each new url gets attached to the local host url. Such as : http://xxx.xxx.x.xxx.xx:34327/SEcdCwbVu*Q2tjgyScm/http://localhost:3000/SEcdCwbVu*Q2tjgyScm/http://localhost:3000/SEcdCwbVu*Q2tjgyScm/http:/localhost:3000/main
Not sure why it happens. With Safari tests are passing.
Browser: Chrome 104.0.5112.79 / Monterey 12
TestCafe version: 1.19.0
Please use the following template to create a new GitHub issue and share the required information there: Tempalte.
Regards,
Artemy

Selenium edge driver cannot go to extension page

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");

Getting captcha screen when I execute automation scripts using chrome browser

I have been executing automation scripts for last 6 months without any issues. Suddenly chrome browser shows captcha screen and shows message that please confirm are you human ?.
Below that it states 2 points 1.JavaScript might be disabled 2. your cookies are not supported .I enabled both of the Java script and cookies but no luck.
I tried to execute older version of chrome browser also but I am getting same captcha screen in the older version of browser too.
The good thing is that I am not getting captcha screen in Firefox and edge browser. I am getting it only in the chrome browser.
May I know if chrome has introduced any functionality like if we execute automation scripts and it shows captcha screen because why I am getting this doubt that firefox and edge is not showing captcha screen.

Phantomjs - Silent Browser

I was using Phantomjs driver for execution of my Application test scenario.
In the Recent update, they have implemented individual certificates to each machines, so once I enter my application URL and hit enter_key, the URL is redirected to an internal server and I need to provide the Userid and Password to Log in.
This Scenario works well in chromedriver but when i'm using phantomjs, the elements are not getting recognized.
I tried to take the screenshots but only blank image came in the screenshot.