質問

I have gone through several posts and tried several things but I cannot grab the value from a span element in Geb (refer to my other post: How to grab the value of the span element using jQuery )

There is an example in Geb manual stating that $('span').text() should work but it is not supported at all.

Does anyone know if there is a bug in Geb implementation.

I'm using version-0.9.0 for Geb-Spock

役に立ちましたか?

解決

I just tested with

page.$('span')[2].text()

And it works fine (grails 2.2.3, geb 0.9.0, spock-grails-support:0.7-groovy-2.0) if you have more than one span in the page, you will get the content of the first one in your page if you don't specify an index.

Please provide some stack trace or error message to back your claim, as with what you have provided it is quite hard to help you.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top