sarvan
New Member.
1813 views

check whether hyperlink is underlined

Hi,

I need to validate that when I hover over a link, the text in that link should get underlined. How to get this using Silk Test?

0 Likes
4 Replies
Micro Focus Expert
Micro Focus Expert

RE: check whether hyperlink is underlined

Hi Sarvan

You could try using Image Recognition to verify whether the control has changed when you move the mouse over the control. Comparing an image of the control during mouse hover against an image of the same control in previous state, should allow you to verify whether the control is in the correct state.

Regards,

Colin

0 Likes
sarvan
New Member.

RE: check whether hyperlink is underlined

Hi,

.WPFHyperLink("@Text='My Expenses'")

The above is the object we are dealing. Could you please provide a sample code for this object as we don't use any image over here. It's just a hyperlink. Not sure how image recognition will work here.

0 Likes
Micro Focus Expert
Micro Focus Expert

RE: check whether hyperlink is underlined

Hi Sarvan

You can use the GetPropertyList() method to return a list of properties and check if any of these provide anything which can be used to verify, otherwise I would suggest to log a new support incident with Micro Focus Support Line so that we can better investigate this for you.

Regards,

Colin

0 Likes
Micro Focus Expert
Micro Focus Expert

RE: check whether hyperlink is underlined

Hi Sarvan,

We must use Silk Tests dynamic invoke functionality to determine the text decorations that have been applied to your WPFHyperlink. The code below demonstrates how to retrieve the text decoration name that was applied to 3 WPFHyperlinks controls in a simple application:

'Underline Hyperlink
Dim wHyper1 As WPFHyperlink = _desktop.WPFHyperlink("/WPFWindow[@caption='MainWindow']//WPFHyperlink[@automationId='Hyper1']")

'StrikeThrough Hyperlink

Dim wHyper2 As WPFHyperlink = _desktop.WPFHyperlink("/WPFWindow[@caption='MainWindow']//WPFHyperlink[@automationId='Hyper2']")

'Overline Hyperlink

Dim wHyper3 As WPFHyperlink = _desktop.WPFHyperlink("/WPFWindow[@caption='MainWindow']//WPFHyperlink[@automationId='Hyper3']")

'Methods to retrieve the text decoration name
Dim methods As New List(Of String)(New String() {"TextDecorations","get_Item", "Location"})


'The parameters for the properties/methods above
Dim params As New List(Of List(Of Object))

params.Add(New List(Of Object))
params.Add(New List(Of Object)(New Object(){0}))
params.Add(New List(Of Object))

'prints Underline
Console.WriteLine(wHyper1.InvokeMethods(methods, params))

'prints Strikethrough

Console.WriteLine(wHyper2.InvokeMethods(methods, params))

'prints Overline

Console.WriteLine(wHyper3.InvokeMethods(methods, params))



Let me know if this helps.

-Robert

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.