Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8993717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:15:18+00:00 2026-06-15T23:15:18+00:00

@Grapes([ @Grab(org.codehaus.geb:geb-core:0.7.2), @Grab(org.seleniumhq.selenium:selenium-firefox-driver:2.25.0), @Grab(org.seleniumhq.selenium:selenium-support:2.25.0) ]) import geb.Browser import org.openqa.selenium.firefox.FirefoxDriver Browser.drive { go http://www.asu.edu/ $(li

  • 0
@Grapes([
    @Grab("org.codehaus.geb:geb-core:0.7.2"),
    @Grab("org.seleniumhq.selenium:selenium-firefox-driver:2.25.0"),
    @Grab("org.seleniumhq.selenium:selenium-support:2.25.0")
])
import geb.Browser
import org.openqa.selenium.firefox.FirefoxDriver

Browser.drive {

  go "http://www.asu.edu/"
  $("li a").each { a ->
     println(a.text())
  }

}

I’m trying to grab all links(as represented by a tag) from web pages using the Geb framework. But I failed to capture those links in dropdown lists. Take this page for example, I was not able to capture dropdown lists under Colleges & Schools and Map & Locations. In the output of the code above, each item in the dropdown lists was “an empty string” occupying one line. The beginning part of the output is as follows:

SIGN IN
ASU Home
My ASU
Colleges & Schools















Map & Locations











Contact ASU
Freshman
Transfer
Graduate
International
Military | Veteran
Home-Educated
Online
Prospective Students
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T23:15:19+00:00Added an answer on June 15, 2026 at 11:15 pm

    This is because you can only get text of elements that are visible. This is so that text() returns only text that is visble to the user.

    Looks like that dropdown is styled to open when :hover pseudoclass is applied to it. There is drag and drop support in Geb and moveToElement action you could use to point the cursor to the element but it doesn’t seem to work – I found some thread suggesting that Firefox driver doesn’t handle it well. Unfortunatelly it is not possible to simulate :hover currently with jQuery so your only option is to use Geb’s jQuery integration to manualy make the element visible:

    $('#asu_universal_nav li', 2).find('ul').jquery.show()
    

    After that the text in your links should be returned when calling text(). Another option is to make the dropdown visible not only when :hover but also when a class is applied and add/remove that class in mouseenter/mouseleave handlers. But that’s only possible if you can modify the app that’s serving the page you’re automating/testing.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

@Grapes([ @Grab(org.codehaus.geb:geb-core:0.7.2), @Grab(org.seleniumhq.selenium:selenium-firefox-driver:2.15.0), @Grab(org.seleniumhq.selenium:selenium-support:2.15.0) ]) import geb.Browser Browser.drive { // Load the page go
This seems to work: @Grapes([ @Grab(org.codehaus.geb:geb-core:0.7.2), @Grab(org.seleniumhq.selenium:selenium-htmlunit-driver:2.25.0), @Grab(org.seleniumhq.selenium:selenium-support:2.25.0), @Grab(org.seleniumhq.selenium:selenium-firefox-driver:2.25.0) ]) import geb.Browser import org.openqa.selenium.firefox.FirefoxDriver
I have a script where a method is annotated with the @Grab annotation @Grab(group='org.codehaus.groovy.modules.http-builder',
For declaration perspective the following is allowed IList<string> list= new string[3]; list.Add(Apple); list.Add(Manago); list.Add(Grapes);
For example : File 1: Apple Orange grapes File 2: Orange grapes Apple I
I have a string that contains something like this: apple orange pear grapes And
I have a has_many :through model that works perfectly. has_many :varietals has_many :grapes, :through
I need to create a Chart which will grab data from external sources when
Suppose I have this list: thelist = ['apple','orange','banana','grapes'] for fruit in thelist: This would
I have $_GET['tags'] = apples, oranges, bananas, grapes, cherries I need to place the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.