RE: How to compare data in excel sheet with text in website

In my test case I have to fill up a form for a student admission.
There is a drop-down to select MALE and FEMALE.
For data to be inserted in the form, I am picking my data from excel sheet and writing them in website.
But when its come to select the Gender I am not able to select Male and Female according to the data in the excel sheet.

I have written and Male and Female (in different cells)in front of the  student names .
What I want to do is pick the Male or Female word from excel sheet, compare it with the gender provided in the drop-down and then move forward accordingly.

~~Screenshot of the Gender drop-down in my application

RE: How to compare data in excel sheet with text in website

~~Screenshot of the excel sheet I am using

RE: How to compare data in excel sheet with text in website

Is it possible to do?
If Yes, please suggest how should I proceed.

som Train Asked on November 10, 2014 in Selenium WebDriver.
3 Answers

HI Som

Characters are cases sensitive and i can see case difference in your sheet and on Webpage
you can try making value in uppercase in your sheet

let me know if it works

Regards
Ankit

Vice Professor Answered on November 10, 2014.

Doctor Ankit is back ­čÖé

on November 10, 2014.

Hi Ankit

The characters are not case-sensitive in the whole software.

Let me tell you step by step what I want to do

1. I want the code to pick the Male word from the excel sheet and store in a string S1
2. Then code should pick the text (which is at the top of the drop-down value list) and save in a string S2
3. Compare S1 and S2 .
4. If S1 = S2 then click on drop-down value 1 (MALE) and proceed
OR
5. If S1 =! S2 then click on drop-down value 2 (FEMALE) and proceed

on November 10, 2014.

┬áSame thing i am trying to say because of case sensitive s1=s2 is never true so it isnt executing that codetry changing value in excel sheet from Male to “MALE”

on November 10, 2014.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.