0

I have submit and confirmation button in two different pages and both has same CSS selector. The confirmation button does not have any id. As I use CSS selector to click on Submit button , because of this I am not able to click on Confirmation button with same CSS selector.

Please help with me other possible ways to click on confirmation button. Please note I tried with all the supportable locators in web driver.

3
  • 2
    Nobody will be able to help you if you can't provide an example of the code you're using. Commented Nov 8, 2017 at 8:07
  • 1
    I too really want to see the code you use to click on a button with CSS. Commented Nov 8, 2017 at 8:16
  • This is the code found out when I do inspect element of that button....<input class="btn-blue mL30 mR10 font-size5 inquiry-submit" value="XXXX" type="Submit">.. Commented Nov 9, 2017 at 5:45

1 Answer 1

0

You can use the attribute selector:

input[type="submit"]

will select the <input> with type="submit".

input[type="button"]

will select any <input> with type="button".


More about the attribute selector:

When using the attribute selector, you don't have give the value of the attribute.

For example:

img[title] will select any <img> which has a title attribute, regardless of what that title is.

Furthermore, you can select elements by value-fragment of a given attribute:

  • ^= : img[title^="Just released -"] selects any <img> which has a title which begins with Just released -
  • $= : img[title$=" (2012])"] selects any <img> which has a title which ends with * (2012)*
  • *= : img[title*="th"] selects any <img> which has a title which contains the letters th anywhere in the title.
  • ~= : img[title~="Copyright"] selects any <img> which has a title which contains the word Copyright.
Sign up to request clarification or add additional context in comments.

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.