Groups
Groups
Sign in
Groups
Groups
NightwatchJs
Conversations
About
Send feedback
Help
CSS selectors: How can I get the last element?
625 views
Skip to first unread message
Alex Schenkman
unread,
Apr 30, 2015, 10:41:50 AM
4/30/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to nightw...@googlegroups.com
Hi Nightwatchers,
In jQuery I can do
$("someCSSselector:last)
And mozill has
:last-child
.
None of these seem to work with Nightwatch and Selenium.
How can I achieve the same behaviour?
Thanks in advance!
Ellen Wong
unread,
Apr 30, 2015, 4:49:31 PM
4/30/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to nightw...@googlegroups.com
:last-child should work.
browser.click('ul.example li:last-child')
This should click the last <li> element in the <ul> with class 'example'.
Alex Schenkman
unread,
May 4, 2015, 2:35:27 AM
5/4/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to nightw...@googlegroups.com
Thank you Ellen!
:last-child did indeed work.
I was using it wrong.
Reply all
Reply to author
Forward
0 new messages