WebAutomation - some extra functionality

After reading this Softomotive page I decided to try some of the following attributes for WebAutomation.DataExtraction.GetDetailsOfElement besides “Own Text”:

  • Own Text
  • Exists
  • Location and Size
  • Enabled
  • Accesskey
  • Acceleratorkey
  • windowtitle
  • Iskeyboardfocusable
  • helptext
  • haskeyboardfocus
  • controltype
  • localizedcontroltype
  • name
  • processid
  • processname
  • ispassword
  • iscontrolelement
  • iscontentelement
  • isoffscreen
  • class
  • id
  • parentwindowhandle
  • bulktext

I picked a post by @morbid42, as it was the incentive for this experiment. The URL is in the code. I haven’t made an exhaustive check as to which of the attributes above work, but obviously some do. Here’s screenshot of the target control from the appmask:

div_cooked

import  "C:\work\RobinTests\fortytwo.appmask"

WebAutomation.LaunchChrome \
                Url: "https://forum.robin-language.org/t/syntax-for-abs-xpath/617" \
                WindowState:WebAutomation.BrowserWindowState.Normal \
                ClearCache:False\
                ClearCookies:False \
                BrowserInstance=> Browser

WebAutomation.DataExtraction.GetDetailsOfElement \
                BrowserInstance: Browser \
                Control: fortytwo.fortytwo.Morbid.div_cooked \
                AttributeName:'Exists' \
                AttributeValue=> ExistsValue
                
Console.Write Message: ExistsValue

WebAutomation.DataExtraction.GetDetailsOfElement \
                BrowserInstance: Browser \
                Control: fortytwo.fortytwo.Morbid.div_cooked \
                AttributeName:'Own Text' \
                AttributeValue=> TextValue
                
Console.Write Message: TextValue

WebAutomation.DataExtraction.GetDetailsOfElement \
                BrowserInstance: Browser \
                Control: fortytwo.fortytwo.Morbid.div_cooked \
                AttributeName:'class' \
                AttributeValue=> ClassValue
                
Console.Write Message: ClassValue

WebAutomation.CloseWebBrowser BrowserInstance: Browser

Code screenshot:

Regards,
burque505

3 Likes