getting error WebDriverException: Message: unknown error: call function result missing 'value' - testing

here is my first and simple code in robot framework , I am just trying to input text in google searchbox and then close the browser but it keeps on failing.
*** Settings ***
Documentation Suite description
Library Selenium2Library
*** Variables ***
${Browser} chrome
${URL} https://www.google.com/
${text} ab
*** Test Cases ***
TC 001 Browser Open and Close
Open Browser ${URL} ${Browser}
Set Browser Implicit Wait 5
Input Text name=q ab
Close Browser
error message -
WebDriverException: Message: unknown error: call function result missing 'value'
(Session info: chrome=80.0.3987.132)
(Driver info: chromedriver=2.33.506120 (e3e53437346286c0bc2d2dc9aa4915ba81d9023f),platform=Windows NT 10.0.17763 x86_64)
strong text
Strange thing if i run only below it works fine so i am suspecting it has to do with step where i am trying to insert text in google search box
*** Settings ***
Documentation Suite description
Library Selenium2Library
*** Variables ***
${Browser} chrome
${URL} https://www.google.com/
${text} ab
*** Test Cases ***
TC 001 Browser Open and Close
Open Browser ${URL} ${Browser}
Set Browser Implicit Wait 5
Close Browser

You don't have the correct chromedriver version for your version of chrome. The error shows you're using chrome 80, but chromedriver 2.33. You need to be using chromedriver version 80.

Related

While running robot framework scripts, getting error: default adapter failed

I'm getting errors while running below mentioned RF scripts. How can I resolve this issue, I don't see any problem with the chrome/web driver version. Please let me know
ERROR: bluetooth_adapter_winrt.cc:1072 Getting Default Adapter failed.
Chrome version: 91.0.4472.124
Chrome We driver: 91
IDE: Pycharm
Machine: VM
Library SeleniumLibrary
*** Test Cases ***
User must sign in to check out
[Documentation] This is some basic info about the test
[Tags] Smoke
open browser http://www.amazon.com chrome
Wait Until Page Contains Amazon
Input Text id=twotabsearchtextbox Ferrari 485
Click Button xpath =//input[#id='nav-search-submit-button']
Wait Until Page Contains results for "Ferrari 485
CLICK LINK xpath=//*[#id="n/3073871"]/span/a/span
Click Link xpath=//input[#id='add-to-cart-button']
Page Should Contain Element ap_signala_pagelet_title
Element Text Should Be ap_signala_pagelet_title sign In
close browser
*** Keywords ***

ValueError: Argument 'url' got value 'www.google.com' that cannot be converted to None in Ubuntu OS but not in windows

For this Test case i am getting below error "ValueError: Argument 'url' got value 'www.google.com' that cannot be converted to None." in Ubuntu OS but not in windows
*** Settings ***
Library SeleniumLibrary
Library OperatingSystem
*** Variables ***
${Browser} FF
*** Test Cases ***
Open_browser www.google.com ${Browser}
*** Settings ***
Library SeleniumLibrary
Library OperatingSystem
*** Variables ***
${Browser} FF
*** Test Cases ***
test
Open_browser https://www.google.com ${Browser}
your robot file itself is wrong , you should provide a test name and also provide https://
I have faced the same issue.
You need to setup again.
Uninstall Python, and IDE
Again install Python, Robot-Framework, and Selenium.
Set the Python path and web driver path
Now restart the System.
In My case, it is working fine by following these steps.

How to get/interact with element_locator on the internal page in chromium

I am building automation for the browser (from chromium kernel)
while locating element from some internal page such as: chrome://settings/
I can get xpath of "Autofill" by //[#id="autofill"]
But when I run the script by Robot framework, it said "Element with locator '//[#id="autofill"]' not found."
Here is the simple script:
*** Settings ***
Library SeleniumLibrary
*** Variables ***
*** Test Cases ***
Open URL in Google Chrome
Open browser chrome://settings/ chrome
Click Element //*[#id="autofill"]
*** Keywords ***
https://imgur.com/a/FAJoYji
Thank you so much!

Test Template with Robot Framework

I am attempting to utilize the Robot Framework Test Template function and have been experiencing a little difficulty.
My current Test consist of opening 5 different websites (declared as variables)
Here is my code:
*** Settings ***
Library Selenium2Library
Library OperatingSystem
Library String
Library Collections
Test Template Open URL
*** Variables ***
${URL1} http://montrealgazette.com/
${URL2} https://www.usatoday.com/
${URL3} http://www.foxnews.com/
${URL4} http://www.cnn.com/
${URL5} https://ca.reuters.com/
*** Test Cases ***
Validate Availability
${URL1}
${URL2}
${URL3}
${URL4}
${URL5}
*** Keywords ***
Open URL
[Arguments] ${URL}
Open Browser $[URL] Chrome
When I run this code, 5 separate blank browser windows are opened.If there is a better way to do this, please let me know.
Thanks in advance for the help!
You don't seem to have indented your test case's content, which could perhaps be the problem (after you've fixed the syntax error mentioned in Raj sattam's answer). That's pretty much the only mistake I can see. You'll want to do the same in your keyword's declaration as well.
*** Test Cases ***
Validate Availability
${URL1}
${URL2}
${URL3}
${URL4}
${URL5}
If that still doesn't fix it, instead of using the ** Settings ** section, you may try to declare the test case itself as a templated test case, like this:
*** Settings ***
Library Selenium2Library
Library OperatingSystem
Library String
Library Collections
*** Variables ***
${URL1} http://montrealgazette.com/
${URL2} https://www.usatoday.com/
${URL3} http://www.foxnews.com/
${URL4} http://www.cnn.com/
${URL5} https://ca.reuters.com/
*** Test Cases ***
Validate Availability
[Template] Open URL
${URL1}
${URL2}
${URL3}
${URL4}
${URL5}
*** Keywords ***
Open URL
[Arguments] ${URL}
Open Browser ${URL} Chrome
you can use Execute Javascript Keyword like:
*** Settings ***
Library Selenium2Library
Library OperatingSystem
Library String
Library Collections
Test Template Open URL
*** Variables ***
${URL1} http://montrealgazette.com/
${URL2} https://www.usatoday.com/
${URL3} http://www.foxnews.com/
${URL4} http://www.cnn.com/
${URL5} https://ca.reuters.com/
*** Test Cases ***
Validate Availability
Open URLs In New Tab ${URL1} ${URL2} ${URL3} ${URL4} ${URL5}
*** Keywords ***
Open URLs In New Tab
[Arguments] #{URL}
:FOR ${eachUrl} IN #{URL}
\ Execute Javascript window.open(${eachUrl},"_blank");
The only part you need to change is the * Keywords * section
*** Keywords ***
Open URL
[Arguments] ${URL}
Open Browser ${URL} Chrome
Instead of square brackets use braces

Robot Framework can't find chromedriver in PATH variable

I want to use Chrome for automation test with Robot Framework. Here are my settings:
*User variables:*
name: webdriver.chrome.driver
value: C:\chromedriver_win32\chromedriver.exe
name: PATH
values: ......;C:\chromedriver_win32\chromedriver.exe
My code:
*** Settings ***
Library BuiltIn
Library Selenium2Library
Library SikuliLibrary
Library OperatingSystem
*** Variables ***
${HOST} = VM
${URL} = http://VM.com
${BROWSER} = Chrome
*** Test Cases ***
Begin Web Test
Open Browser ${URL} ${BROWSER}
maximize browser window
After execution of command: pybot test.robot:
==============================================================================
[ WARN ] Keyword 'Capture Page Screenshot' could not be run on failure: No brows
er is open
Test Case FException
AttributeError: "'Service' object has no attribute 'process'" in <bound method
Service.__del__ of <selenium.webdriver.chrome.service.Service object at 0x000000
0003670278>> ignored
Test Case | FAIL |
Setup failed:
WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Plea
se see https://sites.google.com/a/chromium.org/chromedriver/home
------------------------------------------------------------------------------
What is wrong here?
Thank you
"chromedriver' executable needs to be in PATH" means that the location of chromedriver needs to be in the path. In your case, path needs to be "...;C:\chromedriver_win32". PATH contains folders, not executables.
Download Chromedriver.exe from its official website, extract the .exe file and copy this .exe file in scripts folder of Python installation, e.g. C:\Python36\Scripts
After this, add this scripts path in Environment variable, as below:
and now execute your test case.