Home > Back-end >  Selenium Webdriver test removes input on button click
Selenium Webdriver test removes input on button click

Time:04-27

I am running into an issue with my selenium webdriver test where, if I input something into a phone number field and then click the call button, it will clear out the input and do nothing. However, if I run it in debug with a break point on one of my waits, it will run fine. The code is for a softphone application and I am just trying to input the phone number and then click the call button. I have narrowed the issue down to starting with line 302, but have no clue what it could be. Things I've tried: I have tried using waits, thread.sleeps, milliseconds, seconds, etc. I have tried moving the if statement out into an actions class where it is called from the test like my other actions are. I have tried getting rid of the if statement and just using waits and the code seems to just skip over them.

This is C# code. All of the PerformAction are referencing action classes that check to ensure that the element is visible/clickable. The action classes reference the elements. I have set my implicit wait to 0 so it should only use the explicit.

So my question is, how do I get my code to stop skipping the waits and/or stop clearing out the input field?

test code screenshot

CodePudding user response:

What ended up being the issue is that the elements were being checked for visibility/clickability before they were gotten to in the test. This made the functionality weird and skippy. Adding a sleep before checking the elements in my action methods seems to have resolved the issue.

  • Related