Selenium IDE - what is causing this error message ("Cannot read property 'trim' of undefined") [duplicate] - selenium

This question already has answers here:
An error has occured in 'site url': Uncaught TypeError: Cannot read property 'getColomnSet' of undefined with Selenium and Python
(2 answers)
"unknown error: cannot read property 'scrollleft' of null" in Chrome using selenium
(1 answer)
Closed 2 years ago.
I am trying to read in a count from a webpage screen with Selenium IDE using the following code. The count increments automatically on-screen.
I am encountering an error message and I'm not sure how to resolve it - I suspect I may need to define the variable but I have been unable to figure how to do it.
store value id=eas-collection-notification x
echo ${x}
storeValue on id=eas-collection-notification with value x Failed:
Cannot read property 'trim' of undefined
Can you please advise me how to make this code work? I just want to compare the number on-screen to take a further action once it reaches a defined threshold.
Thank you.

Related

How to produce proper json error response for php fatal error in Laravel 8+ [duplicate]

This question already has answers here:
How do I catch a PHP fatal (`E_ERROR`) error?
(18 answers)
Safely catch a 'Allowed memory size exhausted' error in PHP
(4 answers)
Closed last year.
I need to produce some proper custom error response in json format when I receive php fatal error instead of standard 500 in Laravel 8+.
How can I achieve the this outcome.
You can use Exception. Read the documentation

org.openqa.selenium.JavascriptException: javascript error: missing ) after argument list error when updating session storage key value using Selenium

If key value length is 11808 Unable to update session storage key value using selenium automation
Small length key values are setting but long length key values getting JS error
Manually it is working but using selenium automation getting JS error.
setItemInsessionStorage method using:
java.lang.AssertionError: org.openqa.selenium.JavascriptException: javascript error: missing ) after argument list
This error message...
java.lang.AssertionError: org.openqa.selenium.JavascriptException: javascript error: missing ) after argument list
...implies that there is a syntax error within the Javascript line of code.
A bit of more information about your usecase interms of your code block would have helped us to analyze the error in a better way. However in majority of the cases, this error is observed in the following cases:
Incase the " marks are not escaped properly. As an example:
onclick="(canLaunch('" + v.LibraryItemId + " '))"
^ escape character is missing
Ideally, the line should be:
onclick=\"(canLaunch('" + v.LibraryItemId + " '))\"
Incase the function() passed are not closed properly. As an example:
$(document).ready(function(){
}
Ideally, the line should be:
$(document).ready(function(){
});

The selector "ng-component" did not match any elements running Angular 8 example

I am working on the following example:
Example
I am getting a run-time error:
Error: The selector "ng-component" did not match any elements
Any idea why?
Thanks

How to Log either of the 2 messages if its corresponding condition is satisfied

My Code looks like :
${tempclosed} ${value}= Run Keyword And Ignore Error Element Should Not Be Visible ${orderonline}
Run Keyword If '${tempclosed}' == 'TRUE' log Store is Closed on Zomato Or is Temporarily Closed Element Should Be Visible ${overview}
Sleep 3s
Run Keyword Unless '${tempclosed}' == 'FALSE' log Store is Open on Zomato
"here if ${tempclosed} element is found on GUI i want the message to be logged as "Store is Closed on Zomato Or is Temporarily Closed" and if ${tempclosed} element is not found then log "Store is Open on Zomato", considering the test should continue to pass "
the current output that i get is : it logs the second message "Store is Open on Zomato" in both the cases.
How do I get the first message logged when that element is found ?
You may simply try :
${tempclosed} ${value}= Run Keyword And Ignore Error Element Should Not Be Visible ${orderonline}
Run Keyword If '${tempclosed}' == 'PASS' log Store is Closed on Zomato Or is Temporarily Closed ELSE IF '${tempclosed}' == 'FAIL' log Store is Open on Zomato
You are incorrectly using keyword Run Keyword And Ignore Error because it's returns because it returns PASS or FAIL, not TRUE or FALSE, here is link to documentation.
First Log is not executed because condition '${tempclosed}' == 'TRUE' is never met, no matter if it's PASS or FAIL.
Second Log is always execute because of the same reason, but different is that you are using Run Keyword Unless keyword.
So solution would be to replace TRUE and FALSE with PASS and FAIL.
log Store is Closed on Zomato Or is Temporarily Closed Element Should Be Visible ${overview}
I think this won't work even if you have correct condition (PASS/FAIL), as there seems to be two keywords and an argument for the latter keyword:
- No two spaces after Log, or is that log Store is Closed on Zomato Or is Temporarily Closed really a keyword?
- Are you planning to execute Element Should Be Visible in an ELSE statement? Then it should be ... log Store is Closed on Zomato Or is Temporarily Closed ELSE Element Should Be Visible ${overview}

InvalidCastException was unhandled vb.net

Hi there this error message keeps appearing when i try to calculate my data.
You're using FileSystem.WriteLine rather than Console.WriteLine.
See the difference here:
https://msdn.microsoft.com/en-us/library/microsoft.visualbasic.filesystem.writeline(v=vs.110).aspx
https://msdn.microsoft.com/en-gb/library/system.console.writeline(v=vs.110).aspx