I'm having some problem with elements not loading properly on the ChromeDriver
page using selenium in my Django application.
I dumped Django's testing tool because in my scenario, I need the whole loaded database. And doing a load fixtures would be too time-consuming to start the tests. So I use a cloned production base, everything I create I delete at the end of the tests (and delete before also in case of some error in the script).
The script works perfectly, it gets every single element right, but visually it's horrible. Some elements turn black, most (if not all) texts disappear (become invisible), etc. I can not see multiple actions visually on ChromeDriver that it opens because of that.
I researched a lot and did not see anyone with this problem. I was not, as I used Django's own tests.
What I did was create a new command in Django to continue accessing the models, running chrome normally.
It does not make any errors, just the browser window that opens, keeps the elements not loaded perfectly.
Versions
ChromeDriver: 2.40
selenium==3.13.0
Django 2.0
My code
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from django.conf import settings
from django.core.management.base import BaseCommand
chromeOptions = Options()
chromeOptions.add_argument("--kiosk")
browser = webdriver.Chrome(settings.BASE_DIR + '/chromedriver', chrome_options=chromeOptions)
class Command(BaseCommand):
help = 'Comando de testes'
def handle(self, *args, **options):
browser.get('https://pt.stackoverflow.com/')
...
update
I'm inserting an image and adding reward to get some feedback. The problem persists. I tried updating version of chromedrive, selenium, etc. I think the problem is related to selenium running in a Python Command.
As you can see in the image below, the buttons (blue and gray) are not are showing their texts, the 2 selects are not showing values, the images are with a black background as all images from the site (I took a print only of a piece for the sake of confidentiality).