1

I am trying to click on a button located in the extreme right corner of the page, which has multiple classes.

Sample Image of the HTML code Sample Image

This is how it should open a search box for the use to enter a string This is how it should open a search box for the use to enter a string

What I have done so far What I have done so far

This is the error msg:

Error occurred while adding the label: Message: no such element: Unable to locate element: {"method":"css selector","selector":".label-bar_addLabel.FZmV6 button"} (Session info: MicrosoftEdge=115.0.1901.188); For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception Stacktrace: Backtrace: GetHandleVerifier [0x00007FF69CC45432+69586] Microsoft::Applications::Events::EventProperty::~EventProperty [0x00007FF69CBD5672+760242] (No symbol) [0x00007FF69C98B8CC] (No symbol) [0x00007FF69C9D2C79] (No symbol) [0x00007FF69C9D2D8A] (No symbol) [0x00007FF69CA0F007] (No symbol) [0x00007FF69C9F2DEF] (No symbol) [0x00007FF69C9C6A11] (No symbol) [0x00007FF69CA0C241] (No symbol) [0x00007FF69C9F2B83] (No symbol) [0x00007FF69C9C589E] (No symbol) [0x00007FF69C9C4B6B] (No symbol) [0x00007FF69C9C6024] Microsoft::Applications::Events::ILogManager::DispatchEventBroadcast [0x00007FF69CE1D239+1294553] (No symbol) [0x00007FF69CA449F4] Microsoft::Applications::Events::EventProperty::~EventProperty [0x00007FF69CB23DF1+33073] Microsoft::Applications::Events::EventProperty::~EventProperty [0x00007FF69CB1C409+1865] Microsoft::Applications::Events::ILogManager::DispatchEventBroadcast [0x00007FF69CE1BE11+1289393] Microsoft::Applications::Events::ILogConfiguration::operator* [0x00007FF69CBDDC78+20184] Microsoft::Applications::Events::ILogConfiguration::operator* [0x00007FF69CBDA304+5476] Microsoft::Applications::Events::ILogConfiguration::operator* [0x00007FF69CBDA3FC+5724] Microsoft::Applications::Events::EventProperty::~EventProperty [0x00007FF69CBCECB1+733169] BaseThreadInitThunk [0x00007FFFF2505590+16] RtlUserThreadStart [0x00007FFFF2E0485B+43]

Process finished with exit code 0


Any help is appreciated.

Thank you!!

1 Answers1

0

use SelectorGadget chrome extention to simply find CSS Selector of any elements by clicking on it.

image of how it works

it also provide xpath of element which can be used in selenium in case of css selector continue to fail.

this is sample code for find an element by xpath in selenium:

driver.find_element(By.XPATH, "replace with your xpath")
  • @moken thanks for feedback. I tried to provide more detail on answer. can you remove your downvote now? – Ehsan Sajadi Aug 04 '23 at 12:14
  • Not my downvote. The comment is to highlight your answer was in the "low quality answers" queue. Your edit has cleared it from the queue now. However I cannot help with the down vote. – moken Aug 04 '23 at 13:07