Quantcast
Channel: Grafikkarte – Seite 6 – mynethome.de
Viewing all articles
Browse latest Browse all 63

Browser UI Testing with Geb: Select first element of dropdown

0
0

Another short note regarding browser automation / web testing with geb:

If you want to select the first element of a dropdown element (aka <select>) but you don’t know the title nor the label as the element are fetched from the volatile test-env database, this might help:

        new Select($("select#ImportantEntity").firstElement()).selectByIndex(1)

It works by combining the geb selector with the native selenium webdriver API (see book of Geb), in this case the Select class from Selenium.

That might be useful in the context of angular.js 1.4 as there have been breaking changes in how option elements are generated and a simple select.value("1") stops working.

Happy testing :-)


Viewing all articles
Browse latest Browse all 63

Latest Images

Vimeo 10.7.0 by Vimeo.com, Inc.

Vimeo 10.7.0 by Vimeo.com, Inc.

HANGAD

HANGAD

MAKAKAALAM

MAKAKAALAM

Doodle Jump 3.11.30 by Lima Sky LLC

Doodle Jump 3.11.30 by Lima Sky LLC

Doodle Jump 3.11.30 by Lima Sky LLC

Doodle Jump 3.11.30 by Lima Sky LLC

Vimeo 10.6.2 by Vimeo.com, Inc.

Vimeo 10.6.2 by Vimeo.com, Inc.

Vimeo 10.6.1 by Vimeo.com, Inc.

Vimeo 10.6.1 by Vimeo.com, Inc.

Vimeo 10.6.0 by Vimeo.com, Inc.

Vimeo 10.6.0 by Vimeo.com, Inc.

Re:

Re:





Latest Images

Vimeo 10.7.0 by Vimeo.com, Inc.

Vimeo 10.7.0 by Vimeo.com, Inc.

HANGAD

HANGAD

MAKAKAALAM

MAKAKAALAM

Doodle Jump 3.11.30 by Lima Sky LLC

Doodle Jump 3.11.30 by Lima Sky LLC

Doodle Jump 3.11.30 by Lima Sky LLC

Doodle Jump 3.11.30 by Lima Sky LLC

Vimeo 10.6.1 by Vimeo.com, Inc.

Vimeo 10.6.1 by Vimeo.com, Inc.

Vimeo 10.6.0 by Vimeo.com, Inc.

Vimeo 10.6.0 by Vimeo.com, Inc.

Re:

Re:

Re:

Re: