who can help me with groovy geb element locate?

343 views
Skip to first unread message

w...@cn.tradeshift.com

unread,
Jan 10, 2017, 4:26:03 AM1/10/17
to Geb User Mailing List
HI Everyone,

I am new to groovy geb,and for below HTML code,who can tell me how to locate the button element?seems that it uses angular js.I tried different way,can not click this button.

<button class="ui-btn ui-btn-secondary" ng-click="uiAside.show('add-invoice-aside')"> 发票录入 </button>

Yori Kurita

unread,
Jan 10, 2017, 5:37:03 AM1/10/17
to Geb User Mailing List
Hi,

try : button { $('button.ui-btn.ui-btn-secondary') }

Mike Wang

unread,
Jan 10, 2017, 8:18:54 PM1/10/17
to geb-...@googlegroups.com
HI  Yori

Thanks for your reply,but below exception poppued up:
Caught: org.openqa.selenium.WebDriverException: Element is not clickable at point (720, 342). Other element would receive the click: <div style="opacity: 0.8; z-index: 5000;" class="ui-backdrop visible ng-scope"></div>
Command duration or timeout: 61 milliseconds

--
You received this message because you are subscribed to a topic in the Google Groups "Geb User Mailing List" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/geb-user/SO4pXsKUcIo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to geb-user+unsubscribe@googlegroups.com.
To post to this group, send email to geb-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/geb-user/9d81e9fe-d1fd-4d52-955e-fb6e3f16a3e1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Mike Wang
QA Engineer


BAIWANG TRADESHIFT
All your suppliers. All in one place
tradeshift.com ׀ tradeshift blog

Yori Kurita

unread,
Jan 23, 2017, 12:18:15 PM1/23/17
to Geb User Mailing List
Hi Mike,

from this its difficult to say exactly what happens, but my guess is that there is a concurrency problem. 
Try waiting until the button is clickable. Or until the mentioned element is gone

static content = {
  button { $('button.ui-btn.ui-btn-secondary') }
  div { $('div.ui-backdrop.visible.ng-scope') }

}

def clickbutton() {
waitFor { !div.displayed }
button.click()
}


Regards

Yori

Am Mittwoch, 11. Januar 2017 02:18:54 UTC+1 schrieb Mike Wang:
HI  Yori

Thanks for your reply,but below exception poppued up:
Caught: org.openqa.selenium.WebDriverException: Element is not clickable at point (720, 342). Other element would receive the click: <div style="opacity: 0.8; z-index: 5000;" class="ui-backdrop visible ng-scope"></div>
Command duration or timeout: 61 milliseconds
On Tue, Jan 10, 2017 at 6:37 PM, Yori Kurita <yorik...@gmail.com> wrote:
Hi,

try : button { $('button.ui-btn.ui-btn-secondary') }

Am Dienstag, 10. Januar 2017 10:26:03 UTC+1 schrieb w...@cn.tradeshift.com:
HI Everyone,

I am new to groovy geb,and for below HTML code,who can tell me how to locate the button element?seems that it uses angular js.I tried different way,can not click this button.

<button class="ui-btn ui-btn-secondary" ng-click="uiAside.show('add-invoice-aside')"> 发票录入 </button>

--
You received this message because you are subscribed to a topic in the Google Groups "Geb User Mailing List" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/geb-user/SO4pXsKUcIo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to geb-user+u...@googlegroups.com.

To post to this group, send email to geb-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/geb-user/9d81e9fe-d1fd-4d52-955e-fb6e3f16a3e1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Brian Kotek

unread,
Jan 23, 2017, 1:39:02 PM1/23/17
to Geb User Mailing List
It can also happen if something is moving/animating/fading, if the element moves or is otherwise blocked from being clicked by another element.

--
You received this message because you are subscribed to the Google Groups "Geb User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geb-user+unsubscribe@googlegroups.com.

To post to this group, send email to geb-...@googlegroups.com.

Mike Wang

unread,
Jan 25, 2017, 12:10:40 AM1/25/17
to geb-...@googlegroups.com
Does anyone know how to do data-driven testing with groovy geb?eg,like using excel to store data?

To unsubscribe from this group and all its topics, send an email to geb-user+unsubscribe@googlegroups.com.

To post to this group, send email to geb-...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Yori Kurita

unread,
Jan 25, 2017, 8:24:45 AM1/25/17
to Geb User Mailing List
To unsubscribe from this group and stop receiving emails from it, send an email to geb-user+u...@googlegroups.com.

To post to this group, send email to geb-...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Geb User Mailing List" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/geb-user/SO4pXsKUcIo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to geb-user+u...@googlegroups.com.
To post to this group, send email to geb-...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages