How can I capture highlighted text and place it into a variable to use for a comparison IF statement?
I have a table grid that references each cell like this 'HTMLTD("ID='' Index=89")'. I have a grid cell which contains two entries vertically (I want the lower one). I found the mouse coordinates to select the lower text using " HTMLTD("ID='' Index=89").MouseDown 6, 27 and HTMLTD("ID='' Index=89").MouseUp 130, 27 ". How do I transfer the selected text into a variable without pulling the top text also (.TEXT does this and is not what I want)?
.Copy command produces a 'not supported by object' error.
Due to the limitations of Visual Tests regarding the application I am testing against, I am using Test Scripts.
I can't use CaptureText due to the way they coded that particular item. It holds ALL text and titles on the screen in that one item. I am currently grabbing all this information and using the InStr function to check for the desired text. I use this when the location of the title changes on the page.
Thanks for the suggestion. I may be able to use the Inner Text function in another portion of my scripts.
Let me suggest a combination of the above solutions.
Put the contents of HTMLTD("ID='' Index=89").InnerText
into a string and use the InStr parsing that you
already have to get the lower text. This eliminates
all coordinates and position dependence and is less code.