1

I was asked in an interview this question

That two different scenario requires data from a common sheet. How to we identify that data already used , while passing it as input.

In general how to identify the data is already used and we need to select another record from data sheet.

closed as unclear what you're asking by dzieciou, alecxe Oct 8 '17 at 21:07

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    This is a common programming question, unrelated (or not specific) to selenium. There are zillions of answers to it on Stack Overflow. – Peter M. Oct 5 '17 at 14:28
  • Can @PeterMasiar you please help me with link for the answer. As my interviewer asked we have an option in selenium – Abhishek Kumar Oct 5 '17 at 14:31
  • 1
    Selenium is for browser automation. It can be used from many programming languages, which might have different way to identify duplicate entries in input sheet. It might been a trick question, with right answer being first sentence of this comment. – Peter M. Oct 5 '17 at 14:51
1

Let me try.. It always depends on type of data and purpose so without looking to it we can't give exact answer except we can answer as an interview question like below.

  1. Assume data having some id then you can cross check by id that scenario2 used this id? If yes then skip it for scenario1.

  2. When parsing of data, after using row1 data put some flag that row1 is used at scenario1 so scenario2 can skip it.

There could be other way as well but again without understanding requirement its hard to say how? You should have asked more information in the interview to get more details :)

0

That sounds almost like a trick question, if I understand it correctly. If each row may be used only once, then the rows should be specific for a test and not in a common sheet (do you see the contradiction? ;).

Having a common set of data for multiple tests can be fine if all tests are allowed to that same data (e.g. default values for an address). This simply sounds like bad design.

Now, it is possible (if it wasn't a trick question) that the intent is to add some data variability to the tests (e.g. 10 sets of data, randomly divided among 10 tests every time). If that's the case, the data is either consistent (if it influences the test outcome, e.g. discount values for an order) or not important (if it doesn't influence the test outcome, e.g. a street name). In both of these cases, you should use existing 'random data generators' that return random data and/or write your own where necessary.

  • I think it was a trick question. He said we have something in selenium which validates whether the input is duplicate or not or already used for other case or same case. – Abhishek Kumar Oct 5 '17 at 14:26

Not the answer you're looking for? Browse other questions tagged or ask your own question.