Question

how to get information from getAttribute method in Openspan Robotic studio

how to get information from getAttribute method in Openspan Robotic studio e.g. text box appeared in the webpage. I want to access style attribute, which contains color , font etc and I am interested in getting color of font.

***Moderator Edit-Vidyaranjan: Updated Platform Capability***

Comments

Keep up to date on this post and subscribe to comments

Pega
November 11, 2019 - 8:22am

I am not sure what you mean. The GetAttribute method accepts an "attributeName" as an input. Given a text box like the password field at training.openspan.com with the following HTML;

<input name="user_pass" class="input_text" id="user_pass" onkeyup="return checkLengthP();" type="password" size="50" placeholder="Password">

if you passed "size" to that method, it returns 50 as expected.

November 18, 2019 - 3:10pm

How about style, My application contains border information like color in it. I tried to retrieve it but it gives me an object I don't how to retrieve info from object.

 

Pega
November 21, 2019 - 4:15pm
Response to dharmpals0253

I would need to see a specific example. Can you post screenshots of your control and it's InnerHtml and then your automation?

December 9, 2019 - 3:30pm

<INPUT Style"BORDER-TOP:red 2px solid;BORDER-BOTTOM:red 2px solid;BORDER-LEFT:red 2px solid;BORDER-RIGHT:red 2px solid;" name="abc" ID="abc" maxLength="15" align="LEFT" size=15>

Pega
December 9, 2019 - 3:42pm
Response to dharmpals0253

I am no HTML expert, but "Style" doesn't look like an attribute. It doesn't follow the pattern attribute=value. Perhaps that is the problem. If you just need the stuff after the word style, you might use a RegEx on the InnerHTML of the control.