Selenium findElementsByID doesn't return any result

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
NicKeLod3oN
Posts: 2
Joined: 19 Apr 2021, 23:29

Selenium findElementsByID doesn't return any result

19 Apr 2021, 23:49

Hi All,

I'm new with AHK here and just started playing around with selenium automation.
I tried to fill/send value to 1 of the combobox in the webform, but seems unable to since my script didn't return any based on the ID in the script. As I tried to count the result only return with 0.
Can I get a guidance here where did I go wrong? Thank you heaps.

Below is the code inspect of the combobox:

Code: Select all

<input id="sys_display.incident.u_service_portfolio" name="sys_display.incident.u_service_portfolio" aria-labelledby="label.incident.u_service_portfolio" type="search" autocomplete="off" autocorrect="off" value="" data-type="ac_reference_input" data-completer="AJAXReferenceCompleter" data-dependent="" data-dependent-value="" data-ref-qual="" data-ref="incident.u_service_portfolio" data-ref-key="null" data-ref-dynamic="false" data-name="u_service_portfolio" data-table="spm_service_portfolio" class="form-control element_reference_input" style="; " spellcheck="false" onfocus="if (!this.ac) addLoadEvent(function() {var e = gel('sys_display.incident.u_service_portfolio'); if (!e.ac) new AJAXReferenceCompleter(gel('sys_display.incident.u_service_portfolio'), 'incident.u_service_portfolio', '', ''); e.ac.onFocus();})" aria-required="false" role="combobox" aria-autocomplete="list" aria-owns="AC.incident.u_service_portfolio" aria-expanded="false" title="" aria-invalid="false"> 

Code: Select all

driver:= ComObjCreate("Selenium.ChromeDriver") ; I get error here "THE system cannot find the file specified"
driver.get("https yesassist.service-now.com /incident.do?sys_id=-1&sysparm_query=active=true&sysparm_stack=incident_list.do?sysparm_query=active=true")  Broken Link for safety

MsgBox, % driver.Window.Title "`n" driver.Url

searchbox_count:=driver.findElementsByID("sys_display.incident.u_service_portfolio").Count()
MsgBox, %searchbox_count%
User avatar
Xtra
Posts: 2750
Joined: 02 Oct 2015, 12:15

Re: Selenium findElementsByID doesn't return any result

20 Apr 2021, 10:39

You will need to fix this first:
; I get error here "THE system cannot find the file specified"
Make sure you have installed selenium:
https://github.com/florentbr/SeleniumBasic/releases/tag/v2.0.9.0

And get the ChromeDriver that matches the version of chrome you are using:
https://sites.google.com/a/chromium.org/chromedriver/downloads
NicKeLod3oN
Posts: 2
Joined: 19 Apr 2021, 23:29

Re: Selenium findElementsByID doesn't return any result

21 Apr 2021, 01:33

Make sure you have installed selenium:
https://github.com/florentbr/SeleniumBasic/releases/tag/v2.0.9.0
Done

And get the ChromeDriver that matches the version of chrome you are using:
https sites.google.com /a/chromium.org/chromedriver/downloads Broken Link for safety
and Done

Chrome Version 89.0.4389.72
chromedriver replaced in Selenium folder

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 324 guests