I use Selenium with PHPUnit, and sometimes test fail with an error condition which seems to be caused by the browser ignoring clickAndWait calls. The test execution passes the clickAndWait command without much delay (even if I set a large timeout), and the next assertion or element access fails; if I make a screenshot, it shows the previous page as if the click command did not happen at all. This happens both with links and with submit buttons (both normal, no javascript: or similar trickery), non-deterministically. It seems to happen more often on certain controls than others (many are not affected at all), and the frequency of tests failing seems more or less contant in the short term, but changes wildly in the long term (sometimes it is 1 in 100, sometimes 1 in 2). I am guessing it is influenced by some sort of server load, but could not see any obvious correlation.
Click does not always work in Selenium
418 Views Asked by Tgr At
1
There are 1 best solutions below
Related Questions in SELENIUM
- Can't get Selenium element
- Trying to find HREF from table with Selenium in Python
- Python | How i get the link of products that doesn't have href with selenium
- Selenium works only when I'm connected to a remote server
- Logging in automation using Selenium requests / responses- why it wont work?
- Why can't I scrape data from etherscan
- TypeError: 'SwitchTo' object is not callable
- Why driver.get doesn't work in Python Selenium when using Profile
- Trying to fill out an online form using selenium but it can't find the element
- Targeting Accept Policy With Selenium
- Python Selenium - Select Options not returning all the options
- Spraping data from a table is slow but uncertain why
- Unable to convert byte[] image to base64 using cucumber scenario api's - java selenium
- Selenium WebDriver - google account login problem using python
- Click on login button using Selenium
Related Questions in PHPUNIT
- CakePHP2-PHP8 - Tests with PHPUnit ^9.5
- JobQueued event not being fired in test Laravel 11
- Laravel 11 PHPUnit tests Passport install
- How can I repair the "Latest compiled component path not found" error when testing my Laravel 10 app?
- phpunit partial mock laravel service with parameters in constructor
- Mocking inherited class where new object is created or how to unsmell my class
- phpunit only mock one method of a class
- Symfony Phpunit keeps using actual class instead of mock
- How does Laravel phpunit test assertion "$this->assertAuthenticatedAs($user, $guard = null)" work?
- Warning: XDEBUG_MODE=coverage or xdebug.mode=coverage has to be set
- Can I debug PHPUnit tests in IntelliJ/PhpStorm from devspace or kubectl?
- PhpStorm | PHPUnit | Feature test | Xdebug | Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)
- Running PHPUnit from Eclipse result in 0 % for code coverage
- Kohana - HTTP Tests
- PHPUnit Data Provider error: ArgumentCountError: Too few arguments to function, 0 passed in, and exactly 2 expected
Related Questions in NON-DETERMINISTIC
- Non-Deterministic behavior in PDF library when accessing Django model in between
- Order of callbacks: setTimeout and ResizeObserver
- Haskell. Not seeing laziness despite using list-t's ListT (State s)
- Redundancy in comparison sort / tournament systems
- yocto programmatically asigned SRCREV trigger metadata not deterministic
- Convert Nondeterministic Finite Automata to Regular Expression
- Can I get an ORDER BY with several columns but still deterministic?
- How do I invoke firebase cloud functions within the client using HTTP if the functions URLS will change depending on environment?
- Is there a way to save execution of ruby code to debug it using step by step replay later?
- How to provide non-determinist value (id, dates, random...) to Domain Entity or Aggregate Root given that its been injected as dependencies
- Are there PRECISE RULES to know when MySQL will apply gap blocking?
- Temporarily storing tables with variable amounts of columns
- Using printf with MPI leads to non-deterministic output
- Confusion on the Syntax of a Python Module named automata.pda.npda within automata -lib
- Is UUID's hashValue non-deterministic?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
I work more with Selenium 2 but I have noticed this as well. In my case I suspect other system clicks were interfering with Selenium (purely speculation) since I ran the tests on my machine.
The way I solved it was to instead send a key press of the Return key. For most cases this is equivalent to a click and in my experience has created more stable tests.
A quick caveat is that this technique stopped working for me after version 2.3.0. I submitted a bug report about it if you want to take a look.