Selenium: Getting 404 error with ChomeDriver browser but not Chrome - selenium

I have a weird problem going on with a Selenium test. I have an internal company website that I'm writing a Selenium test for and am getting a 404 error ONLY with the browser instance that Selenium opens up. It doesn't matter if its Chrome or Firefox, I still get the 404.
To prove its only with the browser instance that Selenium opens I have run my test in debug mode, paused it when the browser launches and then manually executed the test case within that browser instance and I always get a 404.
Now, if I open a normal Chrome or Firefox browser instance outside of Selenium I can manually execute the test case just fine.
Manual execution of the test case in Chrome Incognito also works.
What am I missing here?
Apparently something else needs to be loaded with in the browser but I have no idea what. Any help would be greatly appreciated.

I found that we had a redirect problem on our server, however it still doesn't make sense as to why it failed in WebDriver but not in a normal browser. Either way, its resolved.

Related

Causes of Selenium Chrome to Many Redirects Error When Chrome Works Manually

I am writing a selenium test which generates to many redirects error; yet, I can manually perform the test. The test fills in a userid and password and presses a login button. I had implemented this test on Chrome 96; however, it doesn't seem to work on chrome 99. I am using selenium 4.1.1. Additionally, the site switched to http/2 during this period. I appreciate any ideas on what the issue might be.

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.

How to get redirected urls on a headless server

Please suggest a method of getting final urls after redirection in an automated way. It has to run on my headless Ubuntu server.
Selenium will only start a browser in headless mode on this server, else error:
opts = FirefoxOptions()
opts.add_argument("--headless")
But this way the .current_url method on a webdriver instance does not get the redirect, whereas on my PC with normal display mode I am getting the redirect correctly.
Solving this with tools other than Selenium would be great, too.

selenium issue while using InternetExplorerDriver

i am using selenium 1.0.2 for my automation test cases, when i try to execute it from ie browser ,its launching , but its failing when hits driver. findelements or even waituntil saying
The HTTP request to the remote WebDriver server for URL http://localhost:39208/session/61215720-0870-47fa-a50b-ac97fb8b7bbc/window_handles timed out,
but same test case is passing in chrome. also have found the in ie it passes if i use the url - http://omnichannelint.blob.core.windows.net/convcontrol-daily/HTML/AgentWidgetWithMock.htm , failes when i use file:////C:/WebResources/HTML/AgentWidgetWithMock.htm have tryed same in localhost:8080 then also it fails, please any one help me fix this issue

Is Phantomjs session isolation still not working?

When I run my selenium tests using a chrome browser all my tests cases run fine. When using the phantomjs browser it would appear that the browser session does not get reset after each test case. In my tests cases, I log in as a user to then navigate to certain pages and then logout. A problem occurs when a test case happens to fail. The browser session is not reset so when the next test case begins, the test that failed was unable to logout. This causes all test cases after a single failure to fail.
When searching the internet for a solution to this issue it been known sine 2013. I can't seem to find anything regarding this issue that's recent. Is there any up to date workarounds?
Manually trying to delete the cookies before or after each test case does not appear to work. webDriver.manage().deleteAllCookies();
I'm using phantomjs ver 2.1.1.
First of all PhantomJS is dead, you are better off switching to Headless Chrome or Headless Firefox.
Secondly PhantomJS is a port of Webkit which is not thread safe. This means that if you try and run more than one test in parallel you will see threading issues, to fix this you would need to start multiple instances of PhantomJS and have each GhostDriver instance connect to a different instance of PhantomJS.
The particular problem that you are seeing is that PhantomJS doesn't clear itself down properly, again the only solution would be to kill the initial PhantomJS instance you are running after your test finished and then start up a clean new one, unfortunately that is not supported by GhostDriver.
The final problem is that GhostDriver is dead as well, there was no point in continuing development when PhantomJS died.
TLDR; Use Chrome/Firefox Headless mode instead.