rickypc / selenium-page-object-generator

A nimble and flexible Selenium Page Object Model generator to improve agile testing process velocity.

Home Page:https://chrome.google.com/webstore/detail/epgmnmcjdhapiojbohkkemlfkegmbebb

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Field Naming

bmccabe opened this issue · comments

I posted this in the google store page, but thought I would but it here after looking at your code. It seems to be an issue in the getSanitizedText method.

Your plugin saves me a lot of effort on most pages, but I have a problem with the naming of fields in the generated C#. We have some dynamic questionnaires and the items are labeled by the question number followed by the question text. eg.

<label id="LS1.0Q1.0" for="S1.0Q1.0" class="LC1"><b>1.1</b> What is the legal name of your  Company?</label><br/>
<input id="S1.0Q1.0" name="S1.0Q1.0" class="Answered" value="11b" required type="text"/>

which results in a field:

[FindsBy(How = How.Id, Using = "S1.0Q1.0")]
[CacheLookup]
private IWebElement 11WhatIsTheLegalName;

The 11 at the front of the name gives a syntax error for each question. We can have 40 questions per page and 40 pages for a questionnaire so fixing this manually is a big effort.

Is there a way to change this behavior?

Thanks @bmccabe . This should be fixed in version 1.2.8. Please reopen otherwise.