How to handle Selenium script behaving differently than manual test?

229 views
Skip to first unread message

Ramsen C

unread,
May 9, 2017, 12:37:52 PM5/9/17
to Selenium Users

Ever since Chrome 58 (w/ latest chromedriver) my script produces different behavior compared to manual testing. 


Manual: Click, pop under tab, tab is closed, pop under window opens 


Automated: Click, pop under tab, nothing further happens


It does not matter if the click is made with JS, standard selenium click, Actions click, or autoIT. They all produce the automated behavior listed above. This is not an issue of wait times as I can debug and go through each line step by step and reproduce the issue. If I put a break point before the click is made and do the click myself, it works as expected. 


How can I debug an issue like this?

Ramsen C

unread,
May 9, 2017, 12:38:06 PM5/9/17
to Selenium Users
For my specific issue a click is made and a pop up is expected, but the pop up behaves differently if the script makes the click. If I breakpoint right before the click, and manually click the link, it works as expected. I'm not sure how to handle issues like these in general. How should I go about researching this and hopefully finding a work around?

David

unread,
May 9, 2017, 3:47:29 PM5/9/17
to Selenium Users
That is rather strange that doing this through AutoIt would also result in the issue. I can understand issues with Selenium via native APIs or via JS, but AutoIt, wow.

Could it be a timing problem, the automation tools are clicking too fast, right after the previous test action? Try adding a 1+ second sleep before the automated click to see if that helps.

Worst case, could you not just bypass the click and either directly call the JS code that the click invokes or have the test code manually open up the popup in same tab/window or as new window/tab (via custom JS or Selenium API)? With test automation, you don't always have to test exactly the way you do the manual test unless you're specifically testing the click of that link/button/image or testing the browser and not your app.
Reply all
Reply to author
Forward
0 new messages