Dear all,
I added a separate project to my solution, and compiled it as DLL.
Then I referenced this DLL in the original project, but the User Code methods just do not show up in the recording action "Select from Library".
When I reference the project directly (not the DLL), all User Code methods show up fine.
Can anyone tell me what could be the issue here?
thank you!
br mrt
User code referenced as DLL does not show up in recording action
Re: User code referenced as DLL does not show up in recording action
Hi,
I'm afraid, it's impossible to tell what's wrong, without seeing the method and whole class file.
I'm afraid, it's impossible to tell what's wrong, without seeing the method and whole class file.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: User code referenced as DLL does not show up in recording action
Hi, it is a very basic project, folder structure looks like this:
and in UserCodeCollection.cs:
As mentioned, when referenced directly I can select the method from Add action -> User Code -> Select from library.
When referenced as DLL, it does not show up there.
I tried adding a Class library project and a Ranorex module library project, both behave the same.
thanks!
and in UserCodeCollection.cs:
Code: Select all
/*
* Created by Ranorex
*
* To change this template use Tools > Options > Coding > Edit standard headers.
*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
using System.Drawing;
using System.Threading;
using WinForms = System.Windows.Forms;
using Microsoft.Win32;
using Ranorex;
using Ranorex.Core;
using Ranorex.Core.Data;
using Ranorex.Core.Repository;
using Ranorex.Core.Testing;
using OpenQA.Selenium;
// for correct value conversions
using System.Globalization;
// for making life easier
using System.Linq;
// for converting object properties to string array
using System.Reflection;
// for creating temp directory
using System.IO;
// for parsing XMLs
using System.Xml;
using System.Xml.Linq;
namespace Public.UserCode
{
/// <summary>
/// Creates a Ranorex user code collection. A collection is used to publish user code methods to the user code library.
/// </summary>
[UserCodeCollection]
public class UserCodeCollection
{
// You can use the "Insert New User Code Method" functionality from the context menu,
// to add a new method with the attribute [UserCodeMethod].
/// <summary>
/// This method logs the message AND the content of a variable separated by whitespace
/// </summary>
/// <param name="message">The text to display</param>
/// <param name="variable">The variable to display the content of</param>
[UserCodeMethod]
public static void LogVariableAndMessage(string message, string variable)
{
Report.Log(ReportLevel.Info, "Data", message + " " + variable);
}
}
}
When referenced as DLL, it does not show up there.
I tried adding a Class library project and a Ranorex module library project, both behave the same.
thanks!
You do not have the required permissions to view the files attached to this post.
Re: User code referenced as DLL does not show up in recording action
Here is a example solution:
TestSolution.zip
TestSolution.zip
Re: User code referenced as DLL does not show up in recording action
Hi,
There appears to be two problems.
At first, add 'Static' to MyMethod declaration.
At next, it seems that the source MyProvider project must not be in the same test suite? Once removed, it works as expected, both in Recording module or Recording User Code. BTW, have you tried to compile the original sample test suite? Because it throws an error too (in referenced project).
There appears to be two problems.
At first, add 'Static' to MyMethod declaration.
At next, it seems that the source MyProvider project must not be in the same test suite? Once removed, it works as expected, both in Recording module or Recording User Code. BTW, have you tried to compile the original sample test suite? Because it throws an error too (in referenced project).
You do not have the required permissions to view the files attached to this post.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration