How to address a "Collapsible Tab" in either Chrome or Safari?


#1

This question also touches on controlling things within a Magento 2.2 web development environment...

My client moved their site to the latest Magento (rendering all my carefully written macros obsolete). I am still trying to figure out ways for KM to access and control things on these pages.

For now, assume I'm in Google Chrome - it seems to be faster than Safari, so anything I may develop will be geared toward Chrome. One element in Magento is a collapsible tab. Is there any feature in KM that can access it, and either open or close it?

I also cannot seem to access "fields" within Chrome using KM. It seems that fields in Magento are not fields as we usually refer to them. I'm not sure, but they seem concocted out of javascript.

I was told by others that know web development way better than I do that Magento was a "hot mess" and I understand why. But I'm not the decision maker here...


#2

Hey Bill,

It definitely is. The margin isn't huge, but its very noticeable.

You'll most likely have to rely on Execute a JavaScript in Google Chrome actions and Found Image conditions.

-Chris


#3

OK, I have no idea how to control this as an Execute Java Script:

Here is the code behind one of the data fields:


<input class="admin__control-text" type="text" data-bind="
        event: {change: userChanges},
        value: value,
        hasFocus: focused,
        valueUpdate: valueUpdate,
        attr: {
            name: inputName,
            placeholder: placeholder,
            'aria-describedby': noticeId,
            id: uid,
            disabled: disabled,
            maxlength: 255
    }" name="product[name]" aria-describedby="notice-HGOP7QV" id="HGOP7QV" maxlength="255">

This id value ("HGOP7QV") - I have no idea where it is generated and it differs from record to record. I am going to assume it will have to be figured out on the fly for KM to address this specific field.


#4

why is my javascript text not showing up in my comment?


#5

Hey Bill,

Because you pasted in the raw code, and the Discourse Forum software tried to render it.

You needed to use a code block.

See this:

Paste AppleScript as Markdown

I've fixed this one for you.

-Christopher Stone { Keyboard Maestro Moderator }


#6

Thank you!


#7

Hey Bill,

You bet.

Can you post a picture of what you're doing, so we can visualize it?

-Chris


#8

First, let me describe it. I am taking catalog web pages with placeholder text in them and filling out the fields with the full name of the item, including manufacturer SKU, along with description and specifications text. I have a process that takes this already-marked-up text from BBEdit and sets the named globals with the various portions I want to separate into different fields.

The web interface is (unfortunately) Magento 2.x. I had built a finely functioning system for the earlier version of Magento that my client just recently migrated from. In that system, Keyboard Maestro had no trouble addressing the fields on those pages as fields (I was using Safari at the time). The new Magento has turned what appear to be fields into something that appears to be made out of javascript. The code in one of my earlier posts was what the inspector revealed about the Product Name "field".


#9

Here's a screen shot of the top portion of a record:


#10

Here is the lower part of the screen - the Content thing if clicked slides open to reveal two fields I need to put text into. The Images and Videos think opens the same way.


#11

@Bill_Planey, Chris @ccstone explained why, and provided you with an AppleScript specific macro to post a script using the forum code block. For a more general use with other languages, and how to do this manually, see How to Use Forum Code Block.