[angular selenium java testNG] dropdown options sometimes loading , sometimes not

256 views
Skip to first unread message

cflin...@gmail.com

unread,
Jan 25, 2018, 9:45:30 PM1/25/18
to Selenium Users
I am working in a test framework that uses selenium webdriver, java, testNG to test an angular based application.  I am trying to select an option from a dropdown (a select element), but when using the webdriver in an automated script, the dropdown options don't load 70-80% of the time, I just see the select tag with no options.  I can not log the problem as a defect with our development team because the problem does not happen when running the scenario manually.  I have tried to increase the wait time for the dropdown options to render, but increasing the time does nothing, the dropdown remains empty when the options fail to load initially.  If I refresh the page the dropdown options load.  Has anyone had a similar problem?  There are ways to work around it, but I would like to solve the problem without "cheating" (refreshing the page)

Shawn McCarthy

unread,
Jan 25, 2018, 9:54:26 PM1/25/18
to Selenium Users
Maybe your wait is in the wrong spot. Try waiting before you get to the select. For example. If you click a link, then wait for the dropdown items, the select one, instead do : sleep before clicking link, then wait for the dropdown items, then select one. That initial sleep can just be a 5 second sleep to start with. This will tell you if a smarter wait is needed in that spot.

Bartek Okraszewski

unread,
Feb 14, 2018, 9:39:27 AM2/14/18
to Selenium Users
Are you using IE driver?
If yes, using 'select' it's breaking it. At least what we have encountered during tests angularjs2 + selenium + java+ ie. It's actually IE problem and how its wrapping website selects. We workaround it by development change + different approach to select in selenium (hard way, element by element). 
If not, then honestly I don't know. Maybe update of webdriver would solve?

akhilka...@gmail.com

unread,
Feb 15, 2018, 4:28:22 AM2/15/18
to Selenium Users
Could you please provide the work around that you are using? Page Refresh is not working for me.

akhilka...@gmail.com

unread,
Feb 15, 2018, 4:28:23 AM2/15/18
to Selenium Users
Could you please provide the work around that you are using? Page Refresh is not working for me.

Serguei Kouzmine

unread,
Feb 17, 2018, 2:18:46 PM2/17/18
to Selenium Users
Have you tried  existing java ports of Protractor ? It will allow you select Angular elemets by their Angular attributes like binding, model, repeater etc.
See 
Reply all
Reply to author
Forward
0 new messages