开发者

How to store an array returned by javascript function split in Selenium IDE

开发者 https://www.devze.com 2023-03-24 16:37 出处:网络
Not a developer, new to Selenium IDE, and yes, limited to sticking with IDE only. Appreciate any and all help.

Not a developer, new to Selenium IDE, and yes, limited to sticking with IDE only. Appreciate any and all help.

Trying to grab a password from an email generated upon Password Reset so the script can then log in with the new password.

Thought I'd do a split on a 开发者_Python百科delimiter in the email content, Trim as necessary to grab the password. Running into problems with how to store the returned array. In order to do what I'm thinking, I need to store it back into an array that Selenium can traverse.

storeText | css=body | emailText

getEval | storeResults = javascript{storedVars['emailText'].split("delimiter")}

The getEval throws an "missing ; before statement" exception. Using method store instead of getEval works (and moving storeResults to a target), but then the results are typecast as a string. I feel I'm missing something very basic here.


I think the keyword javascript must be omitted

For me the following code works: storeText | //*[@id="_currentProduct"] | myText getEval | alert(storedVars['myText'])

When run the alertbox has the value of myText.


Thanks for the response. I came to the same conclusion. Here's the working code:

getEval | storeResults = storedVars['emailText'].split("delimiter")

Was able to access the stored value this way: LOG.info(storeResults[1])

0

精彩评论

暂无评论...
验证码 换一张
取 消