1

I'm having trouble selecting a link from this dropdown menu. The html is this:

<li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-22594"><a href="http://toolsqa.com/automation-practice-form/" data-level="2"><span class="menu-item-text"><span class="menu-text">Automation Practice Form</span></span></a></li>

I've tried

Command: Select Target: class="menu-item menu-item-type-post_type menu-item-object-page menu-item-22594"

But it's failing. I would like to navigate to the link to test other things on that webpage.

2 Answers 2

1

In case of Select class, use normal way of identifying the element. You can use xpath : //span[text()='Automation Practice Form'] to identify element and then click on it. It should work.

Note: We should use Select class when it is present in DOM

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

Comments

0

To click on the link with text as Automation Practice Form you can use the following xpath :

//a[@href='http://toolsqa.com/automation-practice-form/']/span[@class='menu-item-text']/span[@class='menu-text']

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.