Get text and set it to a textbox

HI GUYS PLEASE HELP
I want to get text and set it to a textbox but DIFFERENT URL

i have no idea on doing that , please help

1 Like

Store the get text step in a variable, that will keep whatever the value is that you have got. Then in the set text box just use the variable as the value you want to set :slight_smile:

1 Like

String attribute = WebUI.getAttribute(findTestObject(Your object), value)
WebUI.navigateToUrl(‘url’)
WebUI.waitForElementVisible(findTestObject(Your object),10)
WebUI.setText(findTestObject(Your object), attribute)

That pretty much it.

3 Likes

the value is dynamic ,

1 Like

thanks will try it out , looks good

1 Like

String attribute = WebUI.getAttribute(findTestObject(Your object), value)

which value are you talking about

1 Like

It depends of your object.
But given the original question, you can use

WebUI.navigateToUrl('url-1')
text = WebUI.getText(findTestObject('Object1'))
WebUI.navigateToUrl('different-url')
WebUI.setText(findTestObject('the textbox object'), text)
2 Likes

“value” is the attribute for most common object which store the text of an object. I assume “value” is the attribute we wanted to get here. Basically, every object as attributes, and getAttribute() let us choose which one we want to get.

1 Like

Please provide more information (which field are you trying to get text from? what does the HTML for the field look like?). Without more concrete information on what you’re trying to do, everyone is forced to make assumptions that may or may not be correct: