Get Text from Page and Store in Variable

How do I grab text from an element on the page, store that in a variable, and then add it to a url to navigate to?

Comments

  • Hi Josh,

    Below is the script,Hope this works for you.
    Fetch Feature element from page and navigate to Feature page
    https://katalon.com/Feature

    WebUI.openBrowser('')

    WebUI.navigateToUrl('https://katalon.com/')

    WebUI.verifyElementPresent(findTestObject('Page_Katalon Studio - Simple Power/a_Features'), 7)

    attribute = WebUI.getAttribute(findTestObject('Page_Katalon Studio - Simple Power/a_Features'), 'text')

    println(attribute)

    Strattribute=WebUI.concatenate(['https://katalon.com/', attribute] as String[],
    FailureHandling.STOP_ON_FAILURE)

    println(Strattribute)

    WebUI.navigateToUrl(Strattribute)

Sign In or Register to comment.