dzharii / swd-recorder

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

There is no possibility to save page object .pox file #7

Closed MaximKonev closed 10 years ago

MaximKonev commented 10 years ago

There is no possibility to save page object .pox file 2013-08-29_1400

dzharii commented 10 years ago

I have observed this crazy issue before.

Workaround: Please, try to install Microsoft .NET Framework 4.5 http://www.microsoft.com/ru-ru/download/details.aspx?id=30653

Hope it will help. I am going to investigate and fix this issue in further releases

yuriw commented 10 years ago

I saw that too. You may want to include .net files into the app zip

dzharii commented 10 years ago

The bug with saving PageObject files in finally fixed. @MaximKonev, @yuriw thanks for your contribution. The fixed build can be found here (link to the latest) http://goo.gl/76k6I


For descendants:

The bug was introduced when I’ve started used System.ComponentModel.DefaultValueAttribute In the WebElementDefinition class (which was serialized to PageObject pox files) The XmlSerializer took this attribute into account when created the serialization assembly. That behavior was unexpected for me and I’ve used the attribute for different purpose. As result, it thrown the following error message:

An error had occurred during saving the Page Object. File: C:\Projects\swd-recorder\Bin\SwdPageRecorder.UI\sdsdsd.pox Error:Unable to generate a temporary class (result=1). error CS0019: Operator '!=' cannot be applied to operands of type 'string' and 'bool' error CS0019: Operator '!=' cannot be applied to operands of type 'string' and 'bool' error CS0019: Operator '!=' cannot be applied to operands of type 'string' and 'bool' error CS0019: Operator '!=' cannot be applied to operands of type 'string' and 'bool' error CS0019: Operator '!=' cannot be applied to operands of type 'string' and 'bool'

I had to remove the attribute in order to fix the issue. The problem is reproducing only on Net Framework 4.0. The problem is not reproducing when .Net Framework 4.5 is installed.