Cross browser testing using selenium python - python

I have written a cross browser testing test script using selenium python.
while running the test script in chrome it is working fine,
but running the code in Firefox its opening the browser and launches the application but after that it shows like (Move Target Out Of Bounds Exception) error it throws why? even it is working fine in the Microsoft edge also. but not in Firefox driver.

Related

Is there a way to get python scripts working on ubuntu server?

my problem is, that I wrote some python scripts, which are working fine. Now I have to get them to work on an ubuntu server. The problem is, that I need to use the chromedriver (selenium) and ofc there cant be an open browser at the server. So is there a way to use selenium with a server?
What you need is called 'Headless' editions of a browser.
These headless browsers don't open up as a browser but run in the background for you to perform scripts on.
Try searching for Headless + 'The browser driver you use'
Here is a quick tutorial to get you started: https://medium.com/#pyzzled/running-headless-chrome-with-selenium-in-python-3f42d1f5ff1d

How do you run Chrome while selenium headless script is executing on mac?

I have a python selenium script that uses chromedriver in headless mode to test links on a website. I'm running this script on MacOS High Sierra.
If I have Chrome open prior to running the script, I can continue to use the browser normally. Headless mode appears to isolate me from the testing. However, if Chrome is closed first, I cannot launch the browser while the selenium script is running.
Looking at Activity monitor in the first scenario, it appears to me that chromedriver creates a new process for Chrome to run. So I (perhaps incorrectly) assumed I should be able to launch the browser manually while the script is running.
What am I missing?
How do I launch Chrome while selenium is running on Mac?
Ah-HA!
This post I stumbled upon made it possible to open Chrome while selenium is running (although I don't understand why it works one way but not the other).
For most applications, launching with open -naF "App Name" or open -nF
/path/to/application.app should be sufficient (see Safari, Forklift,
Office apps, etc.).
-n opens a new instance
-a tells open to look in the list of registered apps (no need to specify the full path, but can go wrong if you have multiple versions
of an app. I sometimes see issues on my system with differentiating
between macOS apps and apps installed by Parallels OSes… I prefer to
specify the path directly.)
-F opens a fresh instance (ignores an app save state left over from previous instances)

Selenium Webdriver works fast when network/internet is turned off

I am facing a very peculiar issue with Selenium Webdriver. All of sudden my selenium scripts written in python have started to execute very slow in both firefox and chrome.
The script execution returns to its normal speed when I manually turn off the network/internet through my laptop's wifi button after a webpage is loaded. The same scripts run at normal speed on another computer (on my office network) where I connect to internet through VPN.
Another example is when I run my scripts on a locally stored webpage file (htm). The scripts run superfast when internet is turned off but run equally slow when the internet is turned on.
I do not use a proxy server.

Selenium test not running when started by Jenkins

I have some tests written in pytest with selenium webdriver. It points to a selenium grid browser node to run the test. When i run the test from local terminal (py.test test_login.py), it will connect to the selenium grid correctly, open up the browesr and run the test.
Switching over to Jenkins, we set a job to create a build and run the same selenium tests. However, it will open the browser (chrome or firefox) but it will not run the test, it just eventually failed with timeout error. Everything is on the same network and behind the firewall. Does anyone know why the test wont run when invoked from Jenkins? It doesnt seem to be a network issue as it was able to open up the browser on the grid node.

Selenium crashes Chrome when running from Jenkins

Hi used python selenium for Web Automation and launched that python script from jenkins in MAC.
It will load the Chrome and automation goes for some extent and get error message as
"Aw Snap" page comes up a few steps into the first test
How to fix it

Categories

Resources