0

Let's say there's only one textbox on a page (no confirm button). I have inputted the text. How do I press enter? (in mobile, I can press the "enter" key in the keyboard, but there's no keyboard in visual test). Can anyone please help me?

EDIT

So in the end I used .NET Script. But I can't integrate the script to Visual Test (the app reinstall itself from the beginning). It works if the scenario fully uses .NET Script, but then I need to change all the Visual Test to .NET Script (I need to make it all in Visual Test or .NET Script).

Does anybody know how to integrate this one function in .NET to Visual Test?

Here's my .NET Script:

Imports SilkTest.Ntf.Mobile

Public Module Main

Dim _desktop As Desktop = Agent.Desktop

Public Sub Main()

    Dim map As IDictionary(Of String, Object) = New Dictionary(Of String, Object)()
    map.Add("action", "Done")

    
    _desktop.MobileDevice("Device").Invoke("executeScript", "mobile: performEditorAction", New Object() {map})

End Sub

End Module

====== the script's 'till here (I can't insert it into the code brackets) ======

JesVan
  • 63
  • 1
  • 1
  • 7

2 Answers2

1

Add a new command that does TypeKeys with an

eggbox
  • 617
  • 4
  • 16
  • I found this in their documentation: https://www.microfocus.com/documentation/silk-test/195/en/silktestworkbench-195-help-en/GUID-7A5956EE-73E6-4F1B-A1BC-F19555138A48.html So does it mean "enter" cannot be accessed through visual test? And btw, where do I put the code? Is it in .Net script? [I'm sorry, I am new here. Both in automate test itself and in using Silk Test.] – JesVan Sep 29 '20 at 10:40
  • In the Visual test select the row that contains the entry of the text, copy and paste the row. Go to the new row and select the method, then select the "..." on the row in the property grid that contains method name, when you do this a popup will be displayed showing all the valid methods for that specific object. Find TypeKeys and select OK. Now go to the text part and change the text to – eggbox Sep 29 '20 at 12:21
  • I have tried it before. I thought it could only be for numbers and alphabets because when I click "Play", it doesn't do anything (like, my screen stays the same). And now when I tried it again, it's still like that... – JesVan Sep 30 '20 at 03:23
  • Thank you, @eggbox for your help. I have tried your suggestion and find out that this method doesn't work out for mobile application. – JesVan Oct 01 '20 at 06:03
0

I found the answer! So in properties pane in the .NET Script click the device name under Application Configurations and add ";noReset=true" in Connection String. Then, uncheck "Execute Base State".

With that, Silk Test will execute the inserted .NET Script in visual test without reinstalling the app.

JesVan
  • 63
  • 1
  • 1
  • 7