Niru
Niru

Reputation: 23

How can I store a dynamic text value in selenium ide and use it later in different window

I am new in selenium and trying to learning. I am creating a script and I got stuck here, I want to store a dynamic value from text message on web page ex. " Event Name:Test" this Event Name is dynamic and I want to store this and want to get in other window. In 2nd window i want to use this value(Test) to verify in the page I tried storeValue, StoreText and storeAttribute command and getting error message for xpath or "element not found". Please help me and advice me , what should I do? Can You please suggest me the Xpath for storing and retrieving the event name. Please help me...

Thanks in advance, Niru

Upvotes: 2

Views: 17317

Answers (1)

Varun Menon
Varun Menon

Reputation: 390

If you are using the same test-case to navigate from page 1 to page 2 you can use the storeText function in the IDE to store the value of your event name. And then you can use the same variable in the page 2 for verification.

For example, in page 1 to store the value of event you use:

storeText(locator1, temp)

And then on page 2 you use assert:

assertText(locator2, ${temp})

Upvotes: 2

Related Questions