Robot Framework Stubborn "Element did not appear in 5 seconds" error - frameworks

I'm writing up a Robot Framework script to fill out a form. Simple script, using a small dictionary, all the rest of it is working but I can't seem to interact with this certain field. I've tried almost a dozen ways to interact with the element, but none of them are working. Can you guys help me out here? Here's my code.
Documentation Frevvo Form
Library Zoomba.GUILibrary
Library Process
Resource ../../Pages/resource.robot
Suite Setup Browser Setup ${url} ${browser}
*** Keywords ***
Student Form Data
[Arguments] ${Frevvo}
Run Keyword If '${Frevvo}[TulaneID]'!='${EMPTY}' Wait For And Input Text ${TulaneID} ${Frevvo}[TulaneID]
Run Keyword If '${Frevvo}[Term]'!='${EMPTY}' Wait For And Input Text ${Term} ${Frevvo}[Term]
*** Variables ***
${TulaneID} //*[contains(name(),'TulaneID')]
[already tried the below - no success]
#//input[#name='TulaneID']
#//input[#id='w11562aab5b4b2']
#//*[#id="w11562aab5b4b2"]
#//*[#name="TulaneID"]
#//*[#id="_5le4NoQ-EeyE6Z5Sq_0wTQ"]
*** Test Cases ***
TC 001 Basic Frevvo
Set To Dictionary ${Frevvo} TulaneID=211003560 Term=2022 Spring
Login
Student Form Data ${Frevvo}
And here is the HTML of the page. The element I need is in the highlighted part

Try following,
*** Variables ***
${TulaneID} xpath=//input[#id='w11562aab5b4b2']

Related

Robot Framework : How to add documentation tag for test written in BDD + DD style

Following is my test is written in Robot Framework. It uses the BDD+data-driven approach. It runs perfectly fine. Bue how to add [Documentation] tag for each test. I want that in the report.html, for each test case, documentation should be displayed. How to achieve it?
Settings
Resource …/…/…/resources/high-level-api.robot
Library Collections
Test Template this is my test
Test Cases
TC1 ${data1} ${data2}
TC2 ${data3} ${data4}
TC3 ${data5} ${data6}
Keywords
this is my test
[Arguments] ${valid_data1} ${valid_data2}
When perform step1 ${valid_data1}
And step2 ${valid_data1}
Then I should get ${valid_data2}
Use the [Documentation] setting from user guide.
It should look something like this:
***Settings***
Test Template Log Value
*** Test Cases *** VALUE
Example dummy
[Documentation] first example
Example 2 Value
[Documentation] second example
*** Keywords ***
Log Value
[Arguments] ${value}
Log ${value}

Bdd Cucumber issues

I have newly started working on BDD Cucumber. I am using scala for writing test cases. I am trying to use Scenario Outline and passing parameters in step definitions. My code is as follows.
Scenario Outline: Data is parsed and persisted
Given Portal is running
When A data of <type> is received
Then The data of <type> with <Id> should be parsed and persisted
Examples:
| type | Id |
| Personal | 1 |
|Professional | 2 |
Now in my when condition I am trying to get these parameters as follows
When("""^A data of \"([^\"]*)\" is received$""") {
(type: String) =>
//My code
}
Now on running my code I am getting following error everytime.
io.cucumber.junit.UndefinedStepException: The step "A data of Personal is received" is undefined. You can implement it using the snippet(s) below:
When("""A data of Personal is received""") { () =>
// Write code here that turns the phrase above into concrete actions
throw new io.cucumber.scala.PendingException()
}
Though I have my code in when. Also If I don't use Scenario Outline then it works fine but I want to use Scenario Outline for my code.
I am using tags in my feature file to run my test cases. When I run my test cases with command sbt test #tag1, test cases executes fine but when all test cases are finished running on cmd I am getting following error:
[error] Expected ';'
[error] #tag1
I tried putting ";" after tag but still getting same error
What is this issue and how I can resolve it?
I have 4-5 feature files in my application. That means 4-5 tags. As of now the test case which I want to run I give path of feature file and "glue" it with step deinition in my Runner Class. How I can provide all the tags in my Runner class so that my application runs all the test cases one by one when started?
You are missing the double quotes around <type>:
When A data of "<type>" is received
Just some general advice.
When cuking keep things as simple as possible, focus on clarity and simplicity, do not worry about repetition.
Your task would be much simpler if you wrote 2 simple scenarios
Scenario: Personal data
Given Portal is running
When personal data is received
Then personal data should be persisted
Scenario: Professional data
...
Secondly don't use tags to run your features, you don't need tags yet.
You can cuke much more effectively if you avoid scenario outlines, regex's, tags, transforms etc. etc.. The main power in Cucumber is using natural language to express yourself clearly. Focus on that and keep it simple ...

My add-in works in my W10/O16 environment but fails when MS tests using W10/O16. Why?

Our Add-in for MS Word failed validation again. They cited that it didn’t work in the Word 2016 Client on Windows 10. But I developed and tested it in W10/O16 and it works for me. I've had several other people test using W10/O16 and it works for them. What could be so different about MS's testing setup?
They informed me they are testing using Azure VM's and provided a snapshot of the console errors they are seeing
POST https://word-edit-officeapps.live.com/we/RemoteUls.ashx?build=16.0.12231.32656&waccluster=IE3 500 MicrosoftAjax.js: 5
I've never seen this error before. They also showed another error I've never seen in any of my tests...
Uncaught TypeError: Converting circular structure to JSON -->
starting at object with constructor 'a' | Property
'bindings' -> object with constructor 'OSF.DDA.BindingFacade'
--- property 'document' closes the cricle
at JSON.stringify (<anonymous>)
at HTMLDocument.<anonymous> (Home.js:229)
at blah blah blah
at blah blah blah
at office.js:41
I look at line 229 in Home.js and it's
228: Office.onReady(function (info) {
229: log("Office.onReady info: " + JSON.stringify(info));
230: isJqready(); // run other functions
231: });
232:
233: Office.initialize = function () {}; // empty initialize function
I was wondering if it is possible that their environment doesn't support ES6? I've coded Home.js in vanilla JavaScript ES6, not TypeScript.
As a test, I've converted my ES6 code to ES5. But I'm hesitant to resubmit not knowing exactly why it failed.
Does anyone have any pointers?
I'm actually working on something similar. I can tell you the POST error is happening on OfficeOnline, not the desktop client so apparently they misreported that. Try running it on Office Online in various browsers.
It definitely needs to be either transpiled to ES5 or written natively in it because earlier versions of Word 2016 (before ~May this year) and in fact Word 2013 in general will need to run it in IE11 which does not support ES6.

Symfony: The temp file does not exist after sumbiting form

I am using Symfony 2.7 and I have a form that process excel file. When I try to intentionally create form error (or when I catch any error and create form error - I mean to show my error message in the form) after reload of page (I think it's that moment) this happens:
request.CRITICAL: Uncaught PHP Exception Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException: "The file "/tmp/phpFoVva0" does not exist" at .../vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeGuesser.php line 123 {"exception":"[object] (Symfony\\Component\\HttpFoundation\\File\\Exception\\FileNotFoundException(code: 0): The file \"/tmp/phpFoVva0\" does not exist at .../vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeGuesser.php:123)"} []
Form code is normally processed but when it finishes or ends with form error this exceptions pops out. The access rights are not problem. The file in error is not the temp file of excel that is in the process. It's some .tmp that is processed in the background.
I noticed that this error pops only in specific situation. In the project and page I have Agency that has Acquisitions (that is what I try to import with that form) and Projects. When I try to import it in agency that has no projects, everything is fine and form error is shown or it's successful. But when I import it in agency that has at least one Project this exception pops.
All forms are registered via .yml config and are initiated in the Controller like this:
$importAcquisitionBudgetType = $this->get("app.form_excel.import_acquisitions_budget_type");
$importAcquisitionBudgetType->setAgency($agency);
$acquisitionsBudgetForm = $this->createForm($importAcquisitionBudgetType);
$acquisitionsBudgetForm->handleRequest($request);
I'm out of any options so every advice would be very apreciated.
Thanks a lot.

Workaround for saving / editing a VSTS test case

I have an issue with VSTS manual test cases. When I try to edit one, I got an error message as follows:
An element with the same key already exists in the dictionary
e</n.prototype.add#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-area-1319062352-vWRYJ179SKTshLwEQt_Tl9g==:3:2142
ki</n.prototype.onAddParameterInSteps#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-view-1316919717-vxhr2NM2m2AZNsRLuD0JDHQ==:36:46195
bi</n.prototype.onAddParameterInSteps#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-view-1316919717-vxhr2NM2m2AZNsRLuD0JDHQ==:36:40049
tf</t.prototype.onAddParameterInSteps#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-view-1316919717-vxhr2NM2m2AZNsRLuD0JDHQ==:36:62452
bi</n.prototype._updateParametersRefCountOnAddingStep/<#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-view-1316919717-vxhr2NM2m2AZNsRLuD0JDHQ==:36:39659
.each#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-basejs-1370396394-vpQOf5w8kp8_6mpJi9ABtBQ==:15:12291
bi</n.prototype._updateParametersRefCountOnAddingStep#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-view-1316919717-vxhr2NM2m2AZNsRLuD0JDHQ==:36:39614
bi</n.prototype._calculateParameterRefCountsFromSteps#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-view-1316919717-vxhr2NM2m2AZNsRLuD0JDHQ==:36:40691
bi</n.prototype.setParameters#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-view-1316919717-vxhr2NM2m2AZNsRLuD0JDHQ==:36:35794
yt</t.prototype.readParameters#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-async135478241-v-UPjjKxU6f1kHHOWlhqz1Q==:14:58274
yt</t.prototype._onStepsLoaded#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-async135478241-v-UPjjKxU6f1kHHOWlhqz1Q==:14:72430
o/<#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-common-1174969321-vP7TYoPIwwgcmodAk6tzLZw==:53:215
u#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-async135478241-v-UPjjKxU6f1kHHOWlhqz1Q==:14:81038
yt</t.prototype._fetch#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-async135478241-v-UPjjKxU6f1kHHOWlhqz1Q==:14:81408
yt</t.prototype.invalidate#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-async135478241-v-UPjjKxU6f1kHHOWlhqz1Q==:14:57579
c</n.prototype._onFieldChanged#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-async636480634-vHvWOSM8E8rCxBa3bYo2R7w==:149:2040
o/<#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-common-1174969321-vP7TYoPIwwgcmodAk6tzLZw==:53:215
u#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-common-1174969321-vP7TYoPIwwgcmodAk6tzLZw==:94:177
o</n.prototype.invokeHandlers#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-common-1174969321-vP7TYoPIwwgcmodAk6tzLZw==:94:526
tr</n.prototype.fireEvent#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-area-1319062352-vWRYJ179SKTshLwEQt_Tl9g==:35:100720
tr</n.prototype.fireFieldChange#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-area-1319062352-vWRYJ179SKTshLwEQt_Tl9g==:35:103810
tr</n.prototype.evaluateFields#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-area-1319062352-vWRYJ179SKTshLwEQt_Tl9g==:35:112953
tr</n.prototype.evaluate#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-area-1319062352-vWRYJ179SKTshLwEQt_Tl9g==:35:112662
tr</n.prototype._takeUpdateResult#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-area-1319062352-vWRYJ179SKTshLwEQt_Tl9g==:35:110218
vi</t.prototype._beginSaveWorkItemsInternal/</</<#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-area-1319062352-vWRYJ179SKTshLwEQt_Tl9g==:35:74066
vi</t.prototype.beginGetWorkItemTypeExtensions#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-area-1319062352-vWRYJ179SKTshLwEQt_Tl9g==:35:69585
vi</t.prototype._beginSaveWorkItemsInternal/</<#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-area-1319062352-vWRYJ179SKTshLwEQt_Tl9g==:35:74001
.each#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-basejs-1370396394-vpQOf5w8kp8_6mpJi9ABtBQ==:15:12291
vi</t.prototype._beginSaveWorkItemsInternal/<#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-area-1319062352-vWRYJ179SKTshLwEQt_Tl9g==:35:73876
rt#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-common-1174969321-vP7TYoPIwwgcmodAk6tzLZw==:59:938
l/<#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-common-1174969321-vP7TYoPIwwgcmodAk6tzLZw==:59:1252
i.Callbacks/l#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-basejs-1370396394-vpQOf5w8kp8_6mpJi9ABtBQ==:15:35816
i.Callbacks/s.fireWith#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-basejs-1370396394-vpQOf5w8kp8_6mpJi9ABtBQ==:15:36641
w#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-basejs-1370396394-vpQOf5w8kp8_6mpJi9ABtBQ==:15:73448
.send/t/<#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-basejs-1370396394-vpQOf5w8kp8_6mpJi9ABtBQ==:15:79367
Session Id: 73288d72-580f-42fb-9aeb-f5cadb6b3bc5
I only have this issue if a test step contains parameters. After refreshing the page and reopening the test case, the color code is black and it doesn't display the Save button. Also, the dropdown of the ... is empty.
Existing tests are fine, running them is also possible. Working with bugs, user stories and tasks is fine.
Screenshots can be found here
Is there a way to workaround this?
This is caused by the parameter name "#length", remove it or rename it to others like "#length1" would works.
This seems to be a bug with VSTS, I have help you created a feedback on MS Connect Page, refer to this link for details: "An element with the same key already exists in the dictionary" error occurs when save a test case contains a parameter named as "length".