![]() |
Dynamic change of name for Webtables - Printable Version +- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums) +-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP) +--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners) +--- Thread: Dynamic change of name for Webtables (/Thread-Dynamic-change-of-name-for-Webtables) |
Dynamic change of name for Webtables - prakashreddy - 10-22-2014 Hi All I am new to QTP and working on automating my application. i have a search box and search button on my web page. The condition for Search text is entered text should be min 3 characters. any thing less than three should show error message " abcdef" -> Now for identification of search box i wrote below statement for to enter input Code: Browser("xyz").Page("xyz").Webtable("xyz").WebEdit("abc").Set "Value" -> for search action i wrote Code: Browser("xyz").Page("xyz").Webtable("xyz").Image("img").click now when i run the app it is working as expected Now i am validating the error message and entered less than 3 and got error message which is as expected and good. now comes the problem when i try to enter more than 3 characters and run the app its is not recognizing the search object when the error message is still on the page i again identified the search box with error message on the page. now the webtable name has been changed to Code: Browser("xyz").Page("xyz").Webtable("xyz abcefg").WebEdit("abc") that means every time when i run the application i have to make sure that there is no error message on my page and run my current code if i don't do that then i my search box is not being recognized can any one please let me know how to handle the situation RE: Dynamic change of name for Webtables - supputuri - 10-25-2014 Option 1: check for the property of the table which does not changes based on the error message condition and use the same in your code/OR Option 2: Use the pipe symbol and provide both the property values (withoutErrMsg|withErrMsg) Let me know if you need any more help |