@ Then ( "^I save content of element in index '(\\d+?)' in environment variable '(.+?)'$" ) public void saveContentWebElementInEnvVar ( Integer index , String envVar ) { assertThat ( this . commonspec , commonspec . getPreviousWebElements ( ) ) . as ( "There are less found elements than required" ) . hasAtLeast ( index ) ; String text = commonspec . getPreviousWebElements ( ) . getPreviousWebElements ( ) . get ( index ) . getText ( ) ; ThreadProperty . set ( envVar , text ) ; }
Takes the content of a webElement and stores it in the thread environment variable passed as parameter