Hi,
Using the new chrome function ChromeFindElements, developer tools inspector says the element name is "Search:" without the quotes.
Let>MyValue=Search:
ChromeFindElements>session_id,name,%MyValue%,search_elements
//returns count of 0.
Is it possible the colon is giving me grief and if so, how would I escape that?
If I need to take a different approach I noticed that with the element highlighted I can copy xpath or full xpath.
xpath is
#datatable-responsive_filter > label > input
full xpath is
/html/body/div[1]/div[3]/div/div/div[3]/div[1]/div[3]/div[1]/form/div[6]/div/div[1]/div[2]/div/label/input
If tried using xpath like this:
ChromeFindElements>session_id,xpath,//*[@id="datatable-responsive_filter"]/label/input,info_elements
but it complained about unquoted string in JSON. I am in over my head.
Thank you,
Bob
ChromeFindElements -is this name ok?
Moderators: Dorian (MJT support), JRL
- Dorian (MJT support)
- Automation Wizard
- Posts: 1380
- Joined: Sun Nov 03, 2002 3:19 am
- Contact:
Re: ChromeFindElements -is this name ok?
Hi Bob,
The colon shouldn't be the issue here. If the html is something like this :
Then both of these work. el_count / elres should be 1 in each case, showing 1 match was found, and the form field will be populated :
Some things to note :
1. It's case sensitive, so if you were to use search: instead of Search: your el_count would be 0. It seems OK to use @Name instead of @name when using xpath though, but doing that when using name are a strategy also results in a 0.
2. If it's in a frame, you'll need to use ChromeSwitchFrame first.
3. If it's in a popup, you'll often need to use ChromeSwitchWindow first.
The colon shouldn't be the issue here. If the html is something like this :
Code: Select all
<input type="text" name="Search:">
Code: Select all
ChromeFindElements>session_id,name,Search:,el
let>elres=el_count
ChromeSetElementValue>session_id,el_1,test
Code: Select all
ChromeFindElements>session_id,xpath,//input[@name='Search:'],el
let>elres=el_count
ChromeSetElementValue>session_id,el_1,test
1. It's case sensitive, so if you were to use search: instead of Search: your el_count would be 0. It seems OK to use @Name instead of @name when using xpath though, but doing that when using name are a strategy also results in a 0.
2. If it's in a frame, you'll need to use ChromeSwitchFrame first.
3. If it's in a popup, you'll often need to use ChromeSwitchWindow first.
Yes, we have a Custom Scripting Service. Message me or go here