New to Selenium IDE and having issues with finding elements on test site

107 views
Skip to first unread message

SB

unread,
Jul 17, 2018, 12:09:37 PM7/17/18
to Selenium Users
Hi im very new to Selenium and have been using it to build some test scripts on a test site.

There are a few areas that run fine when creating the test but when i run the test again to check it works ok it states that the element cant be found. Ive tried setting the target to each of the options when inspecting the element (such as xpath, css selector etc) but it cannot find the element even when i click "find target in page". The recent area thats causing issues is a submit response button on the test site.

The location when i use the "inspect element" function shows as;

<div class="ui green right submit icon button" data-bind="click: SubmitResponse, clickBubble: false">Submit response</div>

& on the initial run through selenium ide it shows as:

//div[3]/form/div[6]

Ive spent a few hours trawling through google and multiple sites and ivee tried some of the responses that appear but cannot get the test to work after the initial run.

If anyone could help id be very greatful!

Tomer Steinfeld

unread,
Jul 17, 2018, 2:15:11 PM7/17/18
to Selenium Users
Selectors mostly depend on the structure of the page rather than the single element alone.
From that element alone I can assume that a locator that may work would be:
css="form .ui.green.submit.button"

But it may still fail, the entire page is necessary to create a valid locator

Also the fact that the button is an element of type div rather than button (or better yet submit) confuses the IDE as to what this element does, because divs are mostly used to define sections in the page.
The button type elements (e.g. button, submit, clear) are used to define buttons on the page.

Sevan Bagheshian

unread,
Jul 18, 2018, 6:17:44 AM7/18/18
to seleniu...@googlegroups.com
Hi Tomer

Thanks for the response. Ive tried using your suggestion and IDE still cannot find the button. Error message "Could not find css="form .ui.green.submit.button" on the page".

Ive inspected the element and used all the options available as the target but they dont work either. From what youve said this might be due to how the button is coded as a div element rather than as a button so im going to ask the devs if they can assign this to these areas.

Thanks again for your help.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/aaf0163d-f042-4b39-9815-f042a10f7153%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages