How to copy and paste text in seleniumIDE

4,270 views
Skip to first unread message

arvind

unread,
Aug 8, 2007, 7:48:47 AM8/8/07
to selenium-users...@googlegroups.com
Hi,

I am new to selenium, in a test case I want to select some part of the text on a web page, copy it, and have to paste it in a text box on next page. As text to be copied changes every time I run the test case.

Please help me how can I perform the above steps in seleniumIDE.

Thanks

Dianne

unread,
Aug 8, 2007, 9:51:12 AM8/8/07
to selenium-users...@googlegroups.com
I believe you want to use one of the "store" commands to store the text from the page into a variable and then when your script moves to the next page, use the "type" command with your variable.

Here's an example that pulls the value from the "username" field of the page, stores it in the variable named var_username_to_type, and then puts it in the "newfield" field of the next page:

storeValue | username | var_username_to_type
{code:html}<commands to click to next page>{code}
type | newfield | ${var_username_to_type}

Look up the "store" commands in the reference manual as there are various options to store (storeTable, storeText, storeValue, etc.)
I hope that helps.

Dianne

Message was edited by: ddaims (additional info for clarity)

arvind

unread,
Aug 9, 2007, 9:30:25 AM8/9/07
to selenium-users...@googlegroups.com
Hello Dianne,

Thanks,

I tried "storeText", it is storing the complete value of the element but I want to store only a part of it. For example, of value '09-Apr-EDS-2-BUY' I want to store only '09-Apr-EDS-2'; also this value is dynamic and changes every time.
Please guide how can I achieve this.

Regards,
Arvind

Dianne

unread,
Aug 9, 2007, 12:28:00 PM8/9/07
to selenium-users...@googlegroups.com
I haven't done what you're asking about but I quickly searched the forum and found the following thread that may be helpful.

http://forums.openqa.org/thread.jspa?messageID=24571&#24571

Good luck.

Dianne

Reply all
Reply to author
Forward
0 new messages