Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I want to "connect" a Fake Action to an HTML Element on the page via XPath, but when I try to connect the Element, the Element is specified by HTML id attribute instead.

How do I force Fake to specify an HTML Element by XPath when "connecting"?

share|improve this question

1 Answer 1

Developer of Fake here.

First, make sure you understand the concept of "Connecting" in Fake.

Fake allows you to specify an HTML Element via one of several methods:

  1. HTML id attribute
  2. HTML name attribute
  3. CSS Selector
  4. XPath Expression
  5. arbitrary JavaScript Expression

Connecting is an automatic way to specify an Element. Fake can only connect an Element using one of two methods:

  1. HTML id attribute
  2. XPath Expression

If you want to specify via one of the other methods you must do so "by hand".

When you connect an Action to an HTML Element, Fake will first try to specify the connected Element using the HTML id attribute. If that is not possible (becuase the Element has no id attribute), Fake will try to specify the connected Element using XPath.

Via id is the default because it is efficient and easily understandable.

Via XPath is the fallback because it is always possible, but less efficent and less easliy understandable.


However, there are times when you might prefer to connect an Action to an Element, but specify the Element via XPath instead of id. This is possible via the steps below:

  1. First add a connectable Action (like Set Value of HTML Element) to your Workflow.
  2. Before connecting, change the specifier type to for XPath.
  3. Then connect as normal. Hold the control key () while dragging from the Action to an Element on the page.

The Element will now be specified via XPath, instead of id.

enter image description here enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.