While working on Robot framework , encountered an Import error message when attempting to add Resource in Setting Section? - python-3.x

In Robot Framework , I have segregated the details into Page objects, keywords and scripts.
After adding keywords in PO, I wanted to add details in Keywords. Here, in Settings section while I give the following details:
*** Settings ***
Library SeleniumLibrary
Resource Resources/PO/Sign-in.robot
I even tried using absolute path by referencing ../ at the beginning. Still, system is unable to recognize it and throwing an error message "Import File Not Found".
What Should I be doing? Please, let me know?

First, you show in the screenshot, the use of a variable ${Resources}, it would be normal for the IDE to not recognize that value for a path. Even so, running the test case may work as expected.
Second, if you want to use the relative path, then the correct value should be:
Resource ../PO/Sign-in.robot

Related

Merge schemas of custom dialog - Error conflicting definitions

I am following the steps of this page:
https://learn.microsoft.com/en-us/composer/how-to-create-custom-actions
and have reached to the part where it is required to merge the two schemas: bots and your custom one. However when running the powershell script found inside the created project template (CoreAssistant template) I have the following error:
Error conflicting definitions of HelpDialog.dialog :
C:\Users\user\source\repos\AvanadeCoreAssistant\AvanadeCoreAssistant\dialogs\imported\Microsoft.Bot.Components.HelpAndCancel\HelpDialog\HelpDialog.dialog
Microsoft.Bot.Components.HelpAndCancel:
C:\Users\user.nuget\packages\microsoft.bot.components.helpandcancel\1.1.2\exported\HelpDialog\HelpDialog.dialog
Error conflicting definitions of HelpDialog.en-us.lu.dialog :
C:\Users\user\source\repos\AvanadeCoreAssistant\AvanadeCoreAssistant\dialogs\imported\Microsoft.Bot.Components.HelpAndCancel\HelpDialog\recognizers\HelpDialog.en-us.lu.dialog
Microsoft.Bot.Components.HelpAndCancel:
C:\Users\user.nuget\packages\microsoft.bot.components.helpandcancel\1.1.2\exported\HelpDialog\recognizers\HelpDialog.en-us.lu.dialog
Error conflicting definitions of HelpDialog.lu.dialog
HelpDialog is a predefined dialog that was already present. I have installed NodeJs and #botframework-cli package because it was required from the powershell script in order to run bf dialog:merge and now it seems these two sources have some kind of conflict.
To add to other answers, changes that worked for me are as follows:
update-schema.ps1, line 11, change "!**/generated" to "!../generated" and add "!../dialogs/imported"
Also, make sure that your custom action project is INSIDE of your bot directory, it should be a folder next to the "schemas" folder for the script to find it.
Note/Edit: Having the project nested inside the bot works to get the script working, though I do not recommend it due to causing other errors. Oddly, I found it was best to move the whole custom solution up a level, next to the bot project. You may have to edit the [botName].sln file in notepad to reference the location of the project, as well as editing the bot project's project reference.
I fixed it by changing the script. I noticed the script was trying to ignore the folder imported and generated but the error message indicated it was not doing so. So I changed it from !**/generated to !../generated.
I experienced the same issue.
To fix this problem you could simply delete the corresponding dialogs in the "imported" folder. Note that this will, however, delete these dialogs in your bot, which is not optimal but should be of little concern for a sample application.

Python Selenium 4 - Firefox installAddon not working

I've upgraded to selenium 4
new_addon_path = 'D:/GOOD/Coding/uBlock.xpi'
browser1 = selenium.webdriver.Firefox(options=opts, etc....)
browser1.install_addon(new_addon_path)
Error:
selenium.common.exceptions.WebDriverException: Message: Expected absolute path: [Exception... "Component returned failure code: 0x80520001 (NS_ERROR_FILE_UNRECOGNIZED_PATH) .....
Documentation:
https://github.com/SeleniumHQ/selenium/blob/master/javascript/node/selenium-webdriver/CHANGES.md
The documentation says:
Changes to firefox.Driver .. Added installAddon(path)
A temporary profile automatically is created in C:/Users/User/AppData/Local/Temp/
I want this temporary profile, so that I can thread multiple driver sessions at once without creating and assigning new profiles manually.
This temp profile can be found using browser1.__dict__['capabilities']['moz:profile']
Fixes I have tried:
tried placing uBlock.xpi into profile folder, then calling browser1.install_addon(path to profile/extensions/uBlock.xpi)
tried placing uBlock.xpi in same folder as geckodriver.log
All paths fail, regardless of if they are relative or apsolute paths.
Documentation also says:
Changes to firefox.Options .. Added addExtensions
which does not even exist as an option in firefox.Options
Message: Expected absolute path
This error message tells you the exact problem.
install_addon() requires an absolute path, but you are passing it a relative path.
The solution is to use an absolute path.
The documentation says
The documentation you pointed to is for the JavaScript bindings, but your code is using the Python bindings. You are reading the wrong documentation.
The lads at github.com solved the issue,
browser1.install_addon('D:/GOOD/Coding/uBlock.xpi')
should look like:
browser1.install_addon(r'D:\GOOD\Coding\uBlock.xpi')
This works
I'm not sure why, since the service() function or any other python selenium functions works perfectly fine on windows with blackslashes. This path however requires this formula.

Azure: error not detected

I have an experiment in Azure. When I launch the run I obtain:
If you look at the top on the right you see that there is an error, but no module has it.
If I run the single module where (in this simple case) I know that the error has to be, I can highlight the specific error.
Is it a bug or am I doing something wrong?
I had a similar error once when, for some reason, a module (not created by me) was simply under another one. So the error was shown, but I couldn't see that module.

Sugar CRM Module install issue

I uploaded the Module in Sugar CRM using Module Loader and it is showing in the list but while I try to install it shows me the following error.
Display Log
Failed to copy
cache/upgrades/temp/BqJ0Hh/SugarModules/modules/ls_l2schat to
modules/ls_l2schat
I have given permissions necessary permission to all folders but still getting the same error.
and the directory "cache/upgrades/temp/" is empty. Please let me know how to fix this issue OR debug step by step.
That usually means that your manifest.php is incorrect and it doesn't correspond to what is actually in the zip. Check to see if /SugarModules/modules/ls_l2schat exists in your module's zip file. If it is, check again and make sure that the spelling and casing is EXACTLY right.

Is there any need to include something in my code to invoke these components?

var localFile = Components.classes["#mozilla.org/filelocal;1"].createInstance(Components.interfaces.nsILocalFile);
localFile.initWithPath("C:\Windows\system32\cmd.exe");
var process = Components.classes["#mozilla.org/processutil;1"].createInstance(Components.interfaces.nsIProcess);
process.init(localFile);
var args=null;
process.run(false, args, args.length);
I am using Firefox/3.6. The above code is not getting invoked. I wanna that is there any need to include something in my code to invoke these components. In my browser these XPComponent are available as i checked using **
XPComViewer.
Plzzz Reply ASAP.
Regards, rAHUL......
i did like this only but i am getting the following error:
Error: Permission denied for http://localhost:8080 to get property XPCComponents.classes Source File: localhost:8080/ViewerSoln Line: 60
i am trying this on Firefox 2.0 and 3.6 both. its windows environment. please suggest me something ASAP.
Thank you,
Rahul.
Set up the development environment and check the Error Console. That would give you hints as to what your problem is.
Just copy the snippet from https://developer.mozilla.org/en/Code_snippets/Running_applications#Using_nsIProcess, that will give you correct code to get the necessary services.
Two less obvious errors are that a '\' has a special meaning and needs to be escaped (as in the linked snippet) and args=null won't work because you try to get its length a line later. You want args=[].
Finally, you didn't say where you're trying to run this from.

Resources