dzharii / swd-recorder

Selenium WebDriver Page Recorder (Page Objects)
MIT License
189 stars 71 forks source link

Can I get all the locators? #40

Open Zap4ick opened 9 years ago

Zap4ick commented 9 years ago

Hello. Is there a way to get all locators of element, or at least all xpath locators? I've found an "AlternativeFindBys" array, but it seems it is not what i need. I want the list of the paths, which we get on "Gen Locators" button. Is it stored somewhere in the Page Object?

dzharii commented 9 years ago

Hi @Zap4ick,

Please, let me know what high level goal you would like to achieve.

The template Run External tool might help you. image

You could find it inside CodeTemplates SwdPageRecorder\CodeTemplates\Run External Tool.cshtml

Just create a copy of this file. Edit the path to your external tool (which would parse JSON and generate pageobject) The template will create the file WebElementDefinitions.json inside the PR home dir and pass it to your tool.

The example template runs windows jscript, but you can replace it with whatever you want.

Please let me know it this answers your question,

Kind regards, @dzharii