Bro, even with latest playwright versions, let us assume I am fetching multiple elements using a locator. Then I am using all() method to take it as an array. Thn for iteration which one is advisable " for-await-of or for-of (without await) ?????
Hi how to put if condition in playwright run two parallel workers chronium and iphone5 if i put only chronium browser page.locator then he pass chronium test cases and iphone workers test fail. give me suggestion
Hi Koushik, You mentioned that page.$$(locator) will not wait for all the elements to load and for that page.waitForSelector(..) has to be added. I face this issue in case of frame. But I don't find any function called waitForSelector(..) in frame. Can you suggest any solution here? All that I need is to find multiple elements that matches a locator inside a frame.
How do we add a listener? If we want to stop the execution of the test case if an error element is displayed on screen, what can be done? Only workaround I have is, after each step we should expect the element is not visible.
I don't think we have a listener for that, Using the global configuration we can read after each step but that will be applicable for all the tests, that might not be a better approach
@@letcode if we must/ need to check the element visibility after each and every step due to the requirements in a project, how to configure it globally? Is there any video regarding that? If not, can you make a video on it?
Hi Koushik, I am trying to execute the typescript test as test("Verify login", async () => { try{ page.type('loginInput', userName); //some code } catch(error){ console.log('print error here', error); } } test.afterAll(async () => { console.log("Teardown Phase....."); } Here, If I am facing any locator issue it just comes out of tests and executing test.afterall() and then going back to catch block in test() Is there any way to handle the locator exceptions (if it's unavailable due to page load/some wrong locator), I want to print the exact error / exception
How can I click on a selective url - for e.g - if there are multiple elements inside the repos array, and I want to click on the first link of that - how to do that?
@@letcode nope. Locators are strict. This means that all operations on locators that imply some target DOM element will throw an exception if more than one element matches given selector.
@@letcode not like that bro , epdium nega Soli kudutha enaku super ah purium , full ah pathutu ❤️potalum onu tha video va pakama ❤️ potalum 💯 worth tha . Cucumber or Jenkins matum konjam pathu potu vidunga bro , enaku konjam use full ah irukum
how to find multiple elements using python? which locator or selector should i neeed?
Locator function is recommended.
Bro, even with latest playwright versions, let us assume I am fetching multiple elements using a locator. Then I am using all() method to take it as an array. Thn for iteration which one is advisable " for-await-of or for-of (without await) ?????
Always with await if there is a promise involved.
@@letcode thanks bro
bro... repos print aaguthu
adhukku assertion epdi???
Expect use pannanum bro.
Like getting the count and check.
Hi how to get tooltip text in playwright
You have to inspect the tooltip and text content function to get the text.
@@letcode thanks
Hi how to put if condition in playwright run two parallel workers chronium and iphone5 if i put only chronium browser page.locator then he pass chronium test cases and iphone workers test fail.
give me suggestion
I think u are asking about this
ruclips.net/video/NBHDp-QvGBQ/видео.html
Using Page Object Model(POM)can you please help how to search with debounce and also the radio buttons should populate when displayed
how can i click to an element?
for examle
if(...)
await page.$$('').click()
$$ means finding multiple elements,
You can do click on single element.
your name is bengali but accent is Tamil... whats the story here ? is it Triveni academy ?
Hahhaa.
I'm bengali, but I live in Chennai, so more Tamil accent.
Happy to see you back and recovered, Koushik!
Thank you 😊
Hi Koushik - do you have any email where I can reach to you pls
koushik350@gmail.com
Amazing bro, this is the first video I watch from this playlist Will watch the rest for sure! thanks subbed!
Thank you ☺️
Hi Koushik,
You mentioned that page.$$(locator) will not wait for all the elements to load and for that page.waitForSelector(..) has to be added. I face this issue in case of frame. But I don't find any function called waitForSelector(..) in frame. Can you suggest any solution here? All that I need is to find multiple elements that matches a locator inside a frame.
Hi, don't use $ or $$, use the locator function.
That support wait for in page and frame as well.
@@letcode Thank you so much. Will give it a try and let you know here.
Its working. Thank you so much bro..
in case of $$ , wont playwright wait for default timeout ?
It will wait to get the elements.
How do we add a listener?
If we want to stop the execution of the test case if an error element is displayed on screen, what can be done?
Only workaround I have is, after each step we should expect the element is not visible.
I don't think we have a listener for that,
Using the global configuration we can read after each step but that will be applicable for all the tests, that might not be a better approach
@@letcode if we must/ need to check the element visibility after each and every step due to the requirements in a project, how to configure it globally?
Is there any video regarding that? If not, can you make a video on it?
You can refer this video
ruclips.net/video/t-KsH5p60sk/видео.html
I used it for reporting,
Hi Koushik,
I am trying to execute the typescript test as
test("Verify login", async () => {
try{
page.type('loginInput', userName);
//some code
}
catch(error){
console.log('print error here', error);
}
}
test.afterAll(async () => {
console.log("Teardown Phase.....");
}
Here, If I am facing any locator issue it just comes out of tests and executing test.afterall() and then going back to catch block in test()
Is there any way to handle the locator exceptions (if it's unavailable due to page load/some wrong locator), I want to print the exact error / exception
Hi,
If you use the await properly, then try catch should work fine.
doing same, but still the same issue, and its an intermittent issue only
Ok, I will look into this
@@letcode Also please help me that how can we handle the "TypeError: Cannot read property 'close' of undefined" in playwright
Nice Videos and lot of efforts here. Just needed some pointers on hover and reading hover text. Could not find anything relevant.
Thanks 👍.
Hover function is there, that should do that.
@@letcode yeah, tried it, but unable to read the hovertext. BTW hover text has no locators.
Thanks.
There is some default tooltip in angular and react, we cannot find proper locators for that.
They are from html 5 native error message.
How can I click on a selective url - for e.g - if there are multiple elements inside the repos array, and I want to click on the first link of that - how to do that?
From the repos you can again find an element, like we used to do on web table concept.
@@letcode do I have to have an kind of loop or filter for that … because of I do repos[0].click(), nothing is clicked and the operation times out
If u using my code... Then u have to find a tag. I have taken only the li tag, so clicking on that will perform nothing.
Thanks! I'm a new sub.
Welcome to the channel 😌
Are they any situations where GUI objects cannot be recognized using Playwright , both browser and windows based screens , can u please enlist here
No limitations with playwright.
R u facing any issue?
But is there any object on GUI that playwright cant recognize..
GUI means if u r asking about native windows application, then that is not possible.
Only within browser it can interact.
@@letcode ok but browser all buttons images will work right
@@yotuber09 yes
How do you find multiple elements by using the page.locator function?
Same function can be used to find elements.
playwright.dev/docs/locators
@@letcode nope. Locators are strict. This means that all operations on locators that imply some target DOM element will throw an exception if more than one element matches given selector.
Nope u r wrong my friend,
It's strict if u r trying to access 1 element, if it has multiple find then u can use the nth element.
I think i have already explained it, kindly watch this video.
ruclips.net/video/cvLaBBfuYmA/видео.html
@@letcode Thanks!
❤️
Video paathutu heart podanum 😂
@@letcode not like that bro , epdium nega Soli kudutha enaku super ah purium , full ah pathutu ❤️potalum onu tha video va pakama ❤️ potalum 💯 worth tha . Cucumber or Jenkins matum konjam pathu potu vidunga bro , enaku konjam use full ah irukum