Selenium chromedriver is not working(Python) - python-3.x

I am trying to create a program to automate my Chrome browser. But the selenium chrome driver is not working. It opens up chrome for 1-2 seconds and then automatically canceled. Then it gives these errors.

You have a basic syntax problem.
Try this:
from selenium import webdriver
driver = webdriver.Chrome('D:\python projects\chromedriver.exe')
driver.get("https://www.youtube.com")

That error means your Chromdriver.exe is not updated based on your Google Chrom version.
In the error says your version of Google Chrome is 90.0.443.212.
Here: https://chromedriver.chromium.org/ you can download the chromedriver.exe
Download the chromdriver and then replace it, this should do the work.

Related

Selenium IDE (from Edge Browser extension) exported scripts (python) don't run correct

I exported bunch of Python scripts from the recorded session on Selenium IDE (from Edge Browser extension).
What I noticed that same .side file works fine through Selenium IDE , but they break on lot of Elements not found when run the exported Python Script by itself.
Is it possible to have some settings under Selenium IDE to add some WebDriverWait command so exported python script could add those automatically ?
I am sure internally Selenium IDE does wait for element to be present.
Thanks

robot framework python unable to open browser

I am new to robot framework python, I am using eclipse RED editor.
*** Settings ***
Documentation Simple example using SeleniumLibrary.
Library SeleniumLibrary
*** Test Cases ***
MyFirstTest
Log Hello World...
FirstSeleniumTest
Create Webdriver chrome executable_path=/Users/ljames/Downloads/chromedriver
Open Browser https:google.com chrome
Close browser
I am seeing following error msg:
TypeError: 'module' object is not callable
I am using mac. how to fix it? "Chomedriver" file exist in the Downloads path mentioned above.
Try changing the driver_name from chrome to Chrome. (Only with Open
Browser Keyword, the browser_names are case-insensitive). Make note- Create webdriver keyword is mostly followed by Go to, since you have already created your driver instance.
In addition to what aravinth_2442 has said, you also have a wrong URL as an argument to Open Browser keyword. It might be just a typo here in your question, but you should correct it as well to:
Open Browser https://www.google.com Chrome
You can see the official documentation here: https://robotframework.org/SeleniumLibrary/SeleniumLibrary.html#Open%20Browser So make sure, you type correctly the names of browsers, they are case-sensitive.

Using selenium chrome browser in background (not headless mode)?

I want to run my python script which uses selenium to do some work. I need to test the code repeatedly and need to use the terminal as well. Thus the chrome window bugs me when it opens up in the foreground everytime. Also, I can't use the headless mode since my script crashes.
Is there any solution for this ??
You can minimize window after selenium started
from selenium import webdriver
driver = webdriver.Chrome()
driver.minimize_window
driver.get("your_pages")

Selenium does not load site at all

I can't load a site. Selenium starts when I run my code (aka the specified browser opens - in this case Firefox) but absolutely nothing happens! I just have a blank browser. My code is as follows:
from selenium import webdriver
driver = webdriver.Firefox()
driver.get('http://isol.alachuaclerk.org/RealEstate/SearchEntry.aspx')
I can load the site manually in Firefox but Selenium/geckodriver can't. What's going on?!
I still do not know what the issue is. Not really a fix but rolling back a few geckodriver versions solved this. Why the latest geckodriver doesn't load this site but an older version does is beyond me.

using selenium to start firefox suffer KeyError: 'sessionId'

When I'm using selenium to start firefox, it suffers such a problem. I just write a simple demo to test, by failed.
Have you tried to update your Selenium version to version 3.3.0 ?
I had the same problem as yours : changing the proxy settings as mentioned elsewhere did not work, but updating selenium was the solution.
Mac OS X Solution
If updating did not work for other people, i suggest looking at my answer Why doesn't Selenium's response have a sessionId?

Resources