cancel
Showing results for 
Search instead for 
Did you mean: 

Capture colour of text

Graeme__Tacon
Level 6
I need to be able to determine the colour of text on a particular screen. The application is running under Internet Explorer, so I'm assuming it is something that will be quite easy to do, but I can't see how to do it. Has anyone else done this ? Thanks BP v4.2.35
2 REPLIES 2

PatrickChilders
Level 3
If you have the 'class' or 'id' attribute on the object, you can use JavaScript from BP's 'Invoke Javascript Fragment' option on navigation stages var myItem = document.getElementById(""ID of the object""); myItem.innerHTML += myItem.style.color; There's getElementsByClassName(""Class of the object""), but that returns a collection of all items with that class. So the first line in that case (assuming there's only 1 object with that class) would be var myItem = document.getElementsByClassName(""ID of the object"")[0]; This apends the color to the end of the text (which you can then crop off once it's in blue prism) an element's style.color property isn't always a color with a name, so it returns an RGB value. For example, an element set to have a color of ""Magenta"" will return ""rgb(255,0,255)"". Hope that helps.

Thanks