Quality Testing

Quality is delighting customers

how to collect the header title of all the reports in the application

Hi,

friends can you plz look into this : 

http://stackoverflow.com/q/43463879/5080027?sem=2

Views: 129

Reply to This

Replies to This Discussion

Hi,


For collecting header title..you basically need a common html element which is being used by the same webelements
Then you need to insert those in a List<WebElement> and then you can iterate it and use it accordingly.

As you are saying that there is no common XPath being used...you have to look for alternatives for finding the WebElements..for e.g css
selectors can be of great use

Also for capturing the titles of the report u have to click the view button capture the report title and store it in some static string value..then close it
and then go ahead and click on the 2nd view..and go ahead so on

You are also saying that the heading format is aligned either right or left..for me its a defect which
has to be first fixed by the dev and then only you can fetch the title

otherwise you will need to open every other report and then hard-code the locators(as they are changing) in your code.

I have tried this to capture the header

webDriver.findElement(By.tagName("body")).getText().contains(staticText);

Thanks
Refer for test automation services for any further automation related queries.

RSS

TTWT Magazine


Advertisement

Advertisement

Advertisement

Advertisement

© 2017   Created by Quality Testing.   Powered by

Badges  |  Report an Issue  |  Terms of Service