You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Very enjoy TagUI ,bu i am newbie to use Tagui :(
When using the "select" instruction, I found that the dropdown options cannot be selected to the options I specified
For example :
This is my localhttpserver index.html code <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="x-ua-compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Title</title> </head> <body> <div> <form action="http://www.baidu.com" method="get"> <div> <!-- dropdown --> <select name="sel"> <option value="1">GZ</option> <option value="2">SZ</option> <option value="3">SD</option> <option value="4">BJ</option> </select> </div> <input type="submit" value="GO"> </form> </div> </body> </html>
I want to change the drop-down options from "GZ" to "SZ" using the select method.
My code is http://127.0.0.1 click /html/body/div/form/div/select select /html/body/div/form/div/select/option as 2
or http://127.0.0.1 click /html/body/div/form/div/select select /html/body/div/form/div/select/option[2] as 2
or http://127.0.0.1 click /html/body/div/form/div/select select SZ as 2
I fllowed this post(#305).
But all the above methods cannot change the drop-down option to SZ.
Why?So what is the correct way?
Plz help me ,Thx a lot!
The text was updated successfully, but these errors were encountered:
Hi @finnfotoer I think why your examples did not work is because you are performing select on the option. The first parameter for select is the dropdown thing but not the actual option. Can you try if any of below works?
http://127.0.0.1
select sel as 2
http://127.0.0.1
select //*[@name="sel"] as 2
Adding on, recently we add the ability to also select by text of the option instead of only value. So value or text both work.
If you want to select by text, you can get the updated version here - #1001 (comment) and below should also work.
http://127.0.0.1
select sel as SZ
http://127.0.0.1
select //*[@name="sel"] as SZ
kensoh
changed the title
Unable to Select dropdown option use select setp?
Unable to select dropdown option use select step? - some examples here on usage
Apr 19, 2021
Thx a lot for your help .Would like to ask how to use TAGUI in python to click a button without using the click method and directly use the post method instead of the click method?
Can you tell me more what you mean by post method? I have not come across this question before. Normally UI interactions are done directly using the different functions, and in some cases using dom step or dom() will be useful to run code directly within the web browser program space.
Very enjoy TagUI ,bu i am newbie to use Tagui :(
When using the "select" instruction, I found that the dropdown options cannot be selected to the options I specified
For example :
This is my localhttpserver index.html code
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="x-ua-compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Title</title> </head> <body> <div> <form action="http://www.baidu.com" method="get"> <div> <!-- dropdown --> <select name="sel"> <option value="1">GZ</option> <option value="2">SZ</option> <option value="3">SD</option> <option value="4">BJ</option> </select> </div> <input type="submit" value="GO"> </form> </div> </body> </html>
I want to change the drop-down options from "GZ" to "SZ" using the select method.
My code is
http://127.0.0.1 click /html/body/div/form/div/select select /html/body/div/form/div/select/option as 2
or
http://127.0.0.1 click /html/body/div/form/div/select select /html/body/div/form/div/select/option[2] as 2
or
http://127.0.0.1 click /html/body/div/form/div/select select SZ as 2
I fllowed this post(#305).
But all the above methods cannot change the drop-down option to SZ.
Why?So what is the correct way?
Plz help me ,Thx a lot!
The text was updated successfully, but these errors were encountered: