0

I am in the middle of building a test case, where i came across this problem. In my web page there exists a search text box. I have recorded the web page using selenium ide.

type  | id=search_input_char_name_136 | myproduct     // textbox for search
click | css=button.oe_button          | -            // search icon click

I got the above code by recording, here in "type" action an id value is show for textbox, when i use the same value while testing, id not found error occurs. so i have recorded the action again and i found id is dynamic. for each time the id keeps on changing.

i have googled it and found xpath will be solution for this. i am very new to selenium and xpath. i couldn't figure out the solution. so help to slove this.. provide me the xpath syntax to type=id of search-textbox.

1 Answer 1

1

In the selenium IDE itself, after the recording is finished, try to click the drop down named Target in the IDe window for this textbox. There, in that drop down, you can get various locators like xpath, name, css, dom etc. Observe, which one is static for all the recordings and use that locator. Hope it helps. Let me know if you are still struck with this issue.

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

1 Comment

thanks for your reply, it worked. xpath:position was static in all recordings i have used it and tested it works fine.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.