Here with an example I will tell how and what needs to be done.
Problem description: You had a grid with rows have values and need to click on the basis of values.
Grid looks like this.
abc | Some-Description1 | Date1 | Comments1 |
def | Some-Description2 | Date2 | Comments2 |
ghi | Some-Description3 | Date3 | Comments3 |
jkl | Some-Description4 | Date4 | Comments4 |
mno | Some-Description5 | Date5 | Comments5 |
pqr | Some-Description6 | Date6 | Comments6 |
Now, the requirement says, click on ghi which might open another window. (How to capture the window is not dealt here). When recording from selenium IDE, gave me click command with some XPATH but when I ran same command from IDE, it wasn't working at all.
Solution: Use clickAt(String locator, String co-ordinates)
Selenium IDE do not records clickAt(this was the catch here). I changed click to clickAt and it worked perfectly fine.
so command becomes :
selenium.clickAt("//div[contains(text(),\"ghi\")]","");
locator = "//div[contains(text(),\"ghi\")]"
co-ordinates = ""
co-ordinates = ""
This command says, click at the link (given by the XPATH) which has text ghi with no co-ordinates.
Same way to click on grid abc =
selenium.clickAt("//div[contains(text(),\"abc\")]","");
0 comments:
Post a Comment