How do you troubleshoot an Ajax call that never seems to complete in Selenium running in a headless environment?
I'm running Selenium 3.0.1 from a Django unittest to confirm content gets dynamically loaded via Ajax when buttons are clicked. My test's setUp() initializes Selenium with:
p = webdriver.FirefoxProfile()
p.set_preference("webdriver.log.file", "/tmp/firefox_console")
self.driver = webdriver.Firefox(p, capabilities={'marionette': False})
self.driver.implicitly_wait(20)
These tests run perfectly on my localhost, but when I run these tests on a headless integration server using Xvfb, they always fail, timing out looking for the IDs of the Ajax content that apparently never seems to populate.
I'm completely stuck with how to diagnose the problem. Is there something with Selenium+Firefox+Xvfb that causes Ajax calls to fail? Or are they succeeding, but the dynamically created elements are just not visible to Selenium?
I tried increasing the virtual screen resolution, to better simulate my localhost, with:
self.driver.set_window_size(1920, 1080)
but that seemed to have no effect.
I can't find any documentation on reading the status of Ajax calls from Selenium. Is this possible?
What other reason would Selenium not work on a headless server?