3

How can you apply 'assert.hidden' (or any other assertion/command, for that matter) not to 'browser' but to a part of the page, e.g. a table?

So, instead of:

browser.assert.hidden('#whatever')

Can one do something like this?

('#table_id').assert.hidden('#whatever')

This suggestion does not work for me as it is above.

A custom command can be written, but my question is whether this can be done directly.

Salas
  • 71
  • 6

2 Answers2

0

You could use CSS path or XPATH to select part of the page

See: Google Chrome copy CSS Path in Developer Tools

Community
  • 1
  • 1
  • Thanks for your answer. But the thing is when I substitute 'browser' for some selector, it does not work. Are you saying it should work? Can 'browser' in 'browser.assert.hidden(selector) be changed to 'anotherselector.assert.hidden(selector)'? That's the question. :) – Salas Nov 21 '14 at 16:48
0

Maybe I'm mis-understanding what you're asking.. but it seems like you could just do:

browser.assert.hidden('#table_id #whatever')

After all you're just using CSS selectors to validate the particular item you want to confirm is there and browser is the root of all these elements.

Petrogad
  • 4,405
  • 5
  • 38
  • 77