1

I'm currently writing some automation with Salesforce, Python and Selenium. My problem is that some of the Dynamic Elements are not reachable. However, I would like to know a better way to build a better test.

Example:

<input lightning-input_input="" type="text" id="input-45" maxlength="120" name="Name" required="" class="slds-input" aria-describedby="help-message-45"> 

Python Code:

 driver.find_element_by_css_selector('slds-template__container > input[name="Name]').send_keys('MockData Test') 

The problem is that is not calling this element it says that is unable to locate or find the element. Does anyone know a better way to do this?

3
  • So, you are taking the normal way and use the API? Commented Mar 19, 2021 at 17:29
  • No, I'm not using the API, but I could if I need it. I just need some direction Commented Mar 19, 2021 at 17:50
  • Is there more than one input on the page with the attribute name="Name"? If not, just drop the first part of your selector and just use input[name="Name"]. Commented Mar 19, 2021 at 18:36

1 Answer 1

1

Try using driver.find_elements_by_class_name("slds-input") (be sure to specify the nth occurrence of the class)

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.